c++ - Send same data to multiples kernel in OpenCL -


i have multiple kernels,in first of them send entries, output have first kernel input next. queue of kernels repeat behavior 8 times until last kernel sends me real output need.

this example of did:

cl::kernel kernel1 = cl::kernel(opetcl::program, "forward");  //agrego los argumetnos del kernel kernel1.setarg(0, cl_rowcol); kernel1.setarg(1, cl_data); kernel1.setarg(2, cl_x); kernel1.setarg(3, cl_b); kernel1.setarg(4, sizeof(int), &largo);  //ejecuto el kernel opetcl::queue.enqueuendrangekernel(kernel1, cl::nullrange, global, local, null, &profilingapp);   /********************************/ /** ejecuto las simetrias de x **/ /********************************/ cl::kernel kernel2 = cl::kernel(opetcl::program, "forward_symmx");   //agrego los argumetnos del kernel kernel2.setarg(0, cl_rowcol); kernel2.setarg(1, cl_data); kernel2.setarg(2, cl_x); kernel2.setarg(3, cl_b); kernel2.setarg(4, cl_symmlor_x); kernel2.setarg(5, cl_symm_xpixel); kernel2.setarg(6, sizeof(int), &largo);  //ejecuto el kernel opetcl::queue.enqueuendrangekernel(kernel2, cl::nullrange, global, local, null, &profilingapp);  opetcl::queue.finish();  opetcl::queue.enqueuereadbuffer(cl_b, cl_true, 0, sizeof(float) * lors, b, null, null); 

in case cl_b output need.



my question if arguments send kernels same kernel, 1 different.

is correct did set arguments??
arguments keeping in device during kernels execution??

since using same queue , opencl-context ok , kernels can use data (arguments) calculated previous kernel , data kept on device. suggest use clfinish after each kernel execution assure previous kernel finished calculation, before next 1 starts. alternatively, can use events, assure that.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -