[flang-commits] [flang] [flang] match the actual data size with the KIND (NFC) (PR #73179)

via flang-commits flang-commits at lists.llvm.org
Wed Nov 22 14:18:12 PST 2023


https://github.com/kkwli created https://github.com/llvm/llvm-project/pull/73179

I think the intent is `uint8_t` instead of `uint16_t` to match `logical(1)`. Otherwise it needs to swap byte for the big endian environment.

I have a question regarding this test. What will the corresponding Fortran construct look like for `MatmulTranspose(result, *yLog, *vLog, ...)`? It seems that we are doing 
```
transpose(matrix( 3 by 2 )) * matrix( 1 by 3 )
```

>From cdbee62447c199d70d6d77fbf35fd5f5749a6c66 Mon Sep 17 00:00:00 2001
From: Kelvin Li <kli at ca.ibm.com>
Date: Wed, 22 Nov 2023 16:56:04 -0500
Subject: [PATCH] [flang] match the actual data size with the KIND (NFC)

---
 flang/unittests/Runtime/MatmulTranspose.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/unittests/Runtime/MatmulTranspose.cpp b/flang/unittests/Runtime/MatmulTranspose.cpp
index 2362887c414eccc..fe946f6d5a20129 100644
--- a/flang/unittests/Runtime/MatmulTranspose.cpp
+++ b/flang/unittests/Runtime/MatmulTranspose.cpp
@@ -206,7 +206,7 @@ TEST(MatmulTranspose, Basic) {
   auto yLog{MakeArray<TypeCategory::Logical, 2>(std::vector<int>{3, 2},
       std::vector<std::uint16_t>{false, false, false, true, true, false})};
   auto vLog{MakeArray<TypeCategory::Logical, 1>(
-      std::vector<int>{3}, std::vector<std::uint16_t>{true, false, true})};
+      std::vector<int>{3}, std::vector<std::uint8_t>{true, false, true})};
   RTNAME(MatmulTranspose)(result, *xLog, *yLog, __FILE__, __LINE__);
   ASSERT_EQ(result.rank(), 2);
   EXPECT_EQ(result.GetDimension(0).LowerBound(), 1);



More information about the flang-commits mailing list