-
Notifications
You must be signed in to change notification settings - Fork 654
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
Proposal: remove _kernelSynchronousExecutor
#78
Comments
also remove |
Hmmm @PicoCreator were you using this for future async support? Maybe we can refactor the async API a little. P.S. Sad to say that async webgl has not yet landed and webworker with local memory has not landed either. So looks like we can't fully utlize async support as of yet... |
This has less to do with sync/async, and more to do with unbinding the last created kernel from the GPU instance. I think it'd be ideal to put them somewhere on the gpu, like maybe As for using promises, we can simply hijack how run is handled either by some method, or by a setting to achieve a promise. for example: const kernel = gpu.createKernel(function() {}, { async: true });
kernel().then(function() {}); There are ton's of different ways of doing this, but the idea would be that kernel remains a singleton, and isn't accessed by the const gpu = new GPU();
const kernel0 = gpu.createKernel(function() {});
const kernel1 = gpu.createKernel(function() {});
const kernel2 = gpu.createKernel(function() {});
gpu.exec(); Here The proposal would be to only allow for this: const gpu = new GPU();
const kernel0 = gpu.createKernel(function() {});
const kernel1 = gpu.createKernel(function() {});
const kernel2 = gpu.createKernel(function() {});
console.log(gpu.kernels[0] === kernel0); //--> true
console.log(gpu.kernels[1] === kernel1); //--> true
console.log(gpu.kernels[2] === kernel2); //--> true
kernel0();
kernel1();
kernel2(); |
Oh I see. It makes sense to keep exec only on the Kernel, but not the GPU class. @PicoCreator I don't remember why exec is in GPU, do you remember why? |
Since
GPU
can create kernels, I don't see a need to relate aKernel
to theGPU
in this manner.The text was updated successfully, but these errors were encountered: