| 181 | } |
| 182 | |
| 183 | Status CudaBuffer::CopyFromAnotherDevice(const std::shared_ptr<CudaContext>& src_ctx, |
| 184 | const int64_t position, const void* data, |
| 185 | int64_t nbytes) { |
| 186 | if (nbytes > size_ - position) { |
| 187 | return Status::Invalid("Copy would overflow buffer"); |
| 188 | } |
| 189 | return src_ctx->CopyDeviceToAnotherDevice( |
| 190 | context_, const_cast<uint8_t*>(data_) + position, data, nbytes); |
| 191 | } |
| 192 | |
| 193 | Result<std::shared_ptr<CudaIpcMemHandle>> CudaBuffer::ExportForIpc() { |
| 194 | if (is_ipc_) { |
nothing calls this directly
no test coverage detected