Skip to content

Commit 838f0cf

Browse files
Fix example3.cpp (#1086)
* Add ndim, shape, strides as parametrs in dpnp_cos_c call * Update example3.cpp Co-authored-by: Alexander-Makaryev <[email protected]>
1 parent 26f640a commit 838f0cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dpnp/backend/examples/example3.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ int main(int, char**)
5757
}
5858
std::cout << std::endl;
5959

60-
dpnp_cos_c<int, double>(array1, result, size);
60+
const long ndim = 1;
61+
shape_elem_type* shape = reinterpret_cast<shape_elem_type*>(dpnp_memory_alloc_c(ndim * sizeof(shape_elem_type)));
62+
shape[0] = size;
63+
shape_elem_type* strides = reinterpret_cast<shape_elem_type*>(dpnp_memory_alloc_c(ndim * sizeof(shape_elem_type)));
64+
strides[0] = 1;
65+
66+
dpnp_cos_c<int, double>(result, size, ndim, shape, strides, array1, size, ndim, shape, strides, NULL);
6167

6268
for (size_t i = 0; i < 10; ++i)
6369
{

0 commit comments

Comments
 (0)