diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-09 21:40:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-09 21:40:26 +0300 |
commit | 136d7a4f6239308ba8b8533b31c3d2a21c4f43cc (patch) | |
tree | f8a4cfb5248fd65516ad5f5d713776de02c937c8 /intern | |
parent | 8647c7d5010a844349ea6f7d180408cafbbb4848 (diff) |
Cycles: Only whitelist AMD GPU devices in the OpenCL section
Only those ones are priority for now, all the rest are still testable
if CYCLES_OPENCL_TEST or CYCLES_OPENCL_SPLIT_KERNEL_TEST environment
variables are set.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 25eb160d71b..e342010567f 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -3346,6 +3346,10 @@ void device_opencl_info(vector<DeviceInfo>& devices) /* devices are numbered consecutively across platforms */ int num_base = 0; + const bool force_all_platforms = + (getenv("CYCLES_OPENCL_TEST") != NULL) || + (getenv("CYCLES_OPENCL_SPLIT_KERNEL_TEST")) != NULL; + for(int platform = 0; platform < num_platforms; platform++, num_base += num_devices) { num_devices = 0; if(clGetDeviceIDs(platform_ids[platform], opencl_device_type(), 0, NULL, &num_devices) != CL_SUCCESS || num_devices == 0) @@ -3360,6 +3364,17 @@ void device_opencl_info(vector<DeviceInfo>& devices) clGetPlatformInfo(platform_ids[platform], CL_PLATFORM_NAME, sizeof(pname), &pname, NULL); string platform_name = pname; + cl_device_type device_type; + clGetDeviceInfo(device_ids[platform], CL_DEVICE_TYPE, sizeof(cl_device_type), &device_type, NULL); + + /* TODO(sergey): Make it an utility function to check whitelisted devices. */ + if(!(force_all_platforms || + (platform_name == "AMD Accelerated Parallel Processing" && + device_type == CL_DEVICE_TYPE_GPU))) + { + continue; + } + /* add devices */ for(int num = 0; num < num_devices; num++) { cl_device_id device_id = device_ids[num]; |