| 160 | } |
| 161 | |
| 162 | extern "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 | } |
nothing calls this directly
no test coverage detected