From fbb25cd7d0e7d79c5bff1519e56741a4e4e4e052 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Fri, 17 Feb 2023 17:56:09 -0600 Subject: [PATCH] Mark static function usm_ndarray_types::typenum_to_lookup_id const This allows to call it for const struct references. --- dpctl/tensor/libtensor/include/utils/type_dispatch.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpctl/tensor/libtensor/include/utils/type_dispatch.hpp b/dpctl/tensor/libtensor/include/utils/type_dispatch.hpp index e161f41c01..c6abfe6525 100644 --- a/dpctl/tensor/libtensor/include/utils/type_dispatch.hpp +++ b/dpctl/tensor/libtensor/include/utils/type_dispatch.hpp @@ -162,7 +162,7 @@ class DispatchVectorBuilder struct usm_ndarray_types { - int typenum_to_lookup_id(int typenum) + int typenum_to_lookup_id(int typenum) const { using typenum_t = dpctl::tensor::detail::typenum_t; auto const &api = ::dpctl::detail::dpctl_capi::get(); @@ -232,7 +232,7 @@ struct usm_ndarray_types } private: - void throw_unrecognized_typenum_error(int typenum) + void throw_unrecognized_typenum_error(int typenum) const { throw std::runtime_error("Unrecogized typenum " + std::to_string(typenum) + " encountered.");