MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / AclCreateTensor

Function AclCreateTensor

src/c/AclTensor.cpp:70–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68} // namespace
69
70extern "C" AclStatus
71AclCreateTensor(AclTensor *external_tensor, AclContext external_ctx, const AclTensorDescriptor *desc, bool allocate)
72{
73 using namespace arm_compute;
74
75 IContext *ctx = get_internal(external_ctx);
76
77 StatusCode status = detail::validate_internal_context(ctx);
78 ARM_COMPUTE_RETURN_CENUM_ON_FAILURE(status);
79
80 if (desc == nullptr || !is_desc_valid(*desc))
81 {
82 ARM_COMPUTE_LOG_ERROR_ACL("[AclCreateTensor]: Descriptor is invalid!");
83 return AclInvalidArgument;
84 }
85
86 auto tensor = ctx->create_tensor(*desc, allocate);
87 if (tensor == nullptr)
88 {
89 ARM_COMPUTE_LOG_ERROR_ACL("[AclCreateTensor]: Couldn't allocate internal resources for tensor creation!");
90 return AclOutOfMemory;
91 }
92 *external_tensor = tensor;
93
94 return AclSuccess;
95}
96
97extern "C" AclStatus AclMapTensor(AclTensor external_tensor, void **handle)
98{

Callers 3

TensorMethod · 0.85
setupMethod · 0.85
setupMethod · 0.85

Calls 4

is_desc_validFunction · 0.85
get_internalFunction · 0.50
create_tensorMethod · 0.45

Tested by

no test coverage detected