(function (GPU) { function clone(obj) { if(obj === null || typeof(obj) !== 'object' || 'isActiveClone' in obj) return obj; var temp = obj.constructor(); // changed for(var key in obj) { if(Object.prototype.hasOwnProperty.call(obj, key)) { obj.isActiveClone = null; temp[key] = clone(obj[key]); delete obj.isActiveClone; } } return temp; } /// JS fallback transformation, basically pure JS /// /// @param inputFunction The calling to perform the conversion /// @param _threadDim The thread dim array configuration /// @param _blockDim The block dim array configuration /// @param paramObj The parameter object /// /// @returns callable function if converted, else returns null GPU.prototype._backendFallback = function(kernel, paramObj) { function ret() { var threadDim = clone(paramObj.dimensions); while (threadDim.length < 3) { threadDim.push(1); } var ret = new Array(threadDim[2]); for (var i=0; i