Home
librmm
libucxx
ucxx
nightly (26.12)
nightly (26.12)
stable (26.10)
legacy (26.08)
Toggle main menu visibility
Loading...
Searching...
No Matches
include
rmm
aligned.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
6
#pragma once
7
8
#include <rmm/detail/export.hpp>
9
10
#include <cassert>
11
#include <cstddef>
12
13
RMM_NAMESPACE_BEGIN
14
20
25
static
constexpr
std::size_t
CUDA_ALLOCATION_ALIGNMENT
{256};
26
34
[[nodiscard]]
bool
is_pow2
(std::size_t value)
noexcept
;
35
43
[[nodiscard]]
bool
is_supported_alignment
(std::size_t alignment)
noexcept
;
44
53
[[nodiscard]]
bool
is_supported_base_resource_alignment
(std::size_t alignment)
noexcept
;
54
66
[[nodiscard]] std::size_t
align_up
(std::size_t value, std::size_t alignment)
noexcept
;
67
78
[[nodiscard]] std::size_t
align_down
(std::size_t value, std::size_t alignment)
noexcept
;
79
88
[[nodiscard]]
bool
is_aligned
(std::size_t value, std::size_t alignment)
noexcept
;
89
98
[[nodiscard]]
bool
is_pointer_aligned
(
99
void
* ptr, std::size_t alignment =
rmm::CUDA_ALLOCATION_ALIGNMENT
)
noexcept
;
100
// end of group
102
103
RMM_NAMESPACE_END
rmm::CUDA_ALLOCATION_ALIGNMENT
static constexpr std::size_t CUDA_ALLOCATION_ALIGNMENT
Default alignment used for CUDA memory allocation.
Definition
aligned.hpp:25
rmm::is_pointer_aligned
bool is_pointer_aligned(void *ptr, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept
Checks whether the provided pointer is aligned to a specified alignment.
rmm::align_down
std::size_t align_down(std::size_t value, std::size_t alignment) noexcept
Align down to the nearest multiple of specified power of 2.
rmm::is_supported_alignment
bool is_supported_alignment(std::size_t alignment) noexcept
Returns whether or not alignment is a valid memory alignment.
rmm::is_pow2
bool is_pow2(std::size_t value) noexcept
Returns whether or not value is a power of 2.
rmm::is_aligned
bool is_aligned(std::size_t value, std::size_t alignment) noexcept
Checks whether a value is aligned to a multiple of a specified power of 2.
rmm::align_up
std::size_t align_up(std::size_t value, std::size_t alignment) noexcept
Align up to nearest multiple of specified power of 2.
rmm::is_supported_base_resource_alignment
bool is_supported_base_resource_alignment(std::size_t alignment) noexcept
Returns whether or not alignment is supported by base CUDA memory resources.
Generated by
1.18.0