patch small pool init

This commit is contained in:
Awni Hannun
2025-07-29 13:57:39 -07:00
parent ef631d63af
commit 4f6bcf086e

View File

@@ -30,8 +30,11 @@ SmallSizePool::SmallSizePool() {
next_free_ = buffer_; next_free_ = buffer_;
CHECK_CUDA_ERROR(cudaMallocManaged(&data_, small_pool_size)); CHECK_CUDA_ERROR(cudaMallocManaged(&data_, small_pool_size));
CHECK_CUDA_ERROR( auto status =
cudaMemAdvise(data_, small_pool_size, cudaMemAdviseSetReadMostly, 0)); cudaMemAdvise(data_, small_pool_size, cudaMemAdviseSetReadMostly, 0);
if (status != cudaSuccess && status != cudaErrorInvalidValue) {
throw std::runtime_error("Unable to initialize small allocator pool");
}
auto curr = next_free_; auto curr = next_free_;
for (size_t i = 1; i < num_blocks; ++i) { for (size_t i = 1; i < num_blocks; ++i) {