@@ -161,28 +161,6 @@ inline bool block_size_compare(block lhs, block rhs)
161161 return lhs.size () < rhs.size ();
162162}
163163
164- /* *
165- * @brief Align up to the allocation alignment.
166- *
167- * @param[in] v value to align
168- * @return Return the aligned value
169- */
170- std::size_t align_up (std::size_t value) noexcept
171- {
172- return rmm::align_up (value, rmm::CUDA_ALLOCATION_ALIGNMENT);
173- }
174-
175- /* *
176- * @brief Align down to the allocation alignment.
177- *
178- * @param[in] v value to align
179- * @return Return the aligned value
180- */
181- std::size_t align_down (std::size_t value) noexcept
182- {
183- return rmm::align_down (value, rmm::CUDA_ALLOCATION_ALIGNMENT);
184- }
185-
186164/* *
187165 * @brief Get the first free block of at least `size` bytes.
188166 *
@@ -318,9 +296,11 @@ class global_arena final
318296 maximum_size_{maximum_size}
319297 {
320298 RMM_EXPECTS (nullptr != upstream_mr_, " Unexpected null upstream pointer." );
321- RMM_EXPECTS (initial_size == default_initial_size || initial_size == align_up (initial_size),
299+ RMM_EXPECTS (initial_size == default_initial_size ||
300+ initial_size == rmm::align_up (initial_size, rmm::CUDA_ALLOCATION_ALIGNMENT),
322301 " Error, Initial arena size required to be a multiple of 256 bytes" );
323- RMM_EXPECTS (maximum_size_ == default_maximum_size || maximum_size_ == align_up (maximum_size_),
302+ RMM_EXPECTS (maximum_size_ == default_maximum_size ||
303+ maximum_size_ == rmm::align_up (maximum_size_, rmm::CUDA_ALLOCATION_ALIGNMENT),
324304 " Error, Maximum arena size required to be a multiple of 256 bytes" );
325305
326306 if (initial_size == default_initial_size || maximum_size == default_maximum_size)
@@ -330,11 +310,11 @@ class global_arena final
330310 RMM_CUDA_TRY (cudaMemGetInfo (&free, &total));
331311 if (initial_size == default_initial_size)
332312 {
333- initial_size = align_up (std::min (free, total / 2 ));
313+ initial_size = rmm:: align_up (std::min (free, total / 2 ), rmm::CUDA_ALLOCATION_ALIGNMENT );
334314 }
335315 if (maximum_size_ == default_maximum_size)
336316 {
337- maximum_size_ = align_down (free) - reserved_size;
317+ maximum_size_ = rmm:: align_down (free, rmm::CUDA_ALLOCATION_ALIGNMENT ) - reserved_size;
338318 }
339319 }
340320 RMM_EXPECTS (initial_size <= maximum_size_, " Initial arena size exceeds the maximum pool size!" );
0 commit comments