I have two kernels in my app:
__kernel void
set_decomposition_key(
__global const double* values_ref,
__global const double* decomposition_results_ref,
__global double* decomposition_keys)
{ /* Some code, results are put into decomposition_keys */ }
__kernel void
decompose(
__global const double* values,
__global const double* decomposition_keys,
__global double* decomposition_results)
{ /* Some code, results are put into decomposition_results */ }
set_decomposition_key() executes once when the app's starting, it puts its calculation results into the decomposition_keys value. Then decompose(), the main function, comes into play: it executes in a loop performing some operations in real time. It uses results of the first function stored in decomposition_keys as its second parameter. So the thing's that I want to keep this variable in an OpenCL device's memory without taking it to a host and then setting again for the second kernel every loop.
But I don't know how to do this, my attempts to find a working solution by myself failed. So I'll appreciate any help here. Thank you in advance.
Note: I know about this answer, suddenly it doesn't work for me.