[Bf-blender-cvs] [e20a0798dc6] master: Cycles: Append compute units for RX Vega card names

fclem noreply at git.blender.org
Thu Aug 9 15:58:02 CEST 2018


Commit: e20a0798dc6ca38eb4a06dda7948bd1c306d0693
Author: fclem
Date:   Thu Aug 9 15:41:24 2018 +0200
Branches: master
https://developer.blender.org/rBe20a0798dc6ca38eb4a06dda7948bd1c306d0693

Cycles: Append compute units for RX Vega card names

Makes it more clear whether compute device is Vega 56 or Vega 64.

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

M	intern/cycles/device/opencl/opencl_util.cpp

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

diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index 9104f64bedd..d6304ba688a 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -1136,6 +1136,21 @@ string OpenCLInfo::get_readable_device_name(cl_device_id device_id)
 		name = get_device_name(device_id);
 	}
 
+	/* Special exception for AMD Vega, need to be able to tell
+	 * Vega 56 from 64 apart.
+	 */
+	if (name == "Radeon RX Vega") {
+		cl_int max_compute_units = 0;
+		if (clGetDeviceInfo(device_id,
+		                    CL_DEVICE_MAX_COMPUTE_UNITS,
+		                    sizeof(max_compute_units),
+		                    &max_compute_units,
+		                    NULL) == CL_SUCCESS)
+		{
+			name += " " + to_string(max_compute_units);
+		}
+	}
+
 	/* Distinguish from our native CPU device. */
 	if(get_device_type(device_id) & CL_DEVICE_TYPE_CPU) {
 		name += " (OpenCL)";



More information about the Bf-blender-cvs mailing list