From 856f66e6c61b77d03f754cd0fa8439891f0e4aca Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 22 Apr 2021 21:13:21 +0100 Subject: Port CLGEMM to memory injecting interface Moves the following kernels: - CLGEMMMatrixMultiplyKernel - CLGEMMMatrixMultiplyNativeKernel - CLGEMMMatrixMultipluReshapedKernel - CLGEMMMatrixMultiplyReshapedOnlyRHSKernel Moves the following functions - CLGEMM Introduces facilities to easy handling of auxiliary temporary buffers under then new run interface. Such are: - CLAuxTensorHandler: That allows wrapping of workspace buffers memory to CLBuffer objects - Ability to inject TensorInfo to allocator without transferring ownership. This reduce the copy overhead if needed. Resolves: COMPMID-4188 Signed-off-by: Georgios Pinitas Change-Id: I7055435d831b05b749b26302082e4ac45f26dfb0 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5498 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins --- tests/validation/CL/GEMMMatrixMultiplyReshaped.cpp | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'tests/validation/CL/GEMMMatrixMultiplyReshaped.cpp') diff --git a/tests/validation/CL/GEMMMatrixMultiplyReshaped.cpp b/tests/validation/CL/GEMMMatrixMultiplyReshaped.cpp index 52afb716e4..6f368a9650 100644 --- a/tests/validation/CL/GEMMMatrixMultiplyReshaped.cpp +++ b/tests/validation/CL/GEMMMatrixMultiplyReshaped.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,9 +26,9 @@ #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTensorAllocator.h" -#include "src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.h" -#include "src/core/CL/kernels/CLGEMMReshapeLHSMatrixKernel.h" -#include "src/core/CL/kernels/CLGEMMReshapeRHSMatrixKernel.h" +#include "src/core/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedKernel.h" +#include "src/core/gpu/cl/kernels/ClGemmReshapeLhsMatrixKernel.h" +#include "src/core/gpu/cl/kernels/ClGemmReshapeRhsMatrixKernel.h" #include "tests/CL/CLAccessor.h" #include "tests/CL/Helper.h" #include "tests/PaddingCalculator.h" @@ -46,15 +46,16 @@ namespace test namespace validation { using namespace arm_compute::misc::shape_calculator; +using namespace arm_compute::opencl::kernels; -// Create function for CLGEMMReshapeLHSMatrixKernel -using CLGEMMReshapeLHSMatrix = CLSynthetizeFunction; +// Create function for ClGemmReshapeLhsMatrixKernel +using CLGEMMReshapeLHSMatrix = CLSynthetizeOperator; -// Create function for CLGEMMReshapeRHSMatrixKernel -using CLGEMMReshapeRHSMatrix = CLSynthetizeFunction; +// Create function for ClGemmReshapeRhsMatrixKernel +using CLGEMMReshapeRHSMatrix = CLSynthetizeOperator; -// Create function for CLGEMMMatrixMultiplyReshapedKernel -using CLGEMMMatrixMultiplyReshaped = CLSynthetizeFunction; +// Create function for ClGemmMatrixMultiplyReshapedKernel +using CLGEMMMatrixMultiplyReshaped = CLSynthetizeOperator; // Fixture for CLGEMMMatrixMultiplyReshaped template @@ -327,7 +328,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi framework::dataset::make("Expected", { true, true, false, false, false, true, true,true})), input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected) { - ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), + ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), &input1_info.clone()->set_is_resizable(true), &input2_info.clone()->set_is_resizable(true), &output_info.clone()->set_is_resizable(true),1.f,1.f, @@ -562,7 +563,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi false})), input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected) { - ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), + ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), &input1_info.clone()->set_is_resizable(true), &input2_info.clone()->set_is_resizable(true), &output_info.clone()->set_is_resizable(true),1.f,1.f, @@ -933,7 +934,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi false})), input0_info ,input1_info, input2_info, output_info, lhs_info, rhs_info, gemm_info, expected) { - ARM_COMPUTE_EXPECT(bool(CLGEMMMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), + ARM_COMPUTE_EXPECT(bool(ClGemmMatrixMultiplyReshapedKernel::validate(&input0_info.clone()->set_is_resizable(true), &input1_info.clone()->set_is_resizable(true), &input2_info.clone()->set_is_resizable(true), &output_info.clone()->set_is_resizable(true),1.f,1.f, -- cgit v1.2.1