diff --git a/README.md b/README.md index a2558df7..204cb808 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ The created function is a regular JavaScript function, you can use it like regul ```js myFunc(); -// Result: [0, 1, 2, 3, ... 100] +// Result: [0, 1, 2, 3, ... 99] ``` Note: Instead of creating an object, you can use the chainable shortcut methods as a neater way of specificying options. @@ -81,7 +81,7 @@ var myFunc = gpu.createKernel(function() { }).dimensions([100]); myFunc(); -// Result: [0, 1, 2, 3, ... 100] +// Result: [0, 1, 2, 3, ... 99] ``` ### Accepting Input diff --git a/src/backend/fallback.js b/src/backend/fallback.js index f05ba43e..20411038 100644 --- a/src/backend/fallback.js +++ b/src/backend/fallback.js @@ -167,6 +167,11 @@ return ret; }; + ret.loopMaxIterations = function(max) { + opt.loopMaxIterations = max; + return ret; + }; + ret.wraparound = function() { opt.wraparound = false; return ret; diff --git a/src/backend/functionBuilder.js b/src/backend/functionBuilder.js index 04388b4a..c02845dc 100644 --- a/src/backend/functionBuilder.js +++ b/src/backend/functionBuilder.js @@ -64,7 +64,7 @@ var functionBuilder = (function() { /// /// Returns: /// {[String,...]} Returning list of function names that is traced. Including itself. - function traceFunctionCalls( functionName, retList ) { + function traceFunctionCalls( functionName, retList, opt ) { functionName = functionName || "kernel"; retList = retList || []; @@ -76,9 +76,9 @@ var functionBuilder = (function() { } else { retList.push(functionName); - fNode.getWebglFunctionString(); //ensure JS trace is done + fNode.getWebglFunctionString(opt); //ensure JS trace is done for(var i=0; i