Skip to content

Commit 8d86f5b

Browse files
authored
Merge pull request #1568 from mmoadeli/fix-ur-return-type
[CUDA][HIP] Fix return type of various device attributes.
2 parents 4ea7916 + 5bd6d03 commit 8d86f5b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

source/adapters/cuda/device.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
418418
return ReturnValue(static_cast<size_t>(Min));
419419
}
420420
case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: {
421-
return ReturnValue(0lu);
421+
return ReturnValue(size_t(0));
422422
}
423423
case UR_DEVICE_INFO_MAX_SAMPLERS: {
424424
// This call is kind of meaningless for cuda, as samplers don't exist.
@@ -429,7 +429,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
429429
// https://docs.nvidia.com/cuda/cuda-c-programming-guide/#function-parameters
430430
// __global__ function parameters are passed to the device via constant
431431
// memory and are limited to 4 KB.
432-
return ReturnValue(4000lu);
432+
return ReturnValue(size_t(4000));
433433
}
434434
case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: {
435435
int MemBaseAddrAlign = 0;
@@ -542,7 +542,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
542542
case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: {
543543
// Hard coded to value returned by clinfo for OpenCL 1.2 CUDA | GeForce GTX
544544
// 1060 3GB
545-
return ReturnValue(1000lu);
545+
return ReturnValue(size_t(1000));
546546
}
547547
case UR_DEVICE_INFO_ENDIAN_LITTLE: {
548548
return ReturnValue(true);
@@ -647,7 +647,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
647647
}
648648
case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
649649
// The minimum value for the FULL profile is 1 MB.
650-
return ReturnValue(1024lu);
650+
return ReturnValue(size_t(1024));
651651
}
652652
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
653653
return ReturnValue(true);

source/adapters/hip/device.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
322322
return ReturnValue(static_cast<size_t>(Min));
323323
}
324324
case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: {
325-
return ReturnValue(0lu);
325+
return ReturnValue(size_t(0));
326326
}
327327
case UR_DEVICE_INFO_MAX_SAMPLERS: {
328328
// This call is kind of meaningless for HIP, as samplers don't exist.
@@ -332,7 +332,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
332332
case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: {
333333
// __global__ function parameters are passed to the device via constant
334334
// memory and are limited to 4 KB.
335-
return ReturnValue(4000lu);
335+
return ReturnValue(size_t(4000));
336336
}
337337
case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: {
338338
int MemBaseAddrAlign = 0;
@@ -443,7 +443,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
443443
case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: {
444444
// Hard coded to value returned by clinfo for OpenCL 1.2 HIP | GeForce GTX
445445
// 1060 3GB
446-
return ReturnValue(1000lu);
446+
return ReturnValue(size_t(1000));
447447
}
448448
case UR_DEVICE_INFO_ENDIAN_LITTLE: {
449449
return ReturnValue(true);
@@ -570,7 +570,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
570570
}
571571
case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
572572
// The minimum value for the FULL profile is 1 MB.
573-
return ReturnValue(1024lu);
573+
return ReturnValue(size_t(1024));
574574
}
575575
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
576576
return ReturnValue(true);

0 commit comments

Comments
 (0)