MCPcopy Create free account
hub / github.com/apache/arrow / DoReadAt

Method DoReadAt

cpp/src/arrow/gpu/cuda_memory.cc:262–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262Result<int64_t> CudaBufferReader::DoReadAt(int64_t position, int64_t nbytes,
263 bool allow_short_read, void* buffer) {
264 RETURN_NOT_OK(CheckClosed());
265
266 auto real_nbytes = std::min(nbytes, size_ - position);
267 if (!allow_short_read && real_nbytes != nbytes) {
268 return Status::IOError("Cuda buffer too short: expected to be able to read ", nbytes,
269 " bytes, got ", real_nbytes);
270 }
271 RETURN_NOT_OK(context_->CopyDeviceToHost(buffer, address_ + position, real_nbytes));
272 return real_nbytes;
273}
274
275Result<int64_t> CudaBufferReader::DoRead(int64_t nbytes, void* buffer) {
276 RETURN_NOT_OK(CheckClosed());

Callers

nothing calls this directly

Calls 3

IOErrorFunction · 0.85
CheckClosedFunction · 0.70
CopyDeviceToHostMethod · 0.45

Tested by

no test coverage detected