i've a problem with a Java program which is loading a dll to compute several things on the GPU. I trieded many things and at the moment i don't know, maybe it's a bug. Everytime i want to call a kernel the program crashes with a Java Exception: An unexpected error has been detected by the Java Runtime Environment EXCEPTION_ACCESS_VIOLATION.
I reduced everything to find the error but i can't find it, this is the kernel:
kernel void sum(float a<>, float b<>, out float c<>
c = a + b;
This is the function in the dll that calls the kernel:
JNIEXPORT void JNICALL funk
(JNIEnv *env, jobject obj,)
unsigned int ssize = 10000;
const unsigned int DATA_SIZE = 10000;
This is how i compile the dll:
cl.exe /EHsc -I%jdkp% -I%jdkw32% -I%brook% -I%common% -LD main.cpp gpu.cpp -FeGPU_DLL.dll /link /LIBPATH:%brooklibs% %libs%
The whole thing works as a normal program, but in the dll it crashes. If i remove the kernel call ( sum(stream1,stream2,stream3)) from the program there is also no Error. Every call from the dll to the GPU causes an error. What i'm doing wrong?