Class dsp::test::TransferCUDATestHelper
-
class TransferCUDATestHelper
Facilitates the transfer of TimeSeries to/from GPU.
Public Functions
-
TransferCUDATestHelper(Memory *memory = 0, cudaStream_t stream = 0)
Construct a new TransferCUDATestHelper object.
Note that the memory attribute must be CUDA::DeviceMemory instance if a host to device transfer is used by the helper.
- Parameters:
memory – optional memory manager that will allocate memory on device
stream – optional CUDA stream in which transfers will be scheduled
-
~TransferCUDATestHelper() = default
Destroy the TransferCUDATestHelper object.
-
void copy(dsp::TimeSeries *into, const dsp::TimeSeries *from, cudaMemcpyKind direction)
Copy data from one TimeSeries to another, either from device to host or vice versa.
- Parameters:
into – TimeSeries into which data will be copied
from – TimeSeries from which data will be copied
direction – the kind of transfer (device to host, or host to device)
- Post:
If direction == cudaMemcpyHostToDevice and this->memory has been set, then the memory manager of out will be set to CUDA::DeviceMemory
-
void copy_bitseries(dsp::BitSeries *into, const dsp::BitSeries *from, cudaMemcpyKind direction)
Copy data from one BitSeries to a another, either from device to host or vice versa.
- Parameters:
- Post:
If direction == cudaMemcpyHostToDevice and this->memory has been set, then the memory manager of out will be set to CUDA::DeviceMemory
-
TransferCUDATestHelper(Memory *memory = 0, cudaStream_t stream = 0)