Skip to content

Commit

Permalink
buffer don't use page locked memory for device to host transfers
Browse files Browse the repository at this point in the history
using cudaMallocHost caused performance problems on Perlmutter.
  • Loading branch information
burlen committed Sep 9, 2023
1 parent c0b2167 commit 3d84c83
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hamr_buffer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1767,15 +1767,17 @@ std::shared_ptr<const T> buffer<T>::get_host_accessible() const
#if defined(HAMR_ENABLE_CUDA)
else if ((m_alloc == allocator::cuda) || (m_alloc == allocator::cuda_async))
{
// make a copy on the host
// make a copy on the host.
std::shared_ptr<T> tmp = malloc_allocator<T>::allocate(m_size);
/*TODO:Using cudaMallocHost caused performance issues on Perlmutter
std::shared_ptr<T> tmp = cuda_malloc_host_allocator<T>::allocate(m_size);
if (!tmp)
{
std::cerr << "[" << __FILE__ << ":" << __LINE__ << "] ERROR:"
" CUDA failed to allocate host pinned memory, falling back"
" to the default system allocator." << std::endl;
tmp = malloc_allocator<T>::allocate(m_size);
}
}*/

activate_cuda_device dev(m_owner);

Expand Down

0 comments on commit 3d84c83

Please sign in to comment.