| 347 | } |
| 348 | |
| 349 | int deepspeed_io_handle_t::pwrite(const torch::Tensor& buffer, |
| 350 | const char* filename, |
| 351 | const bool validate, |
| 352 | const bool async, |
| 353 | const int64_t file_offset) |
| 354 | { |
| 355 | const auto num_write_bytes = static_cast<int64_t>(buffer.nbytes()); |
| 356 | |
| 357 | if (!_is_valid_parallel_aio_op(false, num_write_bytes)) { return -1; } |
| 358 | |
| 359 | const auto fd = open_file(filename, false); |
| 360 | if (fd == -1) { return -1; } |
| 361 | |
| 362 | return _pwrite(buffer, fd, filename, validate, async, file_offset); |
| 363 | } |
| 364 | |
| 365 | int deepspeed_io_handle_t::sync_pread(torch::Tensor& buffer, |
| 366 | const char* filename, |