Skip to content

Commit ce0851b

Browse files
authored
use sycl_adapter in krnl_bitwise (#899)
1 parent e9e19f0 commit ce0851b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dpnp/backend/kernels/dpnp_krnl_bitwise.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include "dpnp_fptr.hpp"
2929
#include "dpnp_iface.hpp"
30+
#include "dpnpc_memory_adapter.hpp"
3031
#include "queue_sycl.hpp"
3132

3233
template <typename _KernelNameSpecialization>
@@ -36,7 +37,8 @@ template <typename _DataType>
3637
void dpnp_invert_c(void* array1_in, void* result1, size_t size)
3738
{
3839
cl::sycl::event event;
39-
_DataType* array1 = reinterpret_cast<_DataType*>(array1_in);
40+
DPNPC_ptr_adapter<_DataType> input1_ptr(array1_in, size);
41+
_DataType* array1 = input1_ptr.get_ptr();
4042
_DataType* result = reinterpret_cast<_DataType*>(result1);
4143

4244
cl::sycl::range<1> gws(size);
@@ -94,8 +96,10 @@ static void func_map_init_bitwise_1arg_1type(func_map_t& fmap)
9496
} \
9597
\
9698
cl::sycl::event event; \
97-
const _DataType* input1 = reinterpret_cast<const _DataType*>(input1_in); \
98-
const _DataType* input2 = reinterpret_cast<const _DataType*>(input2_in); \
99+
DPNPC_ptr_adapter<_DataType> input1_ptr(input1_in, input1_size); \
100+
DPNPC_ptr_adapter<_DataType> input2_ptr(input2_in, input2_size); \
101+
const _DataType* input1 = input1_ptr.get_ptr(); \
102+
const _DataType* input2 = input2_ptr.get_ptr(); \
99103
_DataType* result = reinterpret_cast<_DataType*>(result_out); \
100104
\
101105
const size_t gws_size = std::max(input1_size, input2_size); \

0 commit comments

Comments
 (0)