Skip to content

Commit d6991cd

Browse files
author
Hugh Delaney
authored
[SYCL][UR] Use static cast instead of ur::cast (#14830)
UR cast is using reinterpret cast under the hood, which was failing for an unsigned long being cast to an unsigned long long. From the C++ spec: > An expression of integral, enumeration, pointer, or pointer-to-member type can be converted to its own type. The resulting value is the same as the value of expression. Since `unsigned long` is not the same type as `unsigned long long`, the `reinterpret_cast` fails. Ping @aarongreig
1 parent bf96991 commit d6991cd

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

sycl/include/sycl/backend.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct BufferInterop {
9696
GetNativeObjs(const std::vector<ur_native_handle_t> &Handle) {
9797
ReturnType ReturnValue = 0;
9898
if (Handle.size()) {
99-
ReturnValue = detail::ur::cast<ReturnType>(Handle[0]);
99+
ReturnValue = (ReturnType)(Handle[0]);
100100
}
101101
return ReturnValue;
102102
}

sycl/test-e2e/EnqueueNativeCommand/custom-command-cuda.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// RUN: %{run} %t.out
33
// REQUIRES: cuda, cuda_dev_kit
44

5-
// TODO: Reenable, see https://github.com/intel/llvm/issues/14598
6-
// UNSUPPORTED: windows, linux
7-
85
#include <cuda.h>
96

107
#include <iostream>

sycl/test-e2e/EnqueueNativeCommand/custom-command-multiple-dev-cuda.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// RUN: %{build} -o %t.out %cuda_options
33
// RUN: %{run} %t.out
44

5-
// TODO: Reenable, see https://github.com/intel/llvm/issues/14598
6-
// UNSUPPORTED: windows
7-
85
#include <cuda.h>
96

107
#include <iostream>

0 commit comments

Comments
 (0)