Cloo
Cloo copied to clipboard
How to set global variables not included in kernel?
int someGlobal1;
int[] someGlobal2;
kernel void SomeKernel()
{
//some code
}
How can I set values of two global variables defined like this in C#? Is there a way to get variable index by variable name?
As this question is not specific to Cloo, but a general OpenCL question, I suggest you read the OpenCL documentation or ask in an OpenCL forum.
However, as far as I understand global variables have to be defined at compile time and you can not change them from code. See: https://stackoverflow.com/questions/22471466/why-program-global-scope-variables-must-be-constant