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

Function GetScratch

tensorflow/core/kernels/meta_support.cc:64–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62};
63
64uint8_t* GetScratch(OpKernelContext* context) {
65 Scratch* scratch = nullptr;
66 std::function<Status(Scratch**)> creator = [](Scratch** resource) {
67 *resource = new Scratch();
68 return Status::OK();
69 };
70 Status s = context->resource_manager()->LookupOrCreate(
71 "MetaGemm", "ScratchBuffer", &scratch, creator);
72 if (!s.ok()) {
73 context->CtxFailureWithWarning(s);
74 return nullptr;
75 }
76 return scratch->buffer();
77}
78
79gemmlowp::WorkersPool* GetWorkersPool() {
80 static gemmlowp::WorkersPool* pool = new gemmlowp::WorkersPool();

Callers 1

QuantizedGemmImplFunction · 0.85

Calls 5

LookupOrCreateMethod · 0.45
resource_managerMethod · 0.45
okMethod · 0.45
CtxFailureWithWarningMethod · 0.45
bufferMethod · 0.45

Tested by

no test coverage detected