Skip to content

Commit 82d4d82

Browse files
author
Hugh Delaney
committed
Change int to size_t
Change return type to 64 bits to avoid truncation.
1 parent 5695973 commit 82d4d82

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/adapters/cuda/context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct ur_context_handle_t_ {
117117
}
118118

119119
// Gets the index of the device relative to other devices in the context
120-
int getDeviceIndex(ur_device_handle_t hDevice) {
120+
size_t getDeviceIndex(ur_device_handle_t hDevice) {
121121
auto It = std::find(Devices.begin(), Devices.end(), hDevice);
122122
assert(It != Devices.end());
123123
return std::distance(Devices.begin(), It);

source/adapters/hip/context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct ur_context_handle_t_ {
113113
}
114114

115115
// Gets the index of the device relative to other devices in the context
116-
int getDeviceIndex(ur_device_handle_t hDevice) {
116+
size_t getDeviceIndex(ur_device_handle_t hDevice) {
117117
auto It = std::find(Devices.begin(), Devices.end(), hDevice);
118118
assert(It != Devices.end());
119119
return std::distance(Devices.begin(), It);

0 commit comments

Comments
 (0)