16 static MTL::Device *_mDevice;
19 static MTL::ComputePipelineState *_mMatmulFunctionPSO;
22 static MTL::CommandQueue *_mCommandQueue;
25 static MTL::Buffer *_mBufferA;
26 static MTL::Buffer *_mBufferB;
27 static MTL::Buffer *_mBufferScales;
28 static MTL::Buffer *_mBufferResult;
29 static MTL::Buffer *_mParams;
31 static std::unordered_map<void *, MTL::Buffer *> _mumap;
36 static void *allocateSharedMem(
size_t size);
39 static void sendComputeCommand();
40 static void encodeCommand(MTL::ComputeCommandEncoder *computeEncoder);
41 static MTL::Buffer *getBufferfromPtr(
void *ptr);