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

Function AclGetClMem

src/c/cl/AclOpenClExt.cpp:162–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162extern "C" AclStatus AclGetClMem(AclTensor external_tensor, cl_mem *opencl_mem)
163{
164 using namespace arm_compute;
165 ITensorV2 *tensor = get_internal(external_tensor);
166
167 if (detail::validate_internal_tensor(tensor) != StatusCode::Success)
168 {
169 return AclStatus::AclInvalidArgument;
170 }
171
172 if (tensor->header.ctx->type() != Target::GpuOcl)
173 {
174 return AclStatus::AclInvalidTarget;
175 }
176
177 if (opencl_mem == nullptr)
178 {
179 return AclStatus::AclInvalidArgument;
180 }
181
182 auto cl_tensor = utils::cast::polymorphic_downcast<arm_compute::ICLTensor *>(tensor->tensor());
183 *opencl_mem = cl_tensor->cl_buffer().get();
184
185 return AclStatus::AclSuccess;
186}

Callers

nothing calls this directly

Calls 5

validate_internal_tensorFunction · 0.85
get_internalFunction · 0.50
typeMethod · 0.45
tensorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected