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

Method AllocateArray

tensorflow/stream_executor/temporary_memory_manager.h:135–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134template <typename T>
135port::StatusOr<std::unique_ptr<TemporaryDeviceMemory<T>>>
136TemporaryMemoryManager::AllocateArray(uint64 element_count) {
137 port::StatusOr<std::unique_ptr<TemporaryDeviceMemoryBase>> temporary_memory =
138 AllocateArrayBase(element_count, sizeof(T));
139 if (!temporary_memory.ok()) {
140 return temporary_memory.status();
141 }
142
143 return std::unique_ptr<TemporaryDeviceMemory<T>>(
144 reinterpret_cast<TemporaryDeviceMemory<T>*>(
145 temporary_memory.ConsumeValueOrDie().release()));
146}
147
148} // namespace internal
149} // namespace stream_executor

Callers

nothing calls this directly

Calls 4

ConsumeValueOrDieMethod · 0.80
okMethod · 0.45
statusMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected