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

Function AclSetClContext

src/c/cl/AclOpenClExt.cpp:59–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59extern "C" AclStatus AclSetClContext(AclContext external_ctx, cl_context opencl_context)
60{
61 using namespace arm_compute;
62 IContext *ctx = get_internal(external_ctx);
63
64 if (detail::validate_internal_context(ctx) != StatusCode::Success)
65 {
66 return AclStatus::AclInvalidArgument;
67 }
68
69 if (ctx->type() != Target::GpuOcl)
70 {
71 return AclStatus::AclInvalidTarget;
72 }
73
74 if (ctx->refcount() != 0)
75 {
76 return AclStatus::AclUnsupportedConfig;
77 }
78
79 auto cl_ctx = utils::cast::polymorphic_downcast<arm_compute::gpu::opencl::ClContext *>(ctx);
80 if (!cl_ctx->set_cl_ctx(::cl::Context(opencl_context)))
81 {
82 return AclStatus::AclRuntimeError;
83 }
84
85 return AclStatus::AclSuccess;
86}
87
88extern "C" AclStatus AclGetClDevice(AclContext external_ctx, cl_device_id *opencl_device)
89{

Callers

nothing calls this directly

Calls 6

refcountMethod · 0.80
get_internalFunction · 0.50
ContextClass · 0.50
typeMethod · 0.45
set_cl_ctxMethod · 0.45

Tested by

no test coverage detected