@@ -118,10 +118,13 @@ inline auto get_onemath_backend(sycl::queue& queue)
118
118
#endif
119
119
}
120
120
121
+ #ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
122
+ namespace syclex = sycl::ext::oneapi::experimental;
123
+ #endif
124
+
121
125
template <int NR, typename Func>
122
126
__dpct_inline__ void sycl_parallel_for (sycl::handler & cgh, sycl::nd_range<NR> nd_range, Func && func) {
123
127
#ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
124
- namespace syclex = sycl::ext::oneapi::experimental;
125
128
syclex::nd_launch (cgh, nd_range, func);
126
129
#else
127
130
cgh.parallel_for (nd_range, func);
@@ -131,7 +134,6 @@ __dpct_inline__ void sycl_parallel_for(sycl::handler & cgh, sycl::nd_range<NR> n
131
134
template <int NR, typename Func>
132
135
__dpct_inline__ void sycl_parallel_for (sycl::queue * q, sycl::nd_range<NR> nd_range, Func && func) {
133
136
#ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
134
- namespace syclex = sycl::ext::oneapi::experimental;
135
137
syclex::nd_launch (*q, nd_range, func);
136
138
#else
137
139
q->parallel_for (nd_range, func);
@@ -140,7 +142,6 @@ __dpct_inline__ void sycl_parallel_for(sycl::queue * q, sycl::nd_range<NR> nd_ra
140
142
141
143
template <typename Func> __dpct_inline__ void sycl_launch (sycl::queue * stream, Func && func) {
142
144
#ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
143
- namespace syclex = sycl::ext::oneapi::experimental;
144
145
syclex::submit (*stream, func);
145
146
#else
146
147
stream->submit (func);
0 commit comments