Skip to content

Commit 0baaf67

Browse files
authored
Merge pull request #2462 from andreyfe1/onemkl_fix_warnings
[oneMKL] Fixed deprecation warnings
2 parents 3f94bed + 2d131a8 commit 0baaf67

File tree

14 files changed

+50
-50
lines changed

14 files changed

+50
-50
lines changed

Libraries/oneMKL/binomial/src/binomial_sycl.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ constexpr int wg_size = 128;
1414

1515
sycl::queue* binomial_queue;
1616

17+
template<typename Type>
18+
class k_binomial; // can be useful for profiling
19+
1720
template<typename DATA_TYPE>
1821
Binomial<DATA_TYPE>::Binomial() {
1922
binomial_queue = new sycl::queue;
@@ -71,7 +74,7 @@ void Binomial<DATA_TYPE>::body() {
7174
binomial_queue->submit([&](sycl::handler& h) {
7275
sycl::local_accessor<DATA_TYPE> slm_call{wg_size + 1, h};
7376

74-
h.template parallel_for(
77+
h.parallel_for<k_binomial<DATA_TYPE>>(
7578
sycl::nd_range(sycl::range<1>(opt_n * wg_size),
7679
sycl::range<1>(wg_size)),
7780
[=](sycl::nd_item<1> item)

Libraries/oneMKL/block_cholesky_decomposition/factor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main() {
7373
}
7474
};
7575

76-
sycl::device device{sycl::default_selector{}};
76+
sycl::device device{sycl::default_selector_v};
7777
sycl::queue queue(device, error_handler);
7878
sycl::context context = queue.get_context();
7979

Libraries/oneMKL/block_cholesky_decomposition/solve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int main() {
7575
}
7676
};
7777

78-
sycl::device device{sycl::default_selector{}};
78+
sycl::device device{sycl::default_selector_v};
7979
sycl::queue queue(device, error_handler);
8080
sycl::context context = queue.get_context();
8181

Libraries/oneMKL/block_lu_decomposition/factor.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
* Example of LU factorization of general block tridiagonal matrix
1111
************************************************************************
1212
* Purpose:
13-
* ========
14-
* Testing LU factorization of block tridiagonal matrix
13+
* ========
14+
* Testing LU factorization of block tridiagonal matrix
1515
* (D_1 C_1 )
1616
* (B_1 D_2 C_2 )
1717
* ( B_2 D_3 C_3 )
1818
* ( ......... )
1919
* ( B_N-2 D_N-1 C_N-1 )
2020
* ( B_N-1 D_N )
21-
* provided by function dgeblttrf by calculating Frobenius norm of the
22-
* residual ||A-L*U||. Computation of the residual and its Frobenius norm
23-
* is done by function resid1 (for source see file auxi.cpp).
21+
* provided by function dgeblttrf by calculating Frobenius norm of the
22+
* residual ||A-L*U||. Computation of the residual and its Frobenius norm
23+
* is done by function resid1 (for source see file auxi.cpp).
2424
* Input block tridiagonal matrix A is randomly generated.
2525
*/
2626

@@ -45,7 +45,7 @@ int main(){
4545
std::cerr << "MKL_INT not 64bit" << std::endl;
4646
return -1;
4747
}
48-
48+
4949
int64_t n = 200;
5050
int64_t nb = 20;
5151

@@ -68,7 +68,7 @@ int main(){
6868
}
6969
};
7070

71-
sycl::device device{sycl::default_selector{}};
71+
sycl::device device{sycl::default_selector_v};
7272
sycl::queue queue(device, error_handler);
7373
sycl::context context = queue.get_context();
7474

Libraries/oneMKL/block_lu_decomposition/solve.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@
77
/*
88
*
99
* Content:
10-
* Example of solving a system of linear equations with general
11-
* block tridiagonal coefficient matrix
10+
* Example of solving a system of linear equations with general
11+
* block tridiagonal coefficient matrix
1212
************************************************************************
1313
* Purpose:
14-
* ========
15-
* Testing solution of a linear system of equations with general block
14+
* ========
15+
* Testing solution of a linear system of equations with general block
1616
* tridiagonal matrix of coefficients
1717
* D(1)*X(1) + C(1)*X(2) = F(1)
18-
* B(1)*X(1) + D(2)*X(2) + C(2)*X(3) = F(2)
19-
* B(2)*X(2) + D(3)*X(3) + C(3)*X(4) = F(3)
18+
* B(1)*X(1) + D(2)*X(2) + C(2)*X(3) = F(2)
19+
* B(2)*X(2) + D(3)*X(3) + C(3)*X(4) = F(3)
2020
* ...
21-
* B(N-2)*X(N-2) + D(N-1)*X(N-1) + C(N-1)*X(N) = F(N-1)
22-
* B(N-1)*X(N-1) + D(N)*X(N) = F(N)
21+
* B(N-2)*X(N-2) + D(N-1)*X(N-1) + C(N-1)*X(N) = F(N-1)
22+
* B(N-1)*X(N-1) + D(N)*X(N) = F(N)
2323
* Here D(J),B(J),C(J) are NB by NB matrices - block matrix coefficients
2424
* X(J),F(J) are NB by NRHS-matrices - unknowns and RHS components
2525
*
26-
* Solving is done via LU factorization of the coefficient matrix
26+
* Solving is done via LU factorization of the coefficient matrix
2727
* (call DGEBLTTRF) followed by call DGEBLTTRS to solve a system of
2828
* equations with coefficient matrix factored by DGEBLTTRF.
2929
*
3030
* Coefficients and right hand sides are randomly generated.
3131
*
32-
* Testing is done via calculating
32+
* Testing is done via calculating
3333
* max{||F(1)-D(1)*X(1)-C(1)*X(2)||,
3434
* ||F(2)-B(1)*X(1)-D(1)*X(1)-C(1)*X(2)||,
3535
* ...
3636
* ||F(N)-B(N-1)*X(N-1)-D(N)*X(N)||}
3737
*
38-
* ||.|| denotes Frobenius norm of a respective matrix
38+
* ||.|| denotes Frobenius norm of a respective matrix
3939
*/
4040
#include <cstdint>
4141
#include <iostream>
@@ -65,7 +65,7 @@ int main() {
6565
int64_t ldf = nb*n;
6666

6767
int64_t info = 0;
68-
68+
6969
// Asynchronous error handler
7070
auto error_handler = [&] (sycl::exception_list exceptions) {
7171
for (auto const& e : exceptions) {
@@ -83,7 +83,7 @@ int main() {
8383
}
8484
};
8585

86-
sycl::device device{sycl::default_selector{}};
86+
sycl::device device{sycl::default_selector_v};
8787
sycl::queue queue(device, error_handler);
8888
sycl::context context = queue.get_context();
8989

@@ -132,9 +132,9 @@ int main() {
132132
std::cout << "matrix by calculating ratios of residuals" << std::endl;
133133
std::cout << "to RHS vectors' norms." << std::endl;
134134

135-
// LU factorization of the coefficient matrix
135+
// LU factorization of the coefficient matrix
136136
info = dgeblttrf(queue, n, nb, d.data(), dl.data(), du1.data(), du2.data(), ipiv.data());
137-
if (info) {
137+
if (info) {
138138
std::cout << "DGEBLTTRF returned nonzero INFO = " << info << std::endl;
139139
return 1;
140140
}
@@ -145,10 +145,10 @@ int main() {
145145
std::cout << -info << "-th parameter in call of dgeblttrs has illegal value" << std::endl;
146146
return 1;
147147
} else {
148-
// computing the residual
148+
// computing the residual
149149
double eps = resid2(n, nb, nrhs, dlcpy.data(), dcpy.data(), du1cpy.data(), f.data(), ldf, fcpy.data(), ldf);
150150
std::cout << "max_(i=1,...,nrhs){||ax(i)-f(i)||/||f(i)||} = " << eps << std::endl;
151-
}
151+
}
152152

153153
return 0;
154154
}

Libraries/oneMKL/monte_carlo_pi/mc_pi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ double estimate_pi(sycl::queue& q, size_t n_points) {
6767
sycl::vec<float, 2> r;
6868
size_t count = 0;
6969
for(int i = 0; i < count_per_thread; i++) {
70-
r.load(i + item.get_global_linear_id() * count_per_thread, rng_acc.get_pointer());
70+
r.load(i + item.get_global_linear_id() * count_per_thread, rng_acc.template get_multi_ptr<sycl::access::decorated::yes>());
7171
if(sycl::length(r) <= 1.0f) {
7272
count += 1;
7373
}
@@ -116,7 +116,7 @@ int main(int argc, char ** argv) {
116116

117117
try {
118118
// Queue constructor passed exception handler
119-
sycl::queue q(sycl::default_selector{}, exception_handler);
119+
sycl::queue q(sycl::default_selector_v, exception_handler);
120120
// Launch Pi number calculation
121121
estimated_pi = estimate_pi(q, n_points);
122122
} catch (...) {

Libraries/oneMKL/monte_carlo_pi/mc_pi_device_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/*
88
*
99
* Content:
10-
* This file contains Monte Carlo Pi number evaluation benchmark for DPC++
10+
* This file contains Monte Carlo Pi number evaluation benchmark for DPC++
1111
* device interface of random number generators.
1212
*
1313
*******************************************************************************/
@@ -106,7 +106,7 @@ int main(int argc, char ** argv) {
106106

107107
try {
108108
// Queue constructor passed exception handler
109-
sycl::queue q(sycl::default_selector{}, exception_handler);
109+
sycl::queue q(sycl::default_selector_v, exception_handler);
110110
// Launch Pi number calculation
111111
estimated_pi = estimate_pi(q, n_points);
112112
} catch (...) {

Libraries/oneMKL/monte_carlo_pi/mc_pi_usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int main(int argc, char ** argv) {
119119

120120
try {
121121
// Queue constructor passed exception handler
122-
sycl::queue q(sycl::default_selector{}, exception_handler);
122+
sycl::queue q(sycl::default_selector_v, exception_handler);
123123
// Launch Pi number calculation
124124
estimated_pi = estimate_pi(q, n_points);
125125
} catch (...) {

Libraries/oneMKL/random_sampling_without_replacement/lottery.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ void lottery(sycl::queue& q, size_t m, size_t n, size_t num_exp, size_t* result_
4646
{
4747

4848
event = q.submit([&] (sycl::handler& h) {
49-
sycl::accessor<size_t, 1, sycl::access::mode::read_write, sycl::access::target::local>
50-
local_buf(sycl::range<1>{n}, h);
49+
sycl::local_accessor<size_t> local_buf(sycl::range<1>{n}, h);
5150
h.parallel_for(sycl::nd_range<1>(num_exp, 1),
5251
[=](sycl::nd_item<1> item) {
5352
size_t id = item.get_group(0);
@@ -126,7 +125,7 @@ int main(int argc, char ** argv) {
126125

127126
try {
128127
// Queue constructor passed exception handler
129-
sycl::queue q(sycl::default_selector{}, exception_handler);
128+
sycl::queue q(sycl::default_selector_v, exception_handler);
130129
// Allocate memory
131130
result_ptr = sycl::malloc_shared<size_t>(m * num_exp, q);
132131
// Launch lottery for Host USM API

Libraries/oneMKL/random_sampling_without_replacement/lottery_device_api.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ void lottery_device_api(sycl::queue& q, size_t m, size_t n, size_t num_exp, std:
3434

3535
q.submit([&](sycl::handler& h) {
3636
auto res_acc = result_buf.template get_access<sycl::access::mode::write>(h);
37-
sycl::accessor<size_t, 1, sycl::access::mode::read_write, sycl::access::target::local>
38-
local_buf(sycl::range<1>{n}, h);
37+
sycl::local_accessor<size_t> local_buf(sycl::range<1>{n}, h);
3938
h.parallel_for(sycl::nd_range<1>(num_exp, 1),
4039
[=](sycl::nd_item<1> item) {
4140
size_t id = item.get_group(0);
@@ -117,7 +116,7 @@ int main(int argc, char ** argv) {
117116

118117
try {
119118
// Queue constructor passed exception handler
120-
sycl::queue q(sycl::default_selector{}, exception_handler);
119+
sycl::queue q(sycl::default_selector_v, exception_handler);
121120
// Launch lottery for device API
122121
lottery_device_api(q, m, n, num_exp, result_vec);
123122
} catch (...) {

0 commit comments

Comments
 (0)