diff options
author | Tracy Narine <tracy.narine@arm.com> | 2024-02-06 15:22:41 +0000 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2024-02-07 21:04:02 +0000 |
commit | bc5a5d59e07d2365c2c88b3430b4a311d186ebbc (patch) | |
tree | 345691d4b83824e13b99348617dd68866e5f530f /src/backends/gpuFsa/GpuFsaLayerSupport.cpp | |
parent | 7bcae3c835468d9b0770514dc7127f02d47cec5f (diff) | |
download | armnn-bc5a5d59e07d2365c2c88b3430b4a311d186ebbc.tar.gz |
IVGCVSW-7622 GpuFsa Op: Add Cast operator
* Added cast operator support
Signed-off-by: Tracy Narine <tracy.narine@arm.com>
Change-Id: Ie12cb1559a7a059ff35e1c395bc77243499243cd
Diffstat (limited to 'src/backends/gpuFsa/GpuFsaLayerSupport.cpp')
-rw-r--r-- | src/backends/gpuFsa/GpuFsaLayerSupport.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/backends/gpuFsa/GpuFsaLayerSupport.cpp b/src/backends/gpuFsa/GpuFsaLayerSupport.cpp index b73b3e9088..d9d95e5c92 100644 --- a/src/backends/gpuFsa/GpuFsaLayerSupport.cpp +++ b/src/backends/gpuFsa/GpuFsaLayerSupport.cpp @@ -10,6 +10,7 @@ #include <armnn/utility/PolymorphicDowncast.hpp> #if defined(ARMCOMPUTEGPUFSA_ENABLED) +#include "layers/GpuFsaCast.hpp" #include "layers/GpuFsaConvolution2d.hpp" #include "layers/GpuFsaDepthwiseConvolution2d.hpp" #include "layers/GpuFsaElementwiseBinaryAdd.hpp" @@ -73,7 +74,20 @@ bool GpuFsaLayerSupport::IsLayerSupported(const LayerType& type, IgnoreUnused(lstmParamsInfo); IgnoreUnused(quantizedLstmInputParamsInfo); - switch (type) { + switch (type) + { + case LayerType::Cast: + { + if (infos.size() != 2) + { + throw InvalidArgumentException("Invalid number of cast TensorInfos. " + "TensorInfos should be of format: {input, output}."); + } + FORWARD_LAYER_VALIDATE_FUNC(GpuFsaCastValidate, + reasonIfUnsupported, + infos[0], + infos[1]); + } case LayerType::Convolution2d: { if (infos.size() != 4) @@ -110,7 +124,7 @@ bool GpuFsaLayerSupport::IsLayerSupported(const LayerType& type, "TensorInfos should be of format: {input, output, weights, biases}."); } - auto desc = PolymorphicDowncast<const DepthwiseConvolution2dDescriptor *>(&descriptor); + auto desc = PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor); if (infos[3] == TensorInfo()) { FORWARD_LAYER_VALIDATE_FUNC(GpuFsaDepthwiseConvolution2dValidate, @@ -138,7 +152,7 @@ bool GpuFsaLayerSupport::IsLayerSupported(const LayerType& type, "TensorInfos should be of format: {input0, input1, output0}."); } - auto desc = PolymorphicDowncast<const ElementwiseBinaryDescriptor *>(&descriptor); + auto desc = PolymorphicDowncast<const ElementwiseBinaryDescriptor*>(&descriptor); if (desc->m_Operation == BinaryOperation::Add) { FORWARD_LAYER_VALIDATE_FUNC(GpuFsaElementwiseBinaryAddValidate, |