@@ -119,7 +119,7 @@ constexpr size_t gcd(size_t a, size_t b) {
119119 * Returns true if a pointer having alignment of `a` bytes also has an alignment of `b` bytes. Returns false otherwise.
120120 */
121121KERNEL_FLOAT_INLINE
122- constexpr size_t alignment_divisible (size_t a, size_t b) {
122+ constexpr bool is_alignment_divisible (size_t a, size_t b) {
123123 return gcd (a, KERNEL_FLOAT_MAX_ALIGNMENT) % gcd (b, KERNEL_FLOAT_MAX_ALIGNMENT) == 0 ;
124124}
125125
@@ -482,7 +482,7 @@ struct vector_ptr {
482482 typename T2,
483483 size_t N2,
484484 size_t A2,
485- enable_if_t <detail::alignment_divisible (A2, Alignment), int > = 0 >
485+ enable_if_t <detail::is_alignment_divisible (A2, Alignment), int > = 0 >
486486 KERNEL_FLOAT_INLINE vector_ptr (vector_ptr<T2, N2, U, A2> p) : data_(p.get()) {}
487487
488488 /* *
@@ -567,14 +567,14 @@ struct vector_ptr<T, N, const U, Alignment> {
567567 typename T2,
568568 size_t N2,
569569 size_t A2,
570- enable_if_t <detail::alignment_divisible (A2, Alignment), int > = 0 >
570+ enable_if_t <detail::is_alignment_divisible (A2, Alignment), int > = 0 >
571571 KERNEL_FLOAT_INLINE vector_ptr (vector_ptr<T2, N2, const U, A2> p) : data_(p.get()) {}
572572
573573 template <
574574 typename T2,
575575 size_t N2,
576576 size_t A2,
577- enable_if_t <detail::alignment_divisible (A2, Alignment), int > = 0 >
577+ enable_if_t <detail::is_alignment_divisible (A2, Alignment), int > = 0 >
578578 KERNEL_FLOAT_INLINE vector_ptr (vector_ptr<T2, N2, U, A2> p) : data_(p.get()) {}
579579
580580 KERNEL_FLOAT_INLINE vector_ref<value_type, N, const U, Alignment> operator *() const {
@@ -621,7 +621,7 @@ template<
621621 size_t N,
622622 typename U,
623623 size_t A,
624- typename = enable_if_t <(N * sizeof (U)) % A == 0 >>
624+ typename = enable_if_t <detail::is_alignment_divisible (N * sizeof (U), A) >>
625625KERNEL_FLOAT_INLINE vector_ptr<T, N, U, A>& operator +=(vector_ptr<T, N, U, A>& p, size_t i) {
626626 return p = p + i;
627627}
@@ -634,30 +634,30 @@ KERNEL_FLOAT_INLINE vector_ptr<T, N, U, A>& operator+=(vector_ptr<T, N, U, A>& p
634634 * @tparam U The type of the elements pointed to by the raw pointer.
635635 */
636636template <typename T, size_t N = 1 , typename U>
637- KERNEL_FLOAT_INLINE vector_ptr<T, N, U> wrap_ptr (U* ptr) {
637+ KERNEL_FLOAT_INLINE vector_ptr<T, N, U> make_vec_ptr (U* ptr) {
638638 return vector_ptr<T, N, U> {ptr};
639639}
640640
641+ // Doxygen cannot deal with the `make_vec_ptr` being defined multiple times, we ignore the second definition.
642+ // / @cond IGNORE
641643/* *
642644 * Creates a `vector_ptr<T, N>` from a raw pointer `T*` by asserting a specific alignment `N`.
643645 *
644646 * @tparam N The alignment constraint for the vector_ptr.
645647 * @tparam T The type of the elements pointed to by the raw pointer.
646648 */
647649template <size_t N, typename T>
648- KERNEL_FLOAT_INLINE vector_ptr<T, N> assert_aligned (T* ptr) {
650+ KERNEL_FLOAT_INLINE vector_ptr<T, N> make_vec_ptr (T* ptr) {
649651 return vector_ptr<T, N> {ptr};
650652}
651653
652- // Doxygen cannot deal with the `assert_aligned` being defined twice, we ignore the second definition.
653- // / @cond IGNORE
654654/* *
655655 * Creates a `vector_ptr<T, 1>` from a raw pointer `T*`. The alignment is assumed to be KERNEL_FLOAT_MAX_ALIGNMENT.
656656 *
657657 * @tparam T The type of the elements pointed to by the raw pointer.
658658 */
659- template <typename T>
660- KERNEL_FLOAT_INLINE vector_ptr<T, 1 , T, KERNEL_FLOAT_MAX_ALIGNMENT> assert_aligned (T* ptr) {
659+ template <decltype ( nullptr ) = nullptr , typename T>
660+ KERNEL_FLOAT_INLINE vector_ptr<T, 1 , T, KERNEL_FLOAT_MAX_ALIGNMENT> make_vec_ptr (T* ptr) {
661661 return vector_ptr<T, 1 , T, KERNEL_FLOAT_MAX_ALIGNMENT> {ptr};
662662}
663663// / @endcond
0 commit comments