From 5064cb7d5e75784b007d0b16b392134ae83e18d6 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Mon, 25 Nov 2024 22:27:26 -0800 Subject: [PATCH] Add test for using pcast on scalars. --- test/packetmath.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index e4d1b8c06..cdbaad672 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -199,6 +199,12 @@ struct test_cast_helper::cast(data1, DataSize, data2); VERIFY(test::areApprox(ref, data2, DataSize) && "internal::pcast<>"); + + // Test that pcast generates the same result. + for (int i = 0; i < DataSize; ++i) { + data2[i] = internal::pcast(data1[i]); + } + VERIFY(test::areApprox(ref, data2, DataSize) && "internal::pcast<>"); } }; @@ -1496,7 +1502,7 @@ struct exp_complex_test_impl { template struct exp_complex_test_impl { typedef typename Scalar::value_type RealScalar; - static void run(Scalar*, Scalar*, Scalar*, int){}; + static void run(Scalar*, Scalar*, Scalar*, int) {}; }; template