rm un-necessary code
This commit is contained in:
parent
40dc263602
commit
1bedd76e94
@ -72,22 +72,12 @@ class pinned_allocator {
|
|||||||
if (cnt > this->max_size()) { throw std::bad_alloc(); } // end if
|
if (cnt > this->max_size()) { throw std::bad_alloc(); } // end if
|
||||||
|
|
||||||
pointer result(nullptr);
|
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)));
|
dh::safe_cuda(cudaMallocHost(reinterpret_cast<void**>(&result), cnt * sizeof(value_type)));
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void deallocate(pointer p, size_type) {
|
inline void deallocate(pointer p, size_type) {
|
||||||
#if defined(XGBOOST_USE_HIP)
|
|
||||||
dh::safe_cuda(hipHostFree(p));
|
|
||||||
#else
|
|
||||||
dh::safe_cuda(cudaFreeHost(p));
|
dh::safe_cuda(cudaFreeHost(p));
|
||||||
#endif
|
|
||||||
} // NOLINT
|
} // NOLINT
|
||||||
|
|
||||||
inline size_type max_size() const { return (std::numeric_limits<size_type>::max)() / sizeof(T); } // NOLINT
|
inline size_type max_size() const { return (std::numeric_limits<size_type>::max)() / sizeof(T); } // NOLINT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user