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

Method BatchAllocate

tensorflow/core/framework/ev_allocator.h:379–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377 }
378
379 size_t BatchAllocate(size_t num, size_t bin_size, void** ret) {
380 Bin<ChunkType> *bin = nullptr;
381 {
382 mutex_lock l(mu_);
383 auto it = bins_.find(bin_size);
384 if (it == bins_.end()) {
385 bin = new Bin<ChunkType>(bin_size, page_map_);
386 bins_.emplace(bin_size, bin);
387 } else {
388 bin = it->second;
389 }
390 }
391
392 return bin->BatchAllocate(num, ret);
393 }
394
395 void BatchDeallocate(size_t bin_size, std::vector<void*>& ptrs) {
396 Bin<ChunkType> *bin = nullptr;

Callers

nothing calls this directly

Calls 4

findMethod · 0.45
endMethod · 0.45
emplaceMethod · 0.45
BatchAllocateMethod · 0.45

Tested by

no test coverage detected