@@ -47,7 +47,7 @@ __all__ += [
47
47
ctypedef void (* fptr_2in_1out_shapes_t)(void * , void * , void * , size_t * , size_t * , size_t * , size_t)
48
48
49
49
50
- cpdef dparray dpnp_dot(dpnp_descriptor in_array1, dpnp_descriptor in_array2):
50
+ cpdef utils.dpnp_descriptor dpnp_dot(utils. dpnp_descriptor in_array1, utils. dpnp_descriptor in_array2):
51
51
52
52
cdef shape_type_c shape1, shape2
53
53
@@ -63,9 +63,7 @@ cpdef dparray dpnp_dot(dpnp_descriptor in_array1, dpnp_descriptor in_array2):
63
63
64
64
# scalar
65
65
if dim1 == 0 or dim2 == 0 :
66
- x1_desc = dpnp.get_dpnp_descriptor(in_array1)
67
- x2_desc = dpnp.get_dpnp_descriptor(in_array2)
68
- return dpnp_multiply(x1_desc, x2_desc).get_pyobj()
66
+ return dpnp_multiply(in_array1, in_array2)
69
67
70
68
cdef size_t size1 = 0
71
69
cdef size_t size2 = 0
@@ -86,14 +84,22 @@ cpdef dparray dpnp_dot(dpnp_descriptor in_array1, dpnp_descriptor in_array2):
86
84
# get the FPTR data structure
87
85
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_DOT, param1_type, param2_type)
88
86
89
- result_type = dpnp_DPNPFuncType_to_dtype(< size_t > kernel_data.return_type)
90
87
# ceate result array with type given by FPTR data
91
- cdef dparray result = dparray((1 ,), dtype = result_type)
88
+ cdef shape_type_c result_shape = (1 ,)
89
+ cdef utils.dpnp_descriptor result = utils.create_output_descriptor(result_shape, kernel_data.return_type, None )
92
90
93
91
cdef fptr_2in_1out_t func = < fptr_2in_1out_t > kernel_data.ptr
94
92
# call FPTR function
95
- func(result.get_data(), in_array1.get_data(), in_array1.size, shape1.data(), shape1.size(),
96
- in_array2.get_data(), in_array2.size, shape2.data(), shape2.size(), NULL )
93
+ func(result.get_data(),
94
+ in_array1.get_data(),
95
+ in_array1.size,
96
+ shape1.data(),
97
+ shape1.size(),
98
+ in_array2.get_data(),
99
+ in_array2.size,
100
+ shape2.data(),
101
+ shape2.size(),
102
+ NULL )
97
103
98
104
return result
99
105
0 commit comments