我有ATI HD 5470的Radeon,在我的戴爾1558,和AMDAPP SDK 2.8我win7-64 問題在安裝時我使用的OpenCL代碼爲細末設備也說:OpenCL設備不存在
「找不到任何設備:沒有錯誤」
我知道,我已經安裝了最新的催化劑驅動程序& 其他所有我的程序運行良好,GPU, 但我不知道爲什麼做這個報告。這裏是我用來查找設備的代碼: 感謝每一位幫助我找出問題所在?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef MAC
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
int main() {
cl_platform_id platform;
cl_device_id *devices;
cl_uint num_devices, addr_data;
cl_int i, err;
char name_data[48], ext_data[4096];
err = clGetPlatformIDs(1, &platform, NULL);
if(err < 0) {
perror("Couldn't find any platforms");
exit(1);
}
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL,
1, NULL, &num_devices);
if(err < 0) {
perror("Couldn't find any devices");
exit(1);
}
devices = (cl_device_id*)
malloc(sizeof(cl_device_id) * num_devices);
clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL,
num_devices, devices, NULL);
for(i=0; i<num_devices; i++) {
err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME,
sizeof(name_data), name_data, NULL);
if(err < 0) {
perror("Couldn't read extension data");
exit(1);
}
clGetDeviceInfo(devices[i], CL_DEVICE_ADDRESS_BITS,
sizeof(ext_data), &addr_data, NULL);
clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS,
sizeof(ext_data), ext_data, NULL);
printf("NAME: %s\nADDRESS_WIDTH: %u\nEXTENSIONS: %s",
name_data, addr_data, ext_data);
}
free(devices);
return 0;
}
請提供OCL API的錯誤代碼以供進一步分析。因爲你在程序中硬編碼了你自己的錯誤句子! – DarkZeros