Skip to content

Commit fa43450

Browse files
authored
Merge pull request #1854 from kbenzie/benie/fix-cuda-windows-build
Fix CUDA Windows build
2 parents 642e343 + 9f0c515 commit fa43450

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

source/adapters/cuda/device.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform,
11671167

11681168
UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle(
11691169
ur_device_handle_t hDevice, ur_native_handle_t *phNativeHandle) {
1170-
*phNativeHandle = reinterpret_cast<ur_native_handle_t>(
1171-
static_cast<std::uintptr_t>(hDevice->get()));
1170+
*phNativeHandle = static_cast<ur_native_handle_t>(hDevice->get());
11721171
return UR_RESULT_SUCCESS;
11731172
}
11741173

test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ TEST_F(urCudaDeviceCreateWithNativeHandle, Success) {
1515
CUdevice cudaDevice;
1616
ASSERT_SUCCESS_CUDA(cuDeviceGet(&cudaDevice, 0));
1717

18-
ur_native_handle_t nativeCuda = reinterpret_cast<ur_native_handle_t>(
19-
static_cast<std::uintptr_t>(cudaDevice));
18+
ur_native_handle_t nativeCuda = static_cast<ur_native_handle_t>(cudaDevice);
2019
ur_device_handle_t urDevice;
2120
ASSERT_SUCCESS(urDeviceCreateWithNativeHandle(nativeCuda, platform, nullptr,
2221
&urDevice));

0 commit comments

Comments
 (0)