From 404462af4ca002ece819161a03a4bdb19a87abf2 Mon Sep 17 00:00:00 2001 From: Ramy Elgammal Date: Tue, 8 Nov 2022 02:14:46 +0000 Subject: Adding GpuAdd to dynamic fusion operators - Provide support for Add operator - Auto initialize the destination tensor before testing fusion in conv2d and elementwise binary ops. Resolves: COMPMID-5518 Signed-off-by: Ramy Elgammal Change-Id: Ibd815020f02b57f88eea7c2921bdcf98605d99c5 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8617 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Gunes Bayir Benchmark: Arm Jenkins --- .../dynamic_fusion/gpu/cl/DirectConv2dFixture.h | 36 ++++++++-------------- 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h') diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h index b0522488b4..e437c440d0 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h @@ -21,32 +21,23 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_TEST_DYNAMIC_FUSION_FIXTURE -#define ARM_COMPUTE_TEST_DYNAMIC_FUSION_FIXTURE +#ifndef TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_GPU_CL_DIRECTCONV2DFIXTURE +#define TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_GPU_CL_DIRECTCONV2DFIXTURE #include "arm_compute/core/CL/CLKernelLibrary.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" -#include "arm_compute/runtime/CL/CLScheduler.h" - #include "arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h" #include "arm_compute/dynamic_fusion/sketch/OperatorAttributes.h" #include "arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h" #include "arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h" -#include "src/gpu/cl/operators/ClAdd.h" -#include "src/gpu/cl/operators/ClConv2d.h" - #include "tests/CL/CLAccessor.h" - -#include "tests/framework/Asserts.h" #include "tests/framework/Fixture.h" #include "tests/framework/Macros.h" - #include "tests/validation/Validation.h" #include "tests/validation/reference/ConvolutionLayer.h" -#include "tests/validation/reference/ElementwiseOperations.h" #include "tests/validation/reference/Permute.h" using namespace arm_compute::experimental::dynamic_fusion; @@ -136,10 +127,10 @@ protected: tensor->allocator()->allocate(); // Use ACL allocated memory } // Construct user tensors - CLTensor t_input{}; - CLTensor t_weight{}; - CLTensor t_bias{}; - CLTensor t_dst{}; + TensorType t_input{}; + TensorType t_weight{}; + TensorType t_bias{}; + TensorType t_dst{}; // Initialize user tensors t_input.allocator()->init(input_info); @@ -152,9 +143,10 @@ protected: t_weight.allocator()->allocate(); t_bias.allocator()->allocate(); t_dst.allocator()->allocate(); - fill(CLAccessor(t_input), 0); - fill(CLAccessor(t_weight), 1); - fill(CLAccessor(t_bias), 2); + + fill(AccessorType(t_input), 0); + fill(AccessorType(t_weight), 1); + fill(AccessorType(t_bias), 2); // Run runtime runtime.run({ &t_input, &t_weight, &t_bias, &t_dst }); @@ -187,15 +179,11 @@ protected: TensorType _target{}; SimpleTensor _reference{}; DataType _data_type{}; - DataType _weights_data_type{}; DataType _bias_data_type{}; - DataType _output_data_type{}; DataLayout _data_layout{}; QuantizationInfo _quantization_info{}; QuantizationInfo _weight_quantization_info{}; bool _is_quantized = false; - bool _is_bfloat16 = false; - bool _mixed_layout = false; }; template @@ -207,10 +195,10 @@ public: const PadStrideInfo &info, const Size2D &dialation, DataType data_type, DataLayout data_layout, QuantizationInfo quantization_info) { DynamicFusionGpuConv2dValidationGenericFixture::setup(input_shape, weights_shape, output_shape, bias_shape, info, dialation, - data_type, data_layout, quantization_info, quantization_info); + data_type, data_layout, quantization_info, quantization_info); } }; } // namespace validation } // namespace test } // namespace arm_compute -#endif /* ARM_COMPUTE_TEST_DYNAMIC_FUSION_FIXTURE */ +#endif /* TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_GPU_CL_DIRECTCONV2DFIXTURE */ -- cgit v1.2.1