[Bf-blender-cvs] [3a2c0cc] master: Cycles: Correction to opencl whitelist check

Sergey Sharybin noreply at git.blender.org
Sun May 10 17:02:37 CEST 2015


Commit: 3a2c0ccdd0236bf26983f5e4d501f7bc234ed6c0
Author: Sergey Sharybin
Date:   Sun May 10 20:01:24 2015 +0500
Branches: master
https://developer.blender.org/rB3a2c0ccdd0236bf26983f5e4d501f7bc234ed6c0

Cycles: Correction to opencl whitelist check

Was using platform as a device id accidentally.

===================================================================

M	intern/cycles/device/device_opencl.cpp

===================================================================

diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index e342010..5657e3a 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -3364,22 +3364,22 @@ 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];
 			char name[1024] = "\0";
 
+			cl_device_type device_type;
+			clGetDeviceInfo(device_id, 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;
+			}
+
 			if(clGetDeviceInfo(device_id, CL_DEVICE_NAME, sizeof(name), &name, NULL) != CL_SUCCESS)
 				continue;




More information about the Bf-blender-cvs mailing list