Hello, I have been reviewing OpenCL Library in C# for what will use in my project.
But I don't know how to get calculated data from OpenCL Library.
public static void RunGPU()
EasyCL cl = new EasyCL()
Accelerator = AcceleratorDevice.GPU
int WorkSet1 = new int;
int WorkSet2 = new int;
int WorkSet3 = new int;
for (int i = 0; i < 100; i++)
WorkSet1[i] = i;
WorkSet2[i] = i + 1;
WorkSet3[i] = i + 2;
cl.Invoke("dd", 0, 1, WorkSet1, WorkSet2, WorkSet3);
int a = 0;
catch (Exception ex)
static string IsPrime
kernel void dd(global int* message1, global int* message2, global int* message3)
for(int i = 0; i<100; i++)
*(message1 + i) = message2[i] + message3[i];
printf(""%d %d %d\n"", message1[i], message2[i], message3[i]);
in this code, RunGPU Method call the IsPrime.
then message2 and message3 are added, and save in message1
and show message1's values in the Console text box.
but IsPrime method can't effect WorkSet1 in RunGPU
I hope to take a result value(added) to Workset1 in RunGPU.
But I don't know how to do it.
message1 couldn't save in Workset1.
How can message1 be saved in Workset1?
What I have tried:
I have been trying to get it. and make test program from to get result value from OpenCL