| 260 | } |
| 261 | |
| 262 | Result<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 | |
| 275 | Result<int64_t> CudaBufferReader::DoRead(int64_t nbytes, void* buffer) { |
| 276 | RETURN_NOT_OK(CheckClosed()); |
nothing calls this directly
no test coverage detected