您好我正在学习openCL并遵循一本书的示例并尝试执行以下操作
//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);
当我到达最后一行时,它会产生以下错误
Unhandled exception at 0x53349301 (nvopencl.dll) in OpenCLPracticeSetup.exe: 0xC0000005: Access violation reading location 0x656B5F5F.
我猜它是Visual Studio 2012的设置问题,但无法在线找到任何内容,因为nvopencl.dll没有看到错误 这是我更改的属性
C / C ++ 常规 - 我的其他包含目录是:\ NVIDIA GPU Computing Toolkit \ CUDA \ v4.2 \ include \ CL 链接 常规 - 我的其他库目录是:\ NVIDIA GPU Computing Toolkit \ CUDA \ v4.2 \ lib \ Win32 输入 - 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)
由于
答案 0 :(得分:0)
我找到了问题的答案,我本应该参考来源。
由于