1 of 1 people found this helpful
#pragma OPENCL EXTENSION go into kernel code. not normal host code.
That solves the pragma warning, but the error still exists. I searched SDK for the d3d function signatures and found that they were wrapped in a define D3DINTEROP (something like that). I tried to simply define that in my build, but it still didn't fix my error.
I'll keep posting what I find...
So, I think I figured it out...
I came across the clGetExtensionFunctionAddressForPlatform function when reading through the man pages, and when looking at the cl_d3d10 header, I noticed that its a bunch of type defines for function pointers. Long story short I wrote the following code and was able to successfully call a d3d extension function.
clCreateFromD3D10BufferKHR_fn function = (clCreateFromD3D10BufferKHR_fn)clGetExtensionFunctionAddressForPlatform(this->platform_id, "clCreateFromD3D10BufferKHR");
ID3D10Buffer *resource = 0;
cl_mem memory = (*function)(
Now, the error code returns -30 which is CL_INVALID_VALUE, but this makes sense, because the ID3D10Buffer is null. Next I'll try calling it with a properly initialized d3d buffer.
Is this the proper way to access OpenCl extensions?
So I tried the above with a properly initialized d3d10 buffer and it did indeed work so...