cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

maximmoroz
Journeyman III

Does kernel.setArg affect already enqueued kernel?

I am bit lost... Is it Ok to setArg, then enqueue the kernel, then change the arg, and enqueue the kernel again? Will it be executed with different values of argument?

kernel.setArg(0, 1.0); command_queue.enqueueNDRangeKernel(kernel, cl::NDRange(0), cl::NDRange(64), cl::NullRange); kernel.setArg(0, 2.0); command_queue.enqueueNDRangeKernel(kernel, cl::NDRange(0), cl::NDRange(64), cl::NullRange); command_queue.flush();

0 Likes
2 Replies
rick_weber
Adept II

The first kernel executed will have it's 1st parameter set to the double precision value 1.0 and the second execution of the kernel will have the parameter set to 2.0. What you've done should be correct.

0 Likes

Thanks a lot!

0 Likes