Skip to content

Chore: use const qualifier for dpctl_capi references. #977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/include/utils/type_dispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ struct usm_ndarray_types
int typenum_to_lookup_id(int typenum)
{
using typenum_t = dpctl::tensor::detail::typenum_t;
auto &api = ::dpctl::detail::dpctl_capi::get();
auto const &api = ::dpctl::detail::dpctl_capi::get();

if (typenum == api.UAR_DOUBLE_) {
return static_cast<int>(typenum_t::DOUBLE);
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/source/device_support_queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ std::string _default_device_bool_type(sycl::device)

sycl::device _extract_device(py::object arg)
{
auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

PyObject *source = arg.ptr();
if (api.PySyclQueue_Check_(source)) {
Expand Down
12 changes: 6 additions & 6 deletions examples/pybind11/onemkl_gemv/sycl_gemm/_onemkl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ py_gemv(sycl::queue q,
"USM allocations are not compatible with the execution queue.");
}

auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

if (!((matrix.is_c_contiguous()) &&
(vector.is_c_contiguous() || vector.is_f_contiguous()) &&
Expand Down Expand Up @@ -188,7 +188,7 @@ py_sub(sycl::queue q,
"USM allocation is not bound to the context in execution queue");
}

auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

if (!((in_v1.is_c_contiguous() || in_v1.is_f_contiguous()) &&
(in_v2.is_c_contiguous() || in_v2.is_f_contiguous()) &&
Expand Down Expand Up @@ -294,7 +294,7 @@ py_axpby_inplace(sycl::queue q,
throw std::runtime_error(
"USM allocation is not bound to the context in execution queue");
}
auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

if (!((x.is_c_contiguous() || x.is_f_contiguous()) &&
(y.is_c_contiguous() || y.is_f_contiguous())))
Expand Down Expand Up @@ -394,7 +394,7 @@ py::object py_norm_squared_blocking(sycl::queue q,
"USM allocation is not bound to the context in execution queue");
}

auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

int r_typenum = r.get_typenum();
if ((r_typenum != api.UAR_DOUBLE_) && (r_typenum != api.UAR_FLOAT_) &&
Expand Down Expand Up @@ -464,7 +464,7 @@ py::object py_dot_blocking(sycl::queue q,
"USM allocation is not bound to the context in execution queue");
}

auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

int v1_typenum = v1.get_typenum();
int v2_typenum = v2.get_typenum();
Expand Down Expand Up @@ -581,7 +581,7 @@ int py_cg_solve(sycl::queue exec_q,
const char *b_ch = bvec.get_data();
char *x_ch = xvec.get_data();

auto &api = dpctl::detail::dpctl_capi::get();
auto const &api = dpctl::detail::dpctl_capi::get();

if (A_typenum == api.UAR_DOUBLE_) {
using T = double;
Expand Down