Skip to content

Commit c6bc990

Browse files
committed
make namespace-scope constexpr variables inline in headers
this gives these constants external linkage and prevents duplication
1 parent a26cac1 commit c6bc990

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dpctl/tensor/libtensor/include/kernels/alignment.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace kernels
3030
namespace alignment_utils
3131
{
3232

33-
static constexpr std::size_t required_alignment = 64UL;
33+
inline constexpr std::size_t required_alignment = 64UL;
3434

3535
template <std::uintptr_t alignment, typename Ptr> bool is_aligned(Ptr p)
3636
{

dpctl/tensor/libtensor/include/utils/type_dispatch_building.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ enum class typenum_t : int
5656
CFLOAT,
5757
CDOUBLE, // 13
5858
};
59-
constexpr int num_types = 14; // number of elements in typenum_t
59+
inline constexpr int num_types = 14; // number of elements in typenum_t
6060

6161
template <typename funcPtrT,
6262
template <typename fnT, typename D, typename S>

dpctl/tensor/libtensor/include/utils/type_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct is_complex<
5151
{
5252
};
5353

54-
template <typename T> constexpr bool is_complex_v = is_complex<T>::value;
54+
template <typename T> inline constexpr bool is_complex_v = is_complex<T>::value;
5555

5656
template <typename dstTy, typename srcTy> dstTy convert_impl(const srcTy &v)
5757
{

0 commit comments

Comments
 (0)