I’m trying to build/compile Nvidia OpenCL samples on AMD GPUs with no luck. I get an error with the clCreateContext…Type function call? Any suggestions?
Actually, the samples build/compile just fine. But then I get a runtime error:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
on the line: context = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &errnum);
This is the sample codes problem. Before ICD you could even specify null for the properties arg and get away with it. Specifying 0 for a 0 terminated list is almost the same as null. You need a CL_CONTEXT_PLATFORM (4228), the value of your cl_platform, 0.
Does this sample currently run on nVidia? Is it possible your sample code is old?
I have a 3.0 toolkit, and checked the source for one of the samples, and it had this 0. (Maybe that is null, I have been using Java so long I forgot what C used for null). My sample code no longer runs for me with nVidia GPU.