| 32 | #include "support/Cast.h" |
| 33 | |
| 34 | extern "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 | |
| 59 | extern "C" AclStatus AclSetClContext(AclContext external_ctx, cl_context opencl_context) |
| 60 | { |
no test coverage detected