I am considering the possibility of passing local variable (i.e. local memory pointer and/or address) from one kernel to another. So is there anyone here can help a suggestion. The scenario is described below:
- I did the task f1 in kernel k1 and get some results store in a local memory variable (let says __local output_k1). Now I lunch a second kernel k2 and this kernel k2 wanna get the out put Output_k1 from kernel k1 as k2's input. Traditionally we may need to write back the Output_k1 to the host then the host pass those values located in host memory to the kernel k2. However it is really inefficient to do that, so I want to keep Output_k1 inside the device's local memory and just pass the pointer to that local memory location to kernel k2.