24.02.1
|
Go to the documentation of this file.
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>())
82 _impl->op = std::make_unique<OperatorType>();
85 _impl->op->configure(compile_context, a->
info(),
b->info(), c !=
nullptr ? c->
info() :
nullptr, output->
info(),
87 _impl->aux_mem_req = _impl->op->workspace();
90 if (_impl->is_prepared)
92 _impl->run_pack.add_const_tensor(
ACL_SRC_0, a);
93 _impl->run_pack.add_tensor(
ACL_DST, output);
98 _impl->workspace_tensors =
99 manage_workspace<CLTensor>(_impl->op->workspace(), _impl->memory_group, _impl->run_pack, _impl->run_pack);
118 _impl->op->run(_impl->run_pack);
123 if (!_impl->is_prepared)
125 _impl->op->prepare(_impl->run_pack);
130 _impl->is_prepared =
true;
std::vector< MemoryInfo > MemoryRequirements
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...
Interface for OpenCL tensor.
void configure(const ICLTensor *a, const ICLTensor *b, const ICLTensor *c, ICLTensor *output, const GEMMInfo &gemm_info=GEMMInfo())
Initialise the kernel's inputs, output.
void prepare() override
Prepare the function for executing.
CLGEMMLowpMatrixMultiplyCore(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void run() override
Run the kernels contained in the function.
void release_temporaries(const experimental::MemoryRequirements &mem_reqs, WorkspaceData< TensorType > &workspace)
Utility function to release tensors with lifetime marked as Prepare.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
opencl::ClGemm OperatorType
~CLGEMMLowpMatrixMultiplyCore()
Default destructor.
Memory group resources scope handling class.
Copyright (c) 2017-2024 Arm Limited.
Store the tensor's metadata.
bool retain_internal_weights() const
Flag which specifies if the weights tensor has to be retained from previous run.
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.