Initializing constant variables


I am trying to overwrite code from CUDA to OpenCl.
Is there a way how to initialize constants variables declared in program source from host source?
In CUDA you can read global variables with the function cuModuleGetGlobal() and set their values. I would like to do something like that in OpenCL.


You can create the constants variables on the host, then initialize a memory object that contains it, do the corresponding copy of data, add this memory object in the kernel args and finally add the lline on you r kernel function file with __constant prefix.