From 6bd9affdcceeb0a35b7967526d1af843b2415e61 Mon Sep 17 00:00:00 2001 From: Jin Z <5zj@cousteau.ftpn.ornl.gov> Date: Mon, 9 May 2022 16:07:35 -0400 Subject: [PATCH 1/3] Vendor ID for AMD devices is expected to be 4098 --- sycl/plugins/hip/pi_hip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/plugins/hip/pi_hip.cpp b/sycl/plugins/hip/pi_hip.cpp index bd54d668eade0..3d6f958c18705 100644 --- a/sycl/plugins/hip/pi_hip.cpp +++ b/sycl/plugins/hip/pi_hip.cpp @@ -980,7 +980,7 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name, PI_DEVICE_TYPE_GPU); } case PI_DEVICE_INFO_VENDOR_ID: { - return getInfo(param_value_size, param_value, param_value_size_ret, 4318u); + return getInfo(param_value_size, param_value, param_value_size_ret, 4098u); } case PI_DEVICE_INFO_MAX_COMPUTE_UNITS: { int compute_units = 0; From 2d084a45f9c47013c0731d826e20c528478a0b35 Mon Sep 17 00:00:00 2001 From: Jin Z <5zj@cousteau.ftpn.ornl.gov> Date: Mon, 16 May 2022 13:49:42 -0400 Subject: [PATCH 2/3] The vendor IDs for AMD and NVIDIA GPUs are 4098 and 4318, respectively --- sycl/plugins/hip/pi_hip.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sycl/plugins/hip/pi_hip.cpp b/sycl/plugins/hip/pi_hip.cpp index 6d1e65d3875f7..40c4df312ffc0 100644 --- a/sycl/plugins/hip/pi_hip.cpp +++ b/sycl/plugins/hip/pi_hip.cpp @@ -980,7 +980,15 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name, PI_DEVICE_TYPE_GPU); } case PI_DEVICE_INFO_VENDOR_ID: { - return getInfo(param_value_size, param_value, param_value_size_ret, 4098u); + #if defined(__HIP_PLATFORM_AMD__) + pi_uint32 vendor_id = 4098u; + #elif defined(__HIP_PLATFORM_NVIDIA__) + pi_uint32 vendor_id = 4318u; + #else + pi_uint32 vendor_id = 0u; + #endif + return getInfo(param_value_size, param_value, param_value_size_ret, + vendor_id); } case PI_DEVICE_INFO_MAX_COMPUTE_UNITS: { int compute_units = 0; From c2b48d746f3b189c1f0f0ae4687ebbc47b76bae4 Mon Sep 17 00:00:00 2001 From: zjin-lcf <57232910+zjin-lcf@users.noreply.github.com> Date: Fri, 20 May 2022 07:08:18 -0400 Subject: [PATCH 3/3] Update sycl/plugins/hip/pi_hip.cpp The indentation needs to be clang-formatted Co-authored-by: Nicolas Miller --- sycl/plugins/hip/pi_hip.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sycl/plugins/hip/pi_hip.cpp b/sycl/plugins/hip/pi_hip.cpp index 40c4df312ffc0..a8005b5633a68 100644 --- a/sycl/plugins/hip/pi_hip.cpp +++ b/sycl/plugins/hip/pi_hip.cpp @@ -980,13 +980,14 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name, PI_DEVICE_TYPE_GPU); } case PI_DEVICE_INFO_VENDOR_ID: { - #if defined(__HIP_PLATFORM_AMD__) - pi_uint32 vendor_id = 4098u; - #elif defined(__HIP_PLATFORM_NVIDIA__) - pi_uint32 vendor_id = 4318u; - #else - pi_uint32 vendor_id = 0u; - #endif +#if defined(__HIP_PLATFORM_AMD__) + pi_uint32 vendor_id = 4098u; +#elif defined(__HIP_PLATFORM_NVIDIA__) + pi_uint32 vendor_id = 4318u; +#else + pi_uint32 vendor_id = 0u; +#endif + return getInfo(param_value_size, param_value, param_value_size_ret, vendor_id); }