45 using OperatorType = opencl::ClGemmLowpMatrixMultiplyCore;
47 struct CLGEMMLowpMatrixMultiplyCore::Impl
49 const ICLTensor *
b{
nullptr };
50 std::unique_ptr<OperatorType> op{
nullptr };
51 MemoryGroup memory_group{};
52 ITensorPack run_pack{};
54 WorkspaceData<CLTensor> workspace_tensors{};
55 bool is_prepared{
false };
59 : _impl(
std::make_unique<Impl>())
76 _impl->op = std::make_unique<OperatorType>();
79 _impl->op->configure(compile_context, a->
info(), b->
info(), c !=
nullptr ? c->
info() :
nullptr, output->
info(), gemm_info);
80 _impl->aux_mem_req = _impl->op->workspace();
83 if(_impl->is_prepared)
85 _impl->run_pack.add_const_tensor(
ACL_SRC_0, a);
86 _impl->run_pack.add_tensor(
ACL_DST, output);
91 _impl->workspace_tensors = manage_workspace<CLTensor>(_impl->op->workspace(), _impl->memory_group, _impl->run_pack, _impl->run_pack);
106 _impl->op->run(_impl->run_pack);
111 if(!_impl->is_prepared)
113 _impl->op->prepare(_impl->run_pack);
118 _impl->is_prepared =
true;
void prepare() override
Prepare the function for executing.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Store the tensor's metadata.
void configure(const ICLTensor *a, const ICLTensor *b, const ICLTensor *c, ICLTensor *output, const GEMMInfo &gemm_info=GEMMInfo())
Initialise the kernel's inputs, output.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
void run() override
Run the kernels contained in the function.
bool retain_internal_weights() const
Flag which specifies if the weights tensor has to be retained from previous run.
Copyright (c) 2017-2021 Arm Limited.
std::vector< MemoryInfo > MemoryRequirements
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
static Status validate(const ITensorInfo *a, const ITensorInfo *b, const ITensorInfo *c, const ITensorInfo *output, const GEMMInfo &gemm_info=GEMMInfo())
Static function to check if given info will lead to a valid configuration of CLGEMMLowpMatrixMultiply...
~CLGEMMLowpMatrixMultiplyCore()
Default destructor.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void release_temporaries(const experimental::MemoryRequirements &mem_reqs, WorkspaceData< TensorType > &workspace)
Utility function to release tensors with lifetime marked as Prepare.
CLGEMMLowpMatrixMultiplyCore(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
Memory group resources scope handling class.
Interface for OpenCL tensor.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
opencl::ClGemm OperatorType
static Status validate(const ITensorInfo *a, const ITensorInfo *b, const ITensorInfo *c, const ITensorInfo *output, float alpha, float beta, const GEMMInfo &gemm_info)
Static function to check if given info will lead to a valid configuration.