@@ -147,6 +147,10 @@ public:
147147template <typename Tx, typename Tr>
148148inline void nrm2_impl (sycl::queue &q, int n, const void *x, int incx,
149149 void *result) {
150+ #ifndef __INTEL_MKL__
151+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
152+ " Project does not support this API." );
153+ #else
150154#ifdef DPCT_USM_LEVEL_NONE
151155 auto x_buffer = dpct::get_buffer<Tx>(x);
152156 auto r_buffer =
@@ -159,6 +163,7 @@ inline void nrm2_impl(sycl::queue &q, int n, const void *x, int incx,
159163 oneapi::mkl::blas::column_major::nrm2 (q, n, reinterpret_cast <const Tx *>(x),
160164 incx, res_mem.get_ptr ());
161165#endif
166+ #endif
162167}
163168// DPCT_LABEL_END
164169
@@ -172,6 +177,10 @@ inline void nrm2_impl(sycl::queue &q, int n, const void *x, int incx,
172177template <bool is_conjugate, class Txy , class Tr >
173178inline void dotuc_impl (sycl::queue &q, int n, const Txy *x, int incx,
174179 const Txy *y, int incy, Tr *result) {
180+ #ifndef __INTEL_MKL__
181+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
182+ " Project does not support this API." );
183+ #else
175184#ifdef DPCT_USM_LEVEL_NONE
176185 auto x_buffer = dpct::get_buffer<Txy>(x);
177186 auto y_buffer = dpct::get_buffer<Txy>(y);
@@ -200,6 +209,7 @@ inline void dotuc_impl(sycl::queue &q, int n, const Txy *x, int incx,
200209 } else
201210 oneapi::mkl::blas::column_major::dot (q, n, x, incx, y, incy, res_mem.get_ptr ());
202211#endif
212+ #endif
203213}
204214// DPCT_LABEL_END
205215
@@ -273,10 +283,15 @@ inline void dotuc(sycl::queue &q, int n, const void *x,
273283template <class Tx , class Te >
274284inline void scal_impl (sycl::queue &q, int n, const void *alpha, void *x,
275285 int incx) {
286+ #ifndef __INTEL_MKL__
287+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
288+ " Project does not support this API." );
289+ #else
276290 Te alpha_val = dpct::get_value (reinterpret_cast <const Te *>(alpha), q);
277291 auto data_x = get_memory (reinterpret_cast <Tx *>(x));
278292 oneapi::mkl::blas::column_major::scal (q, n, alpha_val,
279293 data_x, incx);
294+ #endif
280295}
281296// DPCT_LABEL_END
282297
@@ -289,12 +304,17 @@ inline void scal_impl(sycl::queue &q, int n, const void *alpha, void *x,
289304template <class Txy , class Te >
290305inline void axpy_impl (sycl::queue &q, int n, const void *alpha, const void *x,
291306 int incx, void *y, int incy) {
307+ #ifndef __INTEL_MKL__
308+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
309+ " Project does not support this API." );
310+ #else
292311 Te alpha_val = dpct::get_value (reinterpret_cast <const Te *>(alpha), q);
293312 auto data_x = get_memory (reinterpret_cast <const Txy *>(x));
294313 auto data_y = get_memory (reinterpret_cast <Txy *>(y));
295314 oneapi::mkl::blas::column_major::axpy (q, n, alpha_val,
296315 data_x, incx,
297316 data_y, incy);
317+ #endif
298318}
299319// DPCT_LABEL_END
300320
@@ -307,13 +327,18 @@ inline void axpy_impl(sycl::queue &q, int n, const void *alpha, const void *x,
307327template <class Txy , class Tc , class Ts >
308328inline void rot_impl (sycl::queue &q, int n, void *x, int incx, void *y,
309329 int incy, const void *c, const void *s) {
330+ #ifndef __INTEL_MKL__
331+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
332+ " Project does not support this API." );
333+ #else
310334 Tc c_value = dpct::get_value (reinterpret_cast <const Tc *>(c), q);
311335 Ts s_value = dpct::get_value (reinterpret_cast <const Ts *>(s), q);
312336 auto data_x = get_memory (reinterpret_cast <Txy *>(x));
313337 auto data_y = get_memory (reinterpret_cast <Txy *>(y));
314338 oneapi::mkl::blas::column_major::rot (q, n, data_x, incx,
315339 data_y, incy, c_value,
316340 s_value);
341+ #endif
317342}
318343// DPCT_LABEL_END
319344
@@ -328,6 +353,10 @@ inline void gemm_impl(sycl::queue &q, oneapi::mkl::transpose a_trans,
328353 oneapi::mkl::transpose b_trans, int m, int n, int k,
329354 const void *alpha, const void *a, int lda, const void *b,
330355 int ldb, const void *beta, void *c, int ldc) {
356+ #ifndef __INTEL_MKL__
357+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
358+ " Project does not support this API." );
359+ #else
331360 Ts alpha_value = dpct::get_value (reinterpret_cast <const Ts *>(alpha), q);
332361 Ts beta_value = dpct::get_value (reinterpret_cast <const Ts *>(beta), q);
333362 auto data_a = get_memory (reinterpret_cast <const Ta *>(a));
@@ -336,6 +365,7 @@ inline void gemm_impl(sycl::queue &q, oneapi::mkl::transpose a_trans,
336365 oneapi::mkl::blas::column_major::gemm (
337366 q, a_trans, b_trans, m, n, k, alpha_value, data_a, lda,
338367 data_b, ldb, beta_value, data_c, ldc);
368+ #endif
339369}
340370// DPCT_LABEL_END
341371
@@ -350,6 +380,10 @@ inline void gemm_batch_impl(sycl::queue &q, oneapi::mkl::transpose a_trans,
350380 const void *alpha, const void **a, int lda,
351381 const void **b, int ldb, const void *beta, void **c,
352382 int ldc, int batch_size) {
383+ #ifndef __INTEL_MKL__
384+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
385+ " Project does not support this API." );
386+ #else
353387 struct matrix_info_t {
354388 oneapi::mkl::transpose transpose_info[2 ];
355389 Ts value_info[2 ];
@@ -388,6 +422,7 @@ inline void gemm_batch_impl(sycl::queue &q, oneapi::mkl::transpose a_trans,
388422 cgh.depends_on (e);
389423 cgh.host_task ([=] { std::free (matrix_info); });
390424 });
425+ #endif
391426}
392427// DPCT_LABEL_END
393428
@@ -405,6 +440,10 @@ gemm_batch_impl(sycl::queue &q, oneapi::mkl::transpose a_trans,
405440 long long int stride_a, const void *b, int ldb,
406441 long long int stride_b, const void *beta, void *c,
407442 int ldc, long long int stride_c, int batch_size) {
443+ #ifndef __INTEL_MKL__
444+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
445+ " Project does not support this API." );
446+ #else
408447 Ts alpha_value = dpct::get_value (reinterpret_cast <const Ts *>(alpha), q);
409448 Ts beta_value = dpct::get_value (reinterpret_cast <const Ts *>(beta), q);
410449 auto data_a = get_memory (reinterpret_cast <const Ta *>(a));
@@ -414,6 +453,7 @@ gemm_batch_impl(sycl::queue &q, oneapi::mkl::transpose a_trans,
414453 q, a_trans, b_trans, m, n, k, alpha_value, data_a, lda,
415454 stride_a, data_b, ldb, stride_b, beta_value,
416455 data_c, ldc, stride_c, batch_size);
456+ #endif
417457}
418458// DPCT_LABEL_END
419459
@@ -566,6 +606,10 @@ trsm_batch_impl(sycl::queue &q, oneapi::mkl::side left_right,
566606template <typename T>
567607inline void getrfnp_batch_wrapper (sycl::queue &exec_queue, int n, T *a[],
568608 int lda, int *info, int batch_size) {
609+ #ifndef __INTEL_MKL__
610+ throw std::runtime_error (" The oneAPI Math Kernel Library (oneMKL) Interfaces "
611+ " Project does not support this API." );
612+ #else
569613 using Ty = typename DataType<T>::T2;
570614 // Set the info array value to 0
571615 detail::dpct_memset (exec_queue, info, 0 , sizeof (int ) * batch_size);
@@ -614,6 +658,7 @@ inline void getrfnp_batch_wrapper(sycl::queue &exec_queue, int n, T *a[],
614658 cgh.depends_on (events);
615659 cgh.host_task ([=] { free (host_a); });
616660 });
661+ #endif
617662}
618663// DPCT_LABEL_END
619664
0 commit comments