MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _validate_buffer

Function _validate_buffer

csrc/aio/common/deepspeed_aio_common.cpp:364–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364static bool _validate_buffer(const char* filename, void* aio_buffer, const int64_t num_bytes)
365{
366 std::vector<char> regular_buffer;
367 const auto reg_ret = regular_read(filename, regular_buffer);
368 assert(0 == reg_ret);
369 std::cout << "regular read of " << filename << " returned " << regular_buffer.size() << " bytes"
370 << std::endl;
371
372 if (static_cast<int64_t>(regular_buffer.size()) != num_bytes) { return false; }
373
374 return (0 == memcmp(aio_buffer, regular_buffer.data(), regular_buffer.size()));
375}
376
377bool validate_aio_operation(const bool read_op,
378 const char* filename,

Callers 1

validate_aio_operationFunction · 0.85

Calls 3

regular_readFunction · 0.85
dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected