function demo3( assert, mode ) {
var gpu = new GPU({ mode: mode });
var f = gpu.createKernel(function(a, b) {
function custom_adder(a,b) {
return a+b;
}
function some_fun_1(a,b) {
return custom_adder(a,b);
}
function some_fun_2(a,b) {
return custom_adder(a,b);
}
return some_fun_1(1,2)+some_fun_2(a[this.thread.x], b[this.thread.x]);
}, {
dimensions : [6]
}).setDebug(true).setOutput([6]);
var a = [1, 2, 3, 5, 6, 7];
var b = [4, 5, 6, 1, 2, 3];
var res = f(a,b);
return res;
}
console.log(demo3() );
An error occurred compiling the shaders: ERROR: 0:129: 'custom_adder' : no matching overloaded function found
Weird behavior, try to execute this:
there is error