Skip to content

Commit e32ab17

Browse files
[SYCL] Print device aspects in "sycl-ls --verbose" (#8433)
This also adds some error handling to return `false` for queries for not fully implemented ones.
1 parent 9dedcd2 commit e32ab17

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sycl/plugins/hip/pi_hip.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,7 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name,
19801980
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
19811981
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
19821982
case PI_EXT_ONEAPI_DEVICE_INFO_BFLOAT16_MATH_FUNCTIONS:
1983+
case PI_EXT_ONEAPI_DEVICE_INFO_CUDA_ASYNC_BARRIER:
19831984
setErrorMessage("HIP backend does not support this query",
19841985
PI_ERROR_INVALID_ARG_VALUE);
19851986
return PI_ERROR_PLUGIN_SPECIFIC_ERROR;

sycl/tools/sycl-ls/sycl-ls.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ static void printDeviceInfo(const device &Device, bool Verbose,
6969
std::cout << Prepend << "Name : " << DeviceName << std::endl;
7070
std::cout << Prepend << "Vendor : " << DeviceVendor << std::endl;
7171
std::cout << Prepend << "Driver : " << DeviceDriverVersion << std::endl;
72+
73+
std::cout << Prepend << "Aspects :";
74+
#define __SYCL_ASPECT(ASPECT, ID) \
75+
if (Device.has(aspect::ASPECT)) \
76+
std::cout << " " << #ASPECT;
77+
#include <sycl/info/aspects.def>
78+
std::cout << std::endl;
7279
} else {
7380
std::cout << Prepend << ", " << DeviceName << " " << DeviceVersion << " ["
7481
<< DeviceDriverVersion << "]" << std::endl;

0 commit comments

Comments
 (0)