MCPcopy Create free account
hub / github.com/a2flo/floor / copy

Method copy

compute/cuda/cuda_buffer.cpp:282–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void cuda_buffer::copy(const compute_queue& cqueue, const compute_buffer& src,
283 const size_t size_, const size_t src_offset, const size_t dst_offset) {
284 if(buffer == 0) return;
285
286 // use min(src size, dst size) as the default size if no size is specified
287 const size_t src_size = src.get_size();
288 const size_t copy_size = (size_ == 0 ? std::min(src_size, size) : size_);
289 if(!copy_check(size, src_size, copy_size, dst_offset, src_offset)) return;
290
291 // TODO: blocking flag
292 CU_CALL_RET(cu_memcpy_dtod_async(buffer + dst_offset,
293 ((const cuda_buffer&)src).get_cuda_buffer() + src_offset,
294 copy_size, (const_cu_stream)cqueue.get_queue_ptr()),
295 "failed to copy memory on device")
296}
297
298bool cuda_buffer::fill(const compute_queue& cqueue,
299 const void* pattern, const size_t& pattern_size,

Callers

nothing calls this directly

Calls 2

minFunction · 0.50
get_queue_ptrMethod · 0.45

Tested by

no test coverage detected