OpenCL程序中的访问冲突异常

时间:2017-04-24 13:32:04

标签: c visual-c++ opencl gpgpu

我在此行中收到了访问冲突异常

err = clGetPlatformIDs(0, NULL, &numPlatforms);

我可以做些什么来防止此异常。 我使用的是AMD App SDK 3.0。我的PC配置是核心i7 5500U CPU和AMD R5 M230 GPU,Windows 10 64位。

我的完整计划就在这里。

#include<stdio.h>
#include<CL/cl.h>

int main(void){
 cl_int err;
 cl_uint numPlatforms;

 err = clGetPlatformIDs(0, NULL, &numPlatforms);
 if (CL_SUCCESS == err)
    printf("\nDetected OpenCL platforms: %d", numPlatforms);
 else
    printf("\nError calling clGetPlatformIDs. Error code: %d", err);

 return 0;
}

调试器输出:

'Test.exe' (Win32): Loaded 'C:\Users\Artista\Documents\Visual Studio 
2017\Projects\Test\x64\Debug\Test.exe'. Symbols loaded.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Cannot 
find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\OpenCL.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\IntelOpenCL64.dll'. Cannot 
find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Program Files (x86)\Common 
Files\Intel\OpenCL\bin\x64\intelocl64.dll'. Cannot find or open the PDB 
file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Program Files (x86)\Common 
Files\Intel\OpenCL\bin\x64\task_executor64.dll'. Cannot find or open the PDB 
file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ddraw.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\dciman32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Program Files (x86)\Common 
Files\Intel\OpenCL\bin\x64\cpu_device64.dll'. Cannot find or open the PDB 
file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\igdrcl64.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ResourcePolicyClient.dll'. 
Cannot find or open the PDB file.
'Test.exe' (Win32): Unloaded 'C:\Windows\System32\ResourcePolicyClient.dll'
'Test.exe' (Win32): Loaded 
'C:\Windows\System32\DriverStore\FileRepository
\c0313248.inf_amd64_aad49543f8f7
14a1\amdhdl64.dll'.Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. 
Cannot find or open the PDB file.
'Test.exe' (Win32): Unloaded 'C:\Windows\System32\ucrtbase.dll'
'Test.exe' (Win32): Unloaded 'C:\Windows\System32\combase.dll'
'Test.exe' (Win32): Unloaded 'C:\Windows\System32\shlwapi.dll'
'Test.exe' (Win32): Unloaded 
'C:\Windows\System32\DriverStore\FileRepository
\c0313248.inf_amd64_aad49543f8f714a1\amdhdl64.dll'
'Test.exe' (Win32): Loaded 'C:\Windows\System32\igdfcl64.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\igdmcl64.dll'. Cannot findor 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\dbghelp.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\igdbcl64.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\igdusc64.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 
'C:\Windows\System32\DriverStore\FileRepository
\c0313248.inf_amd64_aad49543f8f714a1\amdocl64.dll'. Cannot find or open the 
PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\atiadlxx.dll'. Cannot find
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. Cannot 
find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Cannot 
find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\userenv.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\wtsapi32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find 
or open the PDB file.
'Test.exe' (Win32): Unloaded 'C:\Windows\System32\winmmbase.dll'
'Test.exe' (Win32): Unloaded 'C:\Windows\System32\winmmbase.dll'
'Test.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Cannot find or 
open the PDB file.
'Test.exe' (Win32): Loaded 
'C:\Windows\System32\DriverStore\FileRepository
\c0313248.inf_amd64_aad49543f8f714a1\atig6txx.dll'. Cannot find or open the 
PDB file.
'Test.exe' (Win32): Loaded 'C:\Program Files (x86)\AMD APP 
SDK\3.0\bin\x86_64\amdocl12cl64.dll'. Cannot find or open the PDB file.
Exception thrown at 0x000001896545F8E0 in Test.exe: 0xC0000005: Access 
violation executing location 0x000001896545F8E0.
  

异常:在opencl.exe中0x0000024AD73CF9F0抛出异常:0xC0000005:访问冲突执行位置0x0000024AD73CF9F0。

Screenshot of the Exception

0 个答案:

没有答案