Hi I am learning openCL and following an example of a book and trying to do the following
//Obtain the GPU data (platform, device and context)
PlatformDevice gpu = retrieveDevice(CL_DEVICE_TYPE_GPU);
assert(gpu.allDat![enter image description here][1]aPresent());
const char * kernalSource = "__kernel void multiplication(__global float* GridA, __global float* GridB,__global float* val ){int igrid = get_global_id(0);float a = GridA[igrid];float b = GridB[igrid];val[igrid] = a * b;}";
//Create Program
cl_program program = clCreateProgramWithSource(gpu.context,1, (const char**) kernalSource,NULL,&err);
When I get to the last line it produces the following error
Unhandled exception at 0x53349301 (nvopencl.dll) in OpenCLPracticeSetup.exe: 0xC0000005: Access violation reading location 0x656B5F5F.
I guess its a setup issue for Visual Studio 2012 but can't find anything online as not seen an error with nvopencl.dll Here are my changed properties
c/c++ General - My additional include directories is: \NVIDIA GPU Computing Toolkit\CUDA\v4.2\include\CL Linker General - My additional library directories is: \NVIDIA GPU Computing Toolkit\CUDA\v4.2\lib\Win32 Input - OpenCL.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
Thanks
gpu? Is the context non NULL? - Eric Bainville