@@ -118,10 +118,13 @@ inline auto get_onemath_backend(sycl::queue& queue)
118118#endif
119119}
120120
121+ #ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
122+ namespace syclex = sycl::ext::oneapi::experimental;
123+ #endif
124+
121125template <int NR, typename Func>
122126__dpct_inline__ void sycl_parallel_for (sycl::handler & cgh, sycl::nd_range<NR> nd_range, Func && func) {
123127#ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
124- namespace syclex = sycl::ext::oneapi::experimental;
125128 syclex::nd_launch (cgh, nd_range, func);
126129#else
127130 cgh.parallel_for (nd_range, func);
@@ -131,7 +134,6 @@ __dpct_inline__ void sycl_parallel_for(sycl::handler & cgh, sycl::nd_range<NR> n
131134template <int NR, typename Func>
132135__dpct_inline__ void sycl_parallel_for (sycl::queue * q, sycl::nd_range<NR> nd_range, Func && func) {
133136#ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
134- namespace syclex = sycl::ext::oneapi::experimental;
135137 syclex::nd_launch (*q, nd_range, func);
136138#else
137139 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
140142
141143template <typename Func> __dpct_inline__ void sycl_launch (sycl::queue * stream, Func && func) {
142144#ifdef SYCL_EXT_ONEAPI_ENQUEUE_FUNCTIONS
143- namespace syclex = sycl::ext::oneapi::experimental;
144145 syclex::submit (*stream, func);
145146#else
146147 stream->submit (func);
0 commit comments