Skip to content

[SYCL][NFC] align names of pi_device_info enumerators #966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions sycl/include/CL/sycl/detail/pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ typedef enum : pi_uint64 {

// TODO: populate and sync with cl::sycl::info::device
typedef enum {
PI_DEVICE_INFO_TYPE = CL_DEVICE_TYPE,
PI_DEVICE_INFO_PARENT = CL_DEVICE_PARENT_DEVICE,
PI_DEVICE_INFO_PLATFORM = CL_DEVICE_PLATFORM,
PI_DEVICE_INFO_PARTITION_TYPE = CL_DEVICE_PARTITION_TYPE,
PI_DEVICE_INFO_NAME = CL_DEVICE_NAME,
PI_DEVICE_VERSION = CL_DEVICE_VERSION,
PI_DEVICE_MAX_WORK_GROUP_SIZE = CL_DEVICE_MAX_WORK_GROUP_SIZE,
PI_DEVICE_INFO_EXTENSIONS = CL_DEVICE_EXTENSIONS
PI_DEVICE_INFO_TYPE = CL_DEVICE_TYPE,
PI_DEVICE_INFO_PARENT = CL_DEVICE_PARENT_DEVICE,
PI_DEVICE_INFO_PLATFORM = CL_DEVICE_PLATFORM,
PI_DEVICE_INFO_PARTITION_TYPE = CL_DEVICE_PARTITION_TYPE,
PI_DEVICE_INFO_NAME = CL_DEVICE_NAME,
PI_DEVICE_INFO_VERSION = CL_DEVICE_VERSION,
PI_DEVICE_INFO_MAX_WORK_GROUP_SIZE = CL_DEVICE_MAX_WORK_GROUP_SIZE,
PI_DEVICE_INFO_EXTENSIONS = CL_DEVICE_EXTENSIONS
} _pi_device_info;

// TODO: populate
Expand Down
9 changes: 5 additions & 4 deletions sycl/source/detail/error_handling/enqueue_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ bool handleInvalidWorkGroupSize(pi_device Device, pi_kernel Kernel,
const bool HasLocalSize = (NDRDesc.LocalSize[0] != 0);

size_t VerSize = 0;
PI_CALL(piDeviceGetInfo)(Device, PI_DEVICE_VERSION, 0, nullptr, &VerSize);
PI_CALL(piDeviceGetInfo)(Device, PI_DEVICE_INFO_VERSION, 0, nullptr,
&VerSize);
assert(VerSize >= 10 &&
"Unexpected device version string"); // strlen("OpenCL X.Y")
string_class VerStr(VerSize, '\0');
PI_CALL(piDeviceGetInfo)(Device, PI_DEVICE_VERSION, VerSize, &VerStr.front(),
nullptr);
PI_CALL(piDeviceGetInfo)(Device, PI_DEVICE_INFO_VERSION, VerSize,
&VerStr.front(), nullptr);
const char *Ver = &VerStr[7]; // strlen("OpenCL ")

size_t CompileWGSize[3] = {0};
Expand Down Expand Up @@ -69,7 +70,7 @@ bool handleInvalidWorkGroupSize(pi_device Device, pi_kernel Kernel,
// than the value specified by CL_DEVICE_MAX_WORK_GROUP_SIZE in
// table 4.3
size_t MaxWGSize = 0;
PI_CALL(piDeviceGetInfo)(Device, PI_DEVICE_MAX_WORK_GROUP_SIZE,
PI_CALL(piDeviceGetInfo)(Device, PI_DEVICE_INFO_MAX_WORK_GROUP_SIZE,
sizeof(size_t), &MaxWGSize, nullptr);
const size_t TotalNumberOfWIs =
NDRDesc.LocalSize[0] * NDRDesc.LocalSize[1] * NDRDesc.LocalSize[2];
Expand Down