| 56 | namespace opencl |
| 57 | { |
| 58 | std::tuple<IOperator *, StatusCode> ClContext::create_activation(const AclTensorDescriptor &src, |
| 59 | const AclTensorDescriptor &dst, |
| 60 | const AclActivationDescriptor &act, |
| 61 | bool is_validate) |
| 62 | { |
| 63 | TensorInfo src_info = detail::convert_to_legacy_tensor_info(src); |
| 64 | TensorInfo dst_info = detail::convert_to_legacy_tensor_info(dst); |
| 65 | auto info = detail::convert_to_activation_info(act); |
| 66 | |
| 67 | if (is_validate && !bool(arm_compute::opencl::ClActivation::validate(&src_info.set_is_resizable(false), |
| 68 | &dst_info.set_is_resizable(false), info))) |
| 69 | { |
| 70 | return std::make_tuple(nullptr, StatusCode::UnsupportedConfig); |
| 71 | } |
| 72 | |
| 73 | auto act_op = std::make_unique<arm_compute::opencl::ClActivation>(); |
| 74 | act_op->configure(CLKernelLibrary::get().get_compile_context(), &src_info, &dst_info, info); |
| 75 | |
| 76 | auto op = new arm_compute::IOperator(static_cast<IContext *>(this)); |
| 77 | if (op == nullptr) |
| 78 | { |
| 79 | ARM_COMPUTE_LOG_ERROR_ACL("Couldn't allocate internal resources"); |
| 80 | return std::make_tuple(nullptr, StatusCode::OutOfMemory); |
| 81 | } |
| 82 | op->set_internal_operator(std::move(act_op)); |
| 83 | |
| 84 | return std::make_tuple(op, StatusCode::Success); |
| 85 | } |
| 86 | } // namespace opencl |
| 87 | } // namespace gpu |
| 88 | } // namespace arm_compute |
nothing calls this directly
no test coverage detected