MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CheckMask

Function CheckMask

tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:43–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41int64* after_mask = NewMask(0xcdcdcdcdcdcdcdcd);
42
43bool CheckMask(se::StreamExecutor* exec, void* ptr, int64* mask) {
44 se::DeviceMemory<int64> gpu_ptr{se::DeviceMemoryBase{ptr, MASK_BYTES}};
45 int64 tmp[MASK_WORDS];
46
47 Status result = exec->SynchronousMemcpyD2H(gpu_ptr, MASK_BYTES, tmp);
48 if (!result.ok()) {
49 LOG(FATAL) << "Could not copy debug mask, " << result;
50 }
51
52 bool ok = true;
53 for (int i = 0; i < MASK_WORDS; ++i) {
54 ok &= (mask[i] == tmp[i]);
55 if (!ok) {
56 LOG(ERROR) << "i=" << i
57 << " mask=" << reinterpret_cast<const void*>(mask[i])
58 << " field=" << reinterpret_cast<const void*>(tmp[i]);
59 }
60 }
61
62 return ok;
63}
64
65void InitMask(se::StreamExecutor* exec, void* ptr, int64* mask) {
66 se::DeviceMemory<int64> gpu_ptr{se::DeviceMemoryBase{ptr, MASK_BYTES}};

Callers 2

CheckHeaderMethod · 0.85
CheckFooterMethod · 0.85

Calls 2

SynchronousMemcpyD2HMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected