| 57 | } |
| 58 | |
| 59 | extern "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 | |
| 88 | extern "C" AclStatus AclGetClDevice(AclContext external_ctx, cl_device_id *opencl_device) |
| 89 | { |
nothing calls this directly
no test coverage detected