@@ -73,29 +73,29 @@ void custom_elemwise_transpose_c(void* array1_in,
73
73
}
74
74
75
75
cl::sycl::range<1 > gws (size);
76
- event = DPNP_QUEUE. submit ([& ](cl::sycl::handler& cgh ) {
77
- cgh. parallel_for < class custom_elemwise_transpose_c_kernel <_DataType> >(
78
- gws,
79
- [=](cl::sycl::id< 1 > global_id)
80
- {
81
- const size_t idx = global_id[ 0 ];
82
-
83
- size_t output_index = 0 ;
84
- size_t reminder = idx ;
85
- for ( size_t axis = 0 ; axis < input_shape_size; ++ axis)
86
- {
87
- /* reconstruct [x][y][z] from given linear idx */
88
- size_t xyz_id = reminder / input_offset_shape [axis];
89
- reminder = reminder % input_offset_shape[axis];
90
-
91
- /* calculate destination index based on reconstructed [x][y][z] */
92
- output_index += (xyz_id * result_offset_shape[axis]) ;
93
- }
94
-
95
- result[output_index] = array1[idx] ;
96
-
97
- }); // parallel_for
98
- }); // queue .submit
76
+ auto kernel_parallel_for_func = [= ](cl::sycl::id< 1 > global_id ) {
77
+ const size_t idx = global_id[ 0 ];
78
+
79
+ size_t output_index = 0 ;
80
+ size_t reminder = idx;
81
+ for ( size_t axis = 0 ; axis < input_shape_size; ++axis)
82
+ {
83
+ /* reconstruct [x][y][z] from given linear idx */
84
+ size_t xyz_id = reminder / input_offset_shape[axis] ;
85
+ reminder = reminder % input_offset_shape[ axis];
86
+
87
+ /* calculate destination index based on reconstructed [x][y][z] */
88
+ output_index += ( xyz_id * result_offset_shape [axis]) ;
89
+ }
90
+
91
+ result[output_index] = array1[idx];
92
+ } ;
93
+
94
+ auto kernel_func = [&](cl::sycl::handler& cgh) {
95
+ cgh. parallel_for < class custom_elemwise_transpose_c_kernel <_DataType> >(gws, kernel_parallel_for_func) ;
96
+ };
97
+
98
+ event = DPNP_QUEUE .submit (kernel_func);
99
99
100
100
event.wait ();
101
101
0 commit comments