Skip to content

Commit d10c090

Browse files
authored
use sycl_adapter in krnl_searching (#917)
1 parent 49edafc commit d10c090

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dpnp/backend/kernels/dpnp_krnl_searching.cpp

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

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

3233
template <typename _DataType, typename _idx_DataType>
@@ -35,7 +36,8 @@ class dpnp_argmax_c_kernel;
3536
template <typename _DataType, typename _idx_DataType>
3637
void dpnp_argmax_c(void* array1_in, void* result1, size_t size)
3738
{
38-
_DataType* array_1 = reinterpret_cast<_DataType*>(array1_in);
39+
DPNPC_ptr_adapter<_DataType> input1_ptr(array1_in, size);
40+
_DataType* array_1 = input1_ptr.get_ptr();
3941
_idx_DataType* result = reinterpret_cast<_idx_DataType*>(result1);
4042

4143
auto policy =
@@ -56,7 +58,8 @@ class dpnp_argmin_c_kernel;
5658
template <typename _DataType, typename _idx_DataType>
5759
void dpnp_argmin_c(void* array1_in, void* result1, size_t size)
5860
{
59-
_DataType* array_1 = reinterpret_cast<_DataType*>(array1_in);
61+
DPNPC_ptr_adapter<_DataType> input1_ptr(array1_in, size);
62+
_DataType* array_1 = input1_ptr.get_ptr();
6063
_idx_DataType* result = reinterpret_cast<_idx_DataType*>(result1);
6164

6265
auto policy =

0 commit comments

Comments
 (0)