-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String support? #50
Comments
I made this little code to try perf on a method : var gpu = new GPU();
var add = gpu.createKernel(function(){
var a = 0;
for(var i=0; i < 100000000000; ++i)
{
if(i < 100)
{
a = a + 1;
}else{
break;
}
}
return a;
}).dimensions([1]);
function bench()
{
add.mode("GPU");
console.time("GPU");
console.log(add());
console.timeEnd("GPU");
add.mode("CPU");
console.time("CPU");
console.log(add());
console.timeEnd("CPU");
} bench result :
|
@PicoCreator we already have loops with variables
|
@fuzzie360 bows @Drulac, would that be good enough? : Now you just need to be able to create fixed arrays in GPU/JS code right? |
This doesn't work I think (I havent the time to test) var add = gpu.createKernel(function(b){
var a = 0;
for(var i=0; i < b; i++)
{
a = a + 1;
}
return a;
}).dimensions([1]).loopMaxIterations(100000000000);
function bench()
{
add.mode("GPU");
console.time("GPU");
console.log(add(100));
console.timeEnd("GPU");
add.mode("CPU");
console.time("CPU");
console.log(add(100));
console.timeEnd("CPU");
} |
Closing this issue because the code snippet works fine now |
@Drulac would be interested. If we get for loops with variables done =P
See: https://gitter.im/gpujs/gpu.js muhaha
The text was updated successfully, but these errors were encountered: