Program Listing for File CudaCopyToOperation.hpp¶
↰ Return to documentation for file (umpire/op/CudaCopyToOperation.hpp
)
//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016-20, Lawrence Livermore National Security, LLC and Umpire
// project contributors. See the COPYRIGHT file for details.
//
// SPDX-License-Identifier: (MIT)
//////////////////////////////////////////////////////////////////////////////
#ifndef UMPIRE_CudaCopyToOperation_HPP
#define UMPIRE_CudaCopyToOperation_HPP
#include "umpire/op/MemoryOperation.hpp"
namespace umpire {
namespace op {
/*!
* \brief Copy operation to move data from CPU to NVIDIA GPU memory.
*/
class CudaCopyToOperation : public MemoryOperation {
public:
/*!
* @copybrief MemoryOperation::transform
*
* Uses cudaMemcpy to move data when src_ptr is on the CPU and dst_ptr
* is on an NVIDIA GPU.
*
* @copydetails MemoryOperation::transform
*/
void transform(void* src_ptr, void** dst_ptr,
umpire::util::AllocationRecord* src_allocation,
umpire::util::AllocationRecord* dst_allocation,
std::size_t length);
camp::resources::Event transform_async(
void* src_ptr, void** dst_ptr,
umpire::util::AllocationRecord* src_allocation,
umpire::util::AllocationRecord* dst_allocation, std::size_t length,
camp::resources::Resource& ctx);
};
} // end of namespace op
} // end of namespace umpire
#endif // UMPIRE_CudaCopyToOperation_HPP