| 311 | } |
| 312 | |
| 313 | int deepspeed_io_handle_t::pwrite(const torch::Tensor& buffer, |
| 314 | const char* filename, |
| 315 | const bool validate, |
| 316 | const bool async, |
| 317 | const int64_t file_offset) |
| 318 | { |
| 319 | const auto num_write_bytes = static_cast<int64_t>(buffer.nbytes()); |
| 320 | |
| 321 | if (!_is_valid_parallel_aio_op(false, num_write_bytes)) { return -1; } |
| 322 | |
| 323 | const auto fd = open_file(filename, false); |
| 324 | if (fd == -1) { return -1; } |
| 325 | |
| 326 | return _pwrite(buffer, fd, filename, validate, async, file_offset); |
| 327 | } |
| 328 | |
| 329 | int deepspeed_io_handle_t::sync_pread(torch::Tensor& buffer, |
| 330 | const char* filename, |