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

Method AllocateZeroed

tensorflow/stream_executor/stream_executor_pimpl.h:883–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881
882template <typename T>
883DeviceMemory<T> StreamExecutor::AllocateZeroed() {
884 DeviceMemoryBase buf = Allocate(sizeof(T), /*memory_space=*/0);
885 if (buf.is_null()) {
886 return DeviceMemory<T>{};
887 }
888
889 DeviceMemory<T> result(buf);
890 bool ok = SynchronousMemZero(&result, sizeof(T)).ok();
891 if (!ok) {
892 Deallocate(&result);
893 return DeviceMemory<T>{};
894 }
895
896 return result;
897}
898
899template <typename T>
900DeviceMemory<T> StreamExecutor::GetSubBuffer(DeviceMemory<T> *parent,

Callers

nothing calls this directly

Calls 2

is_nullMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected