Skip to content

Commit 2fa8395

Browse files
committed
Add macro conditionals for oneMKL version
1 parent a09dc57 commit 2fa8395

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,13 @@ int run_sparse_pcg_example(const sycl::device &dev)
380380
// setup optimizations and properties we know about A matrix
381381
oneapi::mkl::sparse::init_matrix_handle(&A);
382382

383+
#if (INTEL_MKL_VERSION < 20250300)
384+
auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n,
385+
oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {});
386+
#else
383387
auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, nnz,
384388
oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {});
389+
#endif
385390

386391
oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::symmetric);
387392
oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::sorted);

Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,13 @@ int run_sparse_pcg_example(const sycl::device &dev)
453453
// setup optimizations and properties we know about A matrix
454454
oneapi::mkl::sparse::init_matrix_handle(&A);
455455

456+
#if (INTEL_MKL_VERSION < 20250300)
457+
auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n,
458+
oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {});
459+
#else
456460
auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, nnz,
457461
oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {});
462+
#endif
458463

459464
oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::symmetric);
460465
oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::sorted);

0 commit comments

Comments
 (0)