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

Method SynchronousMemSet

tensorflow/stream_executor/rocm/rocm_gpu_executor.cc:508–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508port::Status GpuExecutor::SynchronousMemSet(DeviceMemoryBase* location,
509 int value, uint64 size) {
510 if (reinterpret_cast<uintptr_t>(location->opaque()) % 4 == 0 &&
511 size % 4 == 0) {
512 // hipMemset reinterprets "value" as a uint8.
513 uint8 byte_value = static_cast<uint8>(value);
514 uint32 pattern = (byte_value << 24) | (byte_value << 16) |
515 (byte_value << 8) | byte_value;
516 return GpuDriver::SynchronousMemsetUint32(
517 context_, AsROCmDevicePtr(location), pattern, size / 4);
518 }
519 return GpuDriver::SynchronousMemsetUint8(context_, AsROCmDevicePtr(location),
520 value, size);
521}
522
523port::Status GpuExecutor::SynchronousMemcpy(DeviceMemoryBase* gpu_dst,
524 const void* host_src, uint64 size) {

Callers

nothing calls this directly

Calls 2

AsROCmDevicePtrFunction · 0.85
opaqueMethod · 0.80

Tested by

no test coverage detected