Skip to content

Commit

Permalink
fix: replace deprecated sycl::abs to sycl::fabs (#2631)
Browse files Browse the repository at this point in the history
  • Loading branch information
homksei authored Jan 30, 2024
1 parent 3d04172 commit 09838b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void add_regularization(sycl::queue& q_,
ans_loss_ptr[0] *= inv_n;
for (std::int64_t i = 1; i < p + 1; ++i) {
ans_loss_ptr[0] +=
L2 * params_ptr[i] * params_ptr[i] + L1 * sycl::abs(params_ptr[i]);
L2 * params_ptr[i] * params_ptr[i] + L1 * sycl::fabs(params_ptr[i]);
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ sycl::event add_regularization_loss(sycl::queue& q,
const std::int64_t st_id = fit_intercept;
cgh.parallel_for(range, sum_reduction, [=](sycl::id<1> idx, auto& sum) {
const Float param = param_ptr[idx + st_id];
sum += L1 * sycl::abs(param) + L2 * param * param;
sum += L1 * sycl::fabs(param) + L2 * param * param;
});
});
return q.submit([&](sycl::handler& cgh) {
Expand Down Expand Up @@ -330,7 +330,7 @@ sycl::event add_regularization_gradient_loss(sycl::queue& q,
std::int64_t st_id = fit_intercept;
cgh.parallel_for(range, sum_reduction, [=](sycl::id<1> idx, auto& sum) {
const Float param = param_ptr[idx + st_id];
sum += L1 * sycl::abs(param) + L2 * param * param;
sum += L1 * sycl::fabs(param) + L2 * param * param;
grad_ptr[idx + st_id] += L2 * 2 * param;
});
});
Expand Down

0 comments on commit 09838b7

Please sign in to comment.