41 #include <pcl/gpu/containers/device_array.h>
42 #include <pcl/gpu/utils/safe_call.hpp>
54 cudaSafeCall( cudaHostRegister(ptr_, size, 0) );
55 cudaSafeCall( cudaStreamCreate(&stream_) );
60 cudaSafeCall( cudaHostRegister(ptr_, data.size(), 0) );
61 cudaSafeCall( cudaStreamCreate(&stream_) );
66 cudaSafeCall( cudaHostUnregister(ptr_) );
67 cudaSafeCall( cudaStreamDestroy(stream_) );
72 cudaSafeCall( cudaMemcpyAsync(ptr_, arr.
ptr(), arr.
sizeBytes(), cudaMemcpyDeviceToHost, stream_) );
77 cudaSafeCall( cudaMemcpy2DAsync(ptr_, arr.
cols(), arr.
ptr(), arr.
step(), arr.
colsBytes(), arr.
rows(), cudaMemcpyDeviceToHost, stream_) );
82 cudaSafeCall( cudaMemcpyAsync(arr.
ptr(), ptr_, arr.
size(), cudaMemcpyHostToDevice, stream_) );
87 cudaSafeCall( cudaMemcpy2DAsync(arr.
ptr(), arr.
step(), ptr_, arr.
cols(), arr.
colsBytes(), arr.
rows(), cudaMemcpyHostToDevice, stream_) );
92 cudaSafeCall( cudaStreamSynchronize(stream_) );