24.02.1
|
Go to the documentation of this file.
24 #ifndef ACL_SRC_GPU_CL_UTILS_CLAUXTENSORHANDLER_H
25 #define ACL_SRC_GPU_CL_UTILS_CLAUXTENSORHANDLER_H
68 bool pack_inject =
false,
69 bool bypass_alloc =
false,
70 bool bypass_import =
false)
73 if (
info.total_size() == 0)
80 if ((packed_tensor ==
nullptr) || (
info.total_size() > packed_tensor->
info()->
total_size()))
91 _injected_tensor_pack = &
pack;
92 _injected_slot_id = slot_id;
118 if (
info.total_size() <=
tensor.info()->total_size())
130 if (_injected_tensor_pack)
153 #endif // ACL_SRC_GPU_CL_UTILS_CLAUXTENSORHANDLER_H
#define ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL(msg)
CLAuxTensorHandler(TensorInfo &info, ICLTensor &tensor, bool bypass_import=false)
Create a temporary handle to the original tensor with a new TensorInfo This is useful if we want to c...
void remove_tensor(int id)
Remove the tensor stored with the given id.
Interface for OpenCL tensor.
virtual const cl::Buffer & cl_buffer() const =0
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing ...
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
Basic implementation of the OpenCL tensor interface.
void soft_init(TensorInfo &input, size_t alignment=0)
Initialize a tensor based with a reference TensorInfo.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Status import_memory(cl::Buffer buffer)
Import an existing memory as a tensor's backing memory.
CLAuxTensorHandler & operator=(const CLAuxTensorHandler)=delete
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
CLTensor * tensor
Pointer to the auxiliary tensor.
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
Tensor handler to wrap and handle tensor allocations on workspace buffers.
Store the tensor's metadata.
Copyright (c) 2017-2024 Arm Limited.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
CLAuxTensorHandler(int slot_id, TensorInfo &info, ITensorPack &pack, bool pack_inject=false, bool bypass_alloc=false, bool bypass_import=false)
Create a temporary tensor handle, by either important an existing tensor from a tensor pack,...
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.