Skip to content

[CUDA][HIP] Fix return type of various device attributes. #1568

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
merged 2 commits into from
Jun 5, 2024
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
8 changes: 4 additions & 4 deletions source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(static_cast<size_t>(Min));
}
case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: {
return ReturnValue(0lu);
return ReturnValue(size_t(0));
}
case UR_DEVICE_INFO_MAX_SAMPLERS: {
// This call is kind of meaningless for cuda, as samplers don't exist.
Expand All @@ -429,7 +429,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
// https://docs.nvidia.com/cuda/cuda-c-programming-guide/#function-parameters
// __global__ function parameters are passed to the device via constant
// memory and are limited to 4 KB.
return ReturnValue(4000lu);
return ReturnValue(size_t(4000));
}
case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: {
int MemBaseAddrAlign = 0;
Expand Down Expand Up @@ -542,7 +542,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: {
// Hard coded to value returned by clinfo for OpenCL 1.2 CUDA | GeForce GTX
// 1060 3GB
return ReturnValue(1000lu);
return ReturnValue(size_t(1000));
}
case UR_DEVICE_INFO_ENDIAN_LITTLE: {
return ReturnValue(true);
Expand Down Expand Up @@ -647,7 +647,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
}
case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
// The minimum value for the FULL profile is 1 MB.
return ReturnValue(1024lu);
return ReturnValue(size_t(1024));
}
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
return ReturnValue(true);
Expand Down
8 changes: 4 additions & 4 deletions source/adapters/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(static_cast<size_t>(Min));
}
case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: {
return ReturnValue(0lu);
return ReturnValue(size_t(0));
}
case UR_DEVICE_INFO_MAX_SAMPLERS: {
// This call is kind of meaningless for HIP, as samplers don't exist.
Expand All @@ -331,7 +331,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: {
// __global__ function parameters are passed to the device via constant
// memory and are limited to 4 KB.
return ReturnValue(4000lu);
return ReturnValue(size_t(4000));
}
case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: {
int MemBaseAddrAlign = 0;
Expand Down Expand Up @@ -442,7 +442,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: {
// Hard coded to value returned by clinfo for OpenCL 1.2 HIP | GeForce GTX
// 1060 3GB
return ReturnValue(1000lu);
return ReturnValue(size_t(1000));
}
case UR_DEVICE_INFO_ENDIAN_LITTLE: {
return ReturnValue(true);
Expand Down Expand Up @@ -569,7 +569,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
}
case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
// The minimum value for the FULL profile is 1 MB.
return ReturnValue(1024lu);
return ReturnValue(size_t(1024));
}
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
return ReturnValue(true);
Expand Down