rm un-necessary code

This commit is contained in:
Hui Liu 2023-10-30 13:14:45 -07:00
parent 40dc263602
commit 1bedd76e94

View File

@ -72,22 +72,12 @@ class pinned_allocator {
if (cnt > this->max_size()) { throw std::bad_alloc(); } // end if
pointer result(nullptr);
#if defined(XGBOOST_USE_HIP)
dh::safe_cuda(hipHostMalloc(reinterpret_cast<void**>(&result), cnt * sizeof(value_type)));
#else
dh::safe_cuda(cudaMallocHost(reinterpret_cast<void**>(&result), cnt * sizeof(value_type)));
#endif
return result;
}
inline void deallocate(pointer p, size_type) {
#if defined(XGBOOST_USE_HIP)
dh::safe_cuda(hipHostFree(p));
#else
dh::safe_cuda(cudaFreeHost(p));
#endif
} // NOLINT
inline size_type max_size() const { return (std::numeric_limits<size_type>::max)() / sizeof(T); } // NOLINT