From 20dda37357ac0d02550f4421de6c8bfe44304f90 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Thu, 8 Feb 2024 16:23:25 +0000 Subject: IVGCVSW-7570 GpuFsa Op: Add ElemenWiseBinary Operators available * Refactor to generalize * Add MUL Signed-off-by: Teresa Charlin Change-Id: I2ee273d50d3a8b114b5a41abc8ee7585b15e3308 --- .../gpuFsa/layers/GpuFsaElementwiseBinarySub.cpp | 79 ---------------------- 1 file changed, 79 deletions(-) delete mode 100644 src/backends/gpuFsa/layers/GpuFsaElementwiseBinarySub.cpp (limited to 'src/backends/gpuFsa/layers/GpuFsaElementwiseBinarySub.cpp') diff --git a/src/backends/gpuFsa/layers/GpuFsaElementwiseBinarySub.cpp b/src/backends/gpuFsa/layers/GpuFsaElementwiseBinarySub.cpp deleted file mode 100644 index 5e0f478686..0000000000 --- a/src/backends/gpuFsa/layers/GpuFsaElementwiseBinarySub.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright © 2024 Arm Ltd and Contributors. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#include "GpuFsaElementwiseBinarySub.hpp" - -#include - -#include -#include -#include -#include - -using namespace arm_compute::experimental::dynamic_fusion; -using namespace armnn::armcomputetensorutils; - -namespace armnn -{ - -arm_compute::Status GpuFsaElementwiseBinarySubValidate(const TensorInfo& input0, - const TensorInfo& input1) -{ - // Create a new workload sketch, for validation purposes - auto compileCtx = arm_compute::CLKernelLibrary::get().get_compile_context(); - auto workloadContext = GpuWorkloadContext(&compileCtx); - GpuWorkloadSketch sketch{ &workloadContext }; - - arm_compute::TensorInfo aclInput0Info = BuildArmComputeTensorInfo(input0, input0.GetNumDimensions()); - arm_compute::TensorInfo aclInput1Info = BuildArmComputeTensorInfo(input1, input1.GetNumDimensions()); - - aclInput0Info.set_are_values_constant(input0.IsConstant()); - aclInput1Info.set_are_values_constant(input1.IsConstant()); - - arm_compute::ITensorInfo* inputInfo0 = workloadContext.create_tensor_info(aclInput0Info); - arm_compute::ITensorInfo* inputInfo1 = workloadContext.create_tensor_info(aclInput1Info); - - return GpuSub::validate_op(sketch, inputInfo0, inputInfo1); -} - -void GpuFsaElementwiseBinarySubCreateOp(GpuFsaPreCompiledBlob* blob, - const TensorInfo& input0, - const TensorInfo& input1) -{ - GpuWorkloadSketch* sketch = blob->sketch.get(); - GpuWorkloadContext* workloadContext = blob->workloadContext.get(); - std::vector inputTensorInfos = {}; - std::vector outputTensorInfos = {}; - - arm_compute::TensorInfo aclInput0Info = BuildArmComputeTensorInfo(input0, input0.GetNumDimensions()); - arm_compute::TensorInfo aclInput1Info = BuildArmComputeTensorInfo(input1, input1.GetNumDimensions()); - - aclInput0Info.set_are_values_constant(input0.IsConstant()); - aclInput1Info.set_are_values_constant(input1.IsConstant()); - - inputTensorInfos.emplace_back(workloadContext->create_tensor_info(aclInput0Info)); - inputTensorInfos.emplace_back(workloadContext->create_tensor_info(aclInput1Info)); - - // Validate operator, check status and update reasonIfUnsupported - arm_compute::Status aclStatus = GpuSub::validate_op(*sketch, inputTensorInfos[0], inputTensorInfos[1]); - const bool supported = aclStatus.error_code() == arm_compute::ErrorCode::OK; - if (!supported) - { - throw BackendCapabilityException("\"GpuFsa\" backend failed during elementwise binary subtract validation"); - } - - arm_compute::ITensorInfo* addOutputInfo = - GpuSub::create_op(*sketch, inputTensorInfos[0], inputTensorInfos[1]); - - // Temporary fix until fusing attempt is make for GpuFsa backend and Output layer workload is created. - outputTensorInfos.emplace_back(workloadContext->create_tensor_info()); - GpuOutput::create_op(*sketch, addOutputInfo, outputTensorInfos[0]); - - // Store the TensorInfos within the blob as unique_ptrs to be used later - blob->inputTensorInfos = std::make_unique>(inputTensorInfos); - blob->outputTensorInfos = std::make_unique>(outputTensorInfos); -} - -} \ No newline at end of file -- cgit v1.2.1