From 19600328cd5f2052c47ad37deb384d8f38ed7463 Mon Sep 17 00:00:00 2001 From: Guglielmo Gagliardi Date: Tue, 2 Jan 2024 11:40:52 +0100 Subject: [PATCH] test_blas_tile_extensione copy --- test/unit/test_blas_tile_extensions.cpp | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/unit/test_blas_tile_extensions.cpp b/test/unit/test_blas_tile_extensions.cpp index 4d9efa0ac6..f56d0978d8 100644 --- a/test/unit/test_blas_tile_extensions.cpp +++ b/test/unit/test_blas_tile_extensions.cpp @@ -65,3 +65,36 @@ TYPED_TEST(TileOperationsExtensionsTestGPU, Scal) { } } #endif + +// Tuple elements: m, n, k, extra_lda, extra_ldb, extra_ldc +std::vector> gemm_sizes = { + {0, 0, 0, 0, 0, 0}, // all 0 sizes + {7, 0, 0, 3, 1, 0}, {0, 5, 0, 0, 0, 1}, {0, 0, 11, 1, 1, 2}, // two 0 sizes + {0, 5, 13, 1, 0, 1}, {7, 0, 4, 1, 2, 0}, {3, 11, 0, 0, 1, 0}, // one 0 size + {1, 1, 1, 0, 3, 0}, {1, 12, 1, 1, 0, 7}, {17, 12, 16, 1, 3, 0}, {11, 23, 8, 0, 3, 4}, + {6, 9, 12, 1, 1, 1}, {32, 32, 32, 0, 0, 0}, {32, 32, 32, 4, 5, 7}, {128, 128, 128, 0, 0, 0}, +}; + +TYPED_TEST(TileOperationsExtensionsTestMC, Scal) { + using Type = TypeParam; + for (const auto& [m, n, k, extra_lda, extra_ldb, extra_ldc] : gemm_sizes) { + // Test a and b const Tiles. + dlaf::test::testScal(m, n, extra_lda); + // Test a and b non const Tiles. + dlaf::test::testScal(m, n, extra_lda); + } +} + +#ifdef DLAF_WITH_GPU +TYPED_TEST(TileOperationsExtensionsTestGPU, Scal) { + using Type = TypeParam; + + for (const auto& [m, n, k, extra_lda, extra_ldb, extra_ldc] : gemm_sizes) { + // Test a and b const Tiles. + dlaf::test::testScal(m, n, extra_lda); + + // Test a and b non const Tiles. + dlaf::test::testScal(m, n, extra_lda); + } +} +#endif