Skip to content

Commit 2c8d688

Browse files
committed
Fix retrun type of various device attributes for cuda and hip.
1 parent 633ec40 commit 2c8d688

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);
@@ -646,7 +646,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
646646
}
647647
case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
648648
// The minimum value for the FULL profile is 1 MB.
649-
return ReturnValue(1024lu);
649+
return ReturnValue(size_t(1024));
650650
}
651651
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
652652
return ReturnValue(true);

source/adapters/hip/device.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
321321
return ReturnValue(static_cast<size_t>(Min));
322322
}
323323
case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: {
324-
return ReturnValue(0lu);
324+
return ReturnValue(size_t(0));
325325
}
326326
case UR_DEVICE_INFO_MAX_SAMPLERS: {
327327
// This call is kind of meaningless for HIP, as samplers don't exist.
@@ -331,7 +331,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
331331
case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: {
332332
// __global__ function parameters are passed to the device via constant
333333
// memory and are limited to 4 KB.
334-
return ReturnValue(4000lu);
334+
return ReturnValue(size_t(4000));
335335
}
336336
case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: {
337337
int MemBaseAddrAlign = 0;
@@ -442,7 +442,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
442442
case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: {
443443
// Hard coded to value returned by clinfo for OpenCL 1.2 HIP | GeForce GTX
444444
// 1060 3GB
445-
return ReturnValue(1000lu);
445+
return ReturnValue(size_t(1000));
446446
}
447447
case UR_DEVICE_INFO_ENDIAN_LITTLE: {
448448
return ReturnValue(true);
@@ -569,7 +569,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
569569
}
570570
case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
571571
// The minimum value for the FULL profile is 1 MB.
572-
return ReturnValue(1024lu);
572+
return ReturnValue(size_t(1024));
573573
}
574574
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
575575
return ReturnValue(true);

0 commit comments

Comments
 (0)