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

Method copy

compute/host/host_buffer.cpp:154–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void host_buffer::copy(const compute_queue& cqueue floor_unused, const compute_buffer& src,
155 const size_t size_, const size_t src_offset, const size_t dst_offset) {
156 if (!buffer) return;
157
158 // use min(src size, dst size) as the default size if no size is specified
159 const size_t src_size = src.get_size();
160 const size_t copy_size = (size_ == 0 ? std::min(src_size, size) : size_);
161 if(!copy_check(size, src_size, copy_size, dst_offset, src_offset)) return;
162
163 src._lock();
164 _lock();
165
166 memcpy(buffer.get() + dst_offset, ((const host_buffer*)&src)->get_host_buffer_ptr() + src_offset, copy_size);
167
168 _unlock();
169 src._unlock();
170}
171
172bool host_buffer::fill(const compute_queue& cqueue floor_unused,
173 const void* pattern, const size_t& pattern_size,

Callers 1

cloneMethod · 0.45

Calls 5

_lockMethod · 0.80
get_host_buffer_ptrMethod · 0.80
_unlockMethod · 0.80
minFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected