| 62 | }; |
| 63 | |
| 64 | uint8_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 | |
| 79 | gemmlowp::WorkersPool* GetWorkersPool() { |
| 80 | static gemmlowp::WorkersPool* pool = new gemmlowp::WorkersPool(); |
no test coverage detected