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

Function AclGetClContext

src/c/cl/AclOpenClExt.cpp:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include "support/Cast.h"
33
34extern "C" AclStatus AclGetClContext(AclContext external_ctx, cl_context *opencl_context)
35{
36 using namespace arm_compute;
37 IContext *ctx = get_internal(external_ctx);
38
39 if (detail::validate_internal_context(ctx) != StatusCode::Success)
40 {
41 return AclStatus::AclInvalidArgument;
42 }
43
44 if (ctx->type() != Target::GpuOcl)
45 {
46 return AclStatus::AclInvalidTarget;
47 }
48
49 if (opencl_context == nullptr)
50 {
51 return AclStatus::AclInvalidArgument;
52 }
53
54 *opencl_context = utils::cast::polymorphic_downcast<arm_compute::gpu::opencl::ClContext *>(ctx)->cl_ctx().get();
55
56 return AclStatus::AclSuccess;
57}
58
59extern "C" AclStatus AclSetClContext(AclContext external_ctx, cl_context opencl_context)
60{

Callers 1

TEST_CASEFunction · 0.85

Calls 5

cl_ctxMethod · 0.80
get_internalFunction · 0.50
typeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected