33 constexpr int32_t max_allowed_dims = 6;
48 if(desc.
ndims > max_allowed_dims)
80 if(desc ==
nullptr || !is_desc_valid(*desc))
92 *external_tensor = tensor;
105 if(handle ==
nullptr)
111 *handle = tensor->map();
126 status = tensor->unmap();
138 status = tensor->import(handle, utils::as_enum<ImportMemoryType>(
type));
168 auto status = convert_and_validate_tensor(tensor, &internal_tensor);
171 *size = internal_tensor->get_size();
172 return utils::as_cenum<AclStatus>(status);
185 const auto status = convert_and_validate_tensor(tensor, &internal_tensor);
188 *desc = internal_tensor->get_descriptor();
189 return utils::as_cenum<AclStatus>(status);
#define ARM_COMPUTE_RETURN_CENUM_ON_FAILURE(status)
Base class specifying the tensor interface.
StatusCode validate_internal_context(const IContext *ctx)
Check if an internal context is valid.
#define ARM_COMPUTE_LOG_ERROR_ACL(msg)
Log an error message to the logger.
StatusCode validate_internal_tensor(const ITensorV2 *tensor)
Check if an internal tensor is valid.
AclStatus AclCreateTensor(AclTensor *external_tensor, AclContext external_ctx, const AclTensorDescriptor *desc, bool allocate)
Create a Tensor object.
decltype(strategy::transforms) typedef type
int32_t ndims
Number or dimensions.
Copyright (c) 2017-2021 Arm Limited.
Call failed as invalid argument was passed.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
AclStatus AclDestroyTensor(AclTensor external_tensor)
Destroy a given tensor object.
Call succeeded, leading to valid state for all involved objects/data.
AclStatus AclGetTensorDescriptor(AclTensor tensor, AclTensorDescriptor *desc)
Get the descriptor of this tensor.
AclDataType data_type
Tensor Data type.
AclImportMemoryType
Type of memory to be imported.
Call failed due to failure to allocate resources.
AclStatus AclMapTensor(AclTensor external_tensor, void **handle)
Map a tensor's backing memory to the host.
virtual ITensorV2 * create_tensor(const AclTensorDescriptor &desc, bool allocate)=0
Create a tensor object.
AclStatus AclTensorImport(AclTensor external_tensor, void *handle, AclImportMemoryType type)
Import external memory to a given tensor object.
int32_t * shape
Tensor Shape.
IContext * get_internal(AclContext ctx)
Extract internal representation of a Context.
AclStatus AclGetTensorSize(AclTensor tensor, uint64_t *size)
__cplusplus
AclStatus AclUnmapTensor(AclTensor external_tensor, void *handle)
Unmap the tensor's backing memory.