Skip to content

Commit 3f30fc5

Browse files
committed
Move namespace shortening outside function body.
Signed-off-by: nscipione <[email protected]>
1 parent 49663d5 commit 3f30fc5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ggml/src/ggml-sycl/dpct/helper.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
121125
template <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
131134
template <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

141143
template <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

Comments
 (0)