aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Sujak <jakub.sujak@arm.com>2023-04-13 21:14:42 +0100
committerJakub Sujak <jakub.sujak@arm.com>2023-04-14 10:36:42 +0000
commit1ed6a144b1396297b813457016d545af1bb9d823 (patch)
treecb3516b7103c22d76ea03021355bdf293fa32061
parent9b0a6b49e95b221456489dd7c58681ceca5dd8cb (diff)
downloadComputeLibrary-1ed6a144b1396297b813457016d545af1bb9d823.tar.gz
Align naming convention of ClMatMul
Ensure naming of MatMul on GPU conforms to the naming convention <backend><operator><config> i.e. ClMatMul operator with the backend ClMatMulNativeKernel. Resolves: COMPMID-6015 Change-Id: I021d235b023ad17fe97bd6913e6a50d0ba4b194e Signed-off-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9443 Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--Android.bp2
-rw-r--r--filelist.json2
-rw-r--r--src/gpu/cl/kernels/ClMatMulNativeKernel.cpp (renamed from src/gpu/cl/kernels/ClNativeMatMulKernel.cpp)10
-rw-r--r--src/gpu/cl/kernels/ClMatMulNativeKernel.h (renamed from src/gpu/cl/kernels/ClNativeMatMulKernel.h)14
-rw-r--r--src/gpu/cl/operators/ClMatMul.cpp6
-rw-r--r--src/gpu/cl/operators/ClMatMul.h6
-rw-r--r--tests/validation/CL/MatMulKernel.cpp10
-rw-r--r--tests/validation/fixtures/MatMulKernelFixture.h4
8 files changed, 27 insertions, 27 deletions
diff --git a/Android.bp b/Android.bp
index e38ea65d55..4bd307447b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -695,8 +695,8 @@ cc_library_static {
"src/gpu/cl/kernels/ClIm2ColKernel.cpp",
"src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp",
"src/gpu/cl/kernels/ClIndirectConv2dKernel.cpp",
+ "src/gpu/cl/kernels/ClMatMulNativeKernel.cpp",
"src/gpu/cl/kernels/ClMulKernel.cpp",
- "src/gpu/cl/kernels/ClNativeMatMulKernel.cpp",
"src/gpu/cl/kernels/ClPermuteKernel.cpp",
"src/gpu/cl/kernels/ClPool2dKernel.cpp",
"src/gpu/cl/kernels/ClPool3dKernel.cpp",
diff --git a/filelist.json b/filelist.json
index cf1c63b883..5418c2bfd0 100644
--- a/filelist.json
+++ b/filelist.json
@@ -512,7 +512,7 @@
"MatMul": {
"files": {
"common": [
- "src/gpu/cl/kernels/ClNativeMatMulKernel.cpp",
+ "src/gpu/cl/kernels/ClMatMulNativeKernel.cpp",
"src/gpu/cl/operators/ClMatMul.cpp",
"src/runtime/CL/functions/CLMatMul.cpp"
]
diff --git a/src/gpu/cl/kernels/ClNativeMatMulKernel.cpp b/src/gpu/cl/kernels/ClMatMulNativeKernel.cpp
index c1f150d7aa..47dba22e8f 100644
--- a/src/gpu/cl/kernels/ClNativeMatMulKernel.cpp
+++ b/src/gpu/cl/kernels/ClMatMulNativeKernel.cpp
@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#include "src/gpu/cl/kernels/ClNativeMatMulKernel.h"
+#include "src/gpu/cl/kernels/ClMatMulNativeKernel.h"
#include "arm_compute/core/CL/CLHelpers.h"
#include "arm_compute/core/CL/ICLTensor.h"
@@ -115,11 +115,11 @@ Status validate_export_to_cl_image(const ITensorInfo *rhs, const MatMulKernelInf
return Status {};
}
}
-ClNativeMatMulKernel::ClNativeMatMulKernel()
+ClMatMulNativeKernel::ClMatMulNativeKernel()
{
_type = CLKernelType::GEMM;
}
-Status ClNativeMatMulKernel::validate(const ITensorInfo *lhs, const ITensorInfo *rhs, const ITensorInfo *output, const MatMulKernelInfo &matmul_kernel_info)
+Status ClMatMulNativeKernel::validate(const ITensorInfo *lhs, const ITensorInfo *rhs, const ITensorInfo *output, const MatMulKernelInfo &matmul_kernel_info)
{
ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(lhs, rhs, output);
ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(lhs, 1, DataType::F32, DataType::F16);
@@ -137,7 +137,7 @@ Status ClNativeMatMulKernel::validate(const ITensorInfo *lhs, const ITensorInfo
return Status{};
}
-void ClNativeMatMulKernel::configure(const ClCompileContext &compile_context, ITensorInfo *lhs, ITensorInfo *rhs, ITensorInfo *output, const MatMulKernelInfo &matmul_kernel_info)
+void ClMatMulNativeKernel::configure(const ClCompileContext &compile_context, ITensorInfo *lhs, ITensorInfo *rhs, ITensorInfo *output, const MatMulKernelInfo &matmul_kernel_info)
{
ARM_COMPUTE_ERROR_ON_NULLPTR(lhs, rhs, output, &compile_context, &matmul_kernel_info);
ARM_COMPUTE_LOG_PARAMS(lhs, rhs, output, matmul_kernel_info);
@@ -212,7 +212,7 @@ void ClNativeMatMulKernel::configure(const ClCompileContext &compile_context, IT
_config_id += support::cpp11::to_string(matmul_kernel_info.k0);
}
-void ClNativeMatMulKernel::run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue)
+void ClMatMulNativeKernel::run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue)
{
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(ICLKernel::window(), window);
diff --git a/src/gpu/cl/kernels/ClNativeMatMulKernel.h b/src/gpu/cl/kernels/ClMatMulNativeKernel.h
index 3d0f18ec84..50aa3b70e4 100644
--- a/src/gpu/cl/kernels/ClNativeMatMulKernel.h
+++ b/src/gpu/cl/kernels/ClMatMulNativeKernel.h
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ACL_SRC_GPU_CL_KERNELS_CLNATIVEMATMULKERNEL
-#define ACL_SRC_GPU_CL_KERNELS_CLNATIVEMATMULKERNEL
+#ifndef ACL_SRC_GPU_CL_KERNELS_CLMATMULNATIVEKERNEL
+#define ACL_SRC_GPU_CL_KERNELS_CLMATMULNATIVEKERNEL
#include "arm_compute/core/KernelDescriptors.h"
#include "src/core/common/Macros.h"
@@ -35,11 +35,11 @@ namespace opencl
{
namespace kernels
{
-class ClNativeMatMulKernel : public IClKernel
+class ClMatMulNativeKernel : public IClKernel
{
public:
- ClNativeMatMulKernel();
- ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE(ClNativeMatMulKernel);
+ ClMatMulNativeKernel();
+ ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE(ClMatMulNativeKernel);
/** Initialise the kernel's input and output.
*
* @param[in] compile_context The compile context to be used.
@@ -53,7 +53,7 @@ public:
void configure(const ClCompileContext &compile_context, ITensorInfo *lhs, ITensorInfo *rhs, ITensorInfo *output, const MatMulKernelInfo &matmul_info);
/** Static function to check if given info will lead to a valid configuration
*
- * Similar to @ref ClNativeMatMulKernel::configure()
+ * Similar to @ref ClMatMulNativeKernel::configure()
*
* @return a status
*/
@@ -68,4 +68,4 @@ private:
} // namespace kernels
} // namespace opencl
} // namespace arm_compute
-#endif /* ACL_SRC_GPU_CL_KERNELS_CLNATIVEMATMULKERNEL */
+#endif /* ACL_SRC_GPU_CL_KERNELS_CLMATMULNATIVEKERNEL */
diff --git a/src/gpu/cl/operators/ClMatMul.cpp b/src/gpu/cl/operators/ClMatMul.cpp
index dadaa1f779..3ad6d914c7 100644
--- a/src/gpu/cl/operators/ClMatMul.cpp
+++ b/src/gpu/cl/operators/ClMatMul.cpp
@@ -25,7 +25,7 @@
#include "arm_compute/core/Error.h"
#include "arm_compute/runtime/CL/CLScheduler.h"
#include "src/common/utils/Log.h"
-#include "src/gpu/cl/kernels/ClNativeMatMulKernel.h"
+#include "src/gpu/cl/kernels/ClMatMulNativeKernel.h"
namespace arm_compute
{
@@ -33,7 +33,7 @@ namespace opencl
{
using namespace arm_compute::opencl::kernels;
ClMatMul::ClMatMul()
- : _native_matmul_kernel(std::make_unique<ClNativeMatMulKernel>())
+ : _native_matmul_kernel(std::make_unique<ClMatMulNativeKernel>())
{
}
ClMatMul::~ClMatMul()
@@ -44,7 +44,7 @@ Status ClMatMul::validate(const ITensorInfo *lhs, const ITensorInfo *rhs, const
MatMulKernelInfo kernel_info;
kernel_info.adj_lhs = matmul_info.adj_lhs();
kernel_info.adj_rhs = matmul_info.adj_rhs();
- return ClNativeMatMulKernel::validate(lhs, rhs, output, kernel_info);
+ return ClMatMulNativeKernel::validate(lhs, rhs, output, kernel_info);
}
void ClMatMul::configure(const CLCompileContext &compile_context, ITensorInfo *lhs, ITensorInfo *rhs, ITensorInfo *output, const MatMulInfo &matmul_info)
{
diff --git a/src/gpu/cl/operators/ClMatMul.h b/src/gpu/cl/operators/ClMatMul.h
index 894b8d5816..20beda91ce 100644
--- a/src/gpu/cl/operators/ClMatMul.h
+++ b/src/gpu/cl/operators/ClMatMul.h
@@ -25,7 +25,7 @@
#define ARM_COMPUTE_SRC_GPU_CL_OPERATORS_ClMatMul
#include "src/gpu/cl/IClOperator.h"
-#include "src/gpu/cl/kernels/ClNativeMatMulKernel.h"
+#include "src/gpu/cl/kernels/ClMatMulNativeKernel.h"
#include <memory>
namespace arm_compute
@@ -34,7 +34,7 @@ namespace opencl
{
/** Basic operator to execute BatchMatMul on OpenCL. This operator calls the following OpenCL kernels:
*
- * -# @ref kernels::ClNativeMatMulKernel
+ * -# @ref kernels::ClMatMulNativeKernel
*/
class ClMatMul : public IClOperator
{
@@ -77,7 +77,7 @@ public:
void run(ITensorPack &tensors) override;
private:
- std::unique_ptr<kernels::ClNativeMatMulKernel> _native_matmul_kernel;
+ std::unique_ptr<kernels::ClMatMulNativeKernel> _native_matmul_kernel;
};
} // namespace opencl
} // namespace arm_compute
diff --git a/tests/validation/CL/MatMulKernel.cpp b/tests/validation/CL/MatMulKernel.cpp
index 962542400e..9c19e42d04 100644
--- a/tests/validation/CL/MatMulKernel.cpp
+++ b/tests/validation/CL/MatMulKernel.cpp
@@ -23,7 +23,7 @@
*/
#include "arm_compute/runtime/CL/CLTensor.h"
-#include "src/gpu/cl/kernels/ClNativeMatMulKernel.h"
+#include "src/gpu/cl/kernels/ClMatMulNativeKernel.h"
#include "tests/datasets/LargeMatMulDataset.h"
#include "tests/datasets/SmallMatMulDataset.h"
#include "tests/framework/Macros.h"
@@ -162,7 +162,7 @@ TEST_CASE(SupportedBlockSizes, framework::DatasetMode::ALL)
for(auto &pair : supported_block_sizes)
{
TensorInfo output_info;
- Status status = ClNativeMatMulKernel::validate(&lhs_info, &rhs_info, &output_info, pair.first);
+ Status status = ClMatMulNativeKernel::validate(&lhs_info, &rhs_info, &output_info, pair.first);
if(!pair.first.export_rhs_to_cl_image || export_to_cl_image_supported)
{
@@ -219,7 +219,7 @@ TEST_CASE(ExportToCLImage, framework::DatasetMode::ALL)
const MatMulKernelInfo matmul_kernel_info {adj_lhs, adj_rhs, 4, 4, 4, true /* export_rhs_to_cl_image */};
TensorInfo output_info;
- Status status = ClNativeMatMulKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
+ Status status = ClMatMulNativeKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
const bool expected = std::get<4>(tuple);
ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS);
@@ -276,7 +276,7 @@ TEST_CASE(ValidateInputShapes, framework::DatasetMode::ALL)
MatMulKernelInfo matmul_kernel_info{ adj_lhs, adj_rhs, 1, 1, 1, false /* export_rhs_to_cl_image */ };
- Status status = ClNativeMatMulKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
+ Status status = ClMatMulNativeKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS);
}
}
@@ -319,7 +319,7 @@ TEST_CASE(ValidateDataTypes, framework::DatasetMode::ALL)
const TensorInfo rhs_info(shape, 1, std::get<1>(tuple));
TensorInfo output_info(shape, 1, std::get<2>(tuple));
- Status status = ClNativeMatMulKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
+ Status status = ClMatMulNativeKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS);
}
}
diff --git a/tests/validation/fixtures/MatMulKernelFixture.h b/tests/validation/fixtures/MatMulKernelFixture.h
index c131fea7fa..10e2a0659a 100644
--- a/tests/validation/fixtures/MatMulKernelFixture.h
+++ b/tests/validation/fixtures/MatMulKernelFixture.h
@@ -25,7 +25,7 @@
#define ACL_TESTS_VALIDATION_FIXTURES_MATMULKERNELFIXTURE
#include "arm_compute/core/KernelDescriptors.h"
-#include "src/gpu/cl/kernels/ClNativeMatMulKernel.h"
+#include "src/gpu/cl/kernels/ClMatMulNativeKernel.h"
#include "tests/CL/CLAccessor.h"
#include "tests/CL/Helper.h"
#include "tests/framework/Fixture.h"
@@ -101,7 +101,7 @@ protected:
CLTensor b = create_tensor<CLTensor>(shape_b, data_type, 1);
CLTensor dst = create_tensor<CLTensor>(output_shape, data_type, 1);
- CLSynthetizeOperator<ClNativeMatMulKernel> matMul{};
+ CLSynthetizeOperator<ClMatMulNativeKernel> matMul{};
MatMulKernelInfo matmul_info;
matmul_info.adj_lhs = pretranspose_a;
matmul_info.adj_rhs = pretranspose_b;