@@ -44,14 +44,15 @@ __all__ += [
44
44
ctypedef void (* custom_search_1in_1out_func_ptr_t)(void * , void * , size_t)
45
45
46
46
47
- cpdef dparray dpnp_argmax(utils.dpnp_descriptor in_array1):
47
+ cpdef utils.dpnp_descriptor dpnp_argmax(utils.dpnp_descriptor in_array1):
48
48
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(in_array1.dtype)
49
49
cdef DPNPFuncType output_type = dpnp_dtype_to_DPNPFuncType(dpnp.int64)
50
50
51
51
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_ARGMAX, param1_type, output_type)
52
52
53
- result_type = dpnp_DPNPFuncType_to_dtype( < size_t > kernel_data.return_type)
54
- cdef dparray result = dparray((1 ,), dtype = result_type)
53
+ # ceate result array with type given by FPTR data
54
+ cdef shape_type_c result_shape = (1 ,)
55
+ cdef utils.dpnp_descriptor result = utils.create_output_descriptor(result_shape, kernel_data.return_type, None )
55
56
56
57
cdef custom_search_1in_1out_func_ptr_t func = < custom_search_1in_1out_func_ptr_t > kernel_data.ptr
57
58
@@ -60,14 +61,15 @@ cpdef dparray dpnp_argmax(utils.dpnp_descriptor in_array1):
60
61
return result
61
62
62
63
63
- cpdef dparray dpnp_argmin(utils.dpnp_descriptor in_array1):
64
+ cpdef utils.dpnp_descriptor dpnp_argmin(utils.dpnp_descriptor in_array1):
64
65
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(in_array1.dtype)
65
66
cdef DPNPFuncType output_type = dpnp_dtype_to_DPNPFuncType(dpnp.int64)
66
67
67
68
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_ARGMIN, param1_type, output_type)
68
69
69
- result_type = dpnp_DPNPFuncType_to_dtype( < size_t > kernel_data.return_type)
70
- cdef dparray result = dparray((1 ,), dtype = result_type)
70
+ # ceate result array with type given by FPTR data
71
+ cdef shape_type_c result_shape = (1 ,)
72
+ cdef utils.dpnp_descriptor result = utils.create_output_descriptor(result_shape, kernel_data.return_type, None )
71
73
72
74
cdef custom_search_1in_1out_func_ptr_t func = < custom_search_1in_1out_func_ptr_t > kernel_data.ptr
73
75
0 commit comments