Remove int support for SimdArrayRef
authorRoland Schulz <roland.schulz@intel.com>
Wed, 13 Dec 2017 16:45:14 +0000 (08:45 -0800)
committerRoland Schulz <roland.schulz@intel.com>
Wed, 13 Dec 2017 16:45:14 +0000 (08:45 -0800)
Keep int tests for better SimdArrayRef test coverage.

Change-Id: Ic5234fbfe11c5fe427ec57e4fdba915c9197c07c

src/gromacs/simd/simd_memory.h
src/gromacs/simd/tests/simd_memory.cpp

index aeae0cd5f940510b76408bf6aa83e778bcbba5e8..89a5d64eb7976f12b18b3283ca048aa0be80d7d5 100644 (file)
@@ -270,18 +270,6 @@ class ArrayRef<const SimdFloat> : public internal::SimdArrayRef<const SimdFloat>
     using Base = internal::SimdArrayRef<const SimdFloat>;
     using Base::Base;
 };
-template<>
-class ArrayRef<SimdFInt32> : public internal::SimdArrayRef<SimdFInt32>
-{
-    using Base = internal::SimdArrayRef<SimdFInt32>;
-    using Base::Base;
-};
-template<>
-class ArrayRef<const SimdFInt32> : public internal::SimdArrayRef<const SimdFInt32>
-{
-    using Base = internal::SimdArrayRef<const SimdFInt32>;
-    using Base::Base;
-};
 #endif
 #if GMX_SIMD_HAVE_DOUBLE
 template<>
@@ -296,18 +284,6 @@ class ArrayRef<const SimdDouble> : public internal::SimdArrayRef<const SimdDoubl
     using Base = internal::SimdArrayRef<const SimdDouble>;
     using Base::Base;
 };
-template<>
-class ArrayRef<SimdDInt32> : public internal::SimdArrayRef<SimdDInt32>
-{
-    using Base = internal::SimdArrayRef<SimdDInt32>;
-    using Base::Base;
-};
-template<>
-class ArrayRef<const SimdDInt32> : public internal::SimdArrayRef<const SimdDInt32>
-{
-    using Base = internal::SimdArrayRef<const SimdDInt32>;
-    using Base::Base;
-};
 #endif
 
 } // namespace gmx
index 55b1893adf2832e0500d7b5a9f9f87924a23f5c3..8af562fe9f94c3395fcc315ff08b6729839580ab 100644 (file)
 namespace gmx
 {
 
-namespace
+#if GMX_SIMD_HAVE_REAL
+
+/* SimdInt32 is a strange type which would never belong in an interface,
+ * because its properties are peculiar to int-to-float conversions within
+ * SIMD types, so there is no need to support it as a specialization of
+ * SimdArrayRef. But it is useful here for better test coverage of
+ * SimdArrayRef. */
+
+template<>
+class ArrayRef<SimdInt32> : public internal::SimdArrayRef<SimdInt32>
 {
+    using Base = internal::SimdArrayRef<SimdInt32>;
+    using Base::Base;
+};
+template<>
+class ArrayRef<const SimdInt32> : public internal::SimdArrayRef<const SimdInt32>
+{
+    using Base = internal::SimdArrayRef<const SimdInt32>;
+    using Base::Base;
+};
 
-#if GMX_SIMD_HAVE_REAL
+namespace
+{
 
 TEST(EmptyArrayRefTest, IsEmpty)
 {
@@ -222,8 +241,8 @@ TYPED_TEST(ArrayRefArithmeticTest, Basic)
 
 #endif // GTEST_HAS_TYPED_TEST
 
-#endif // GMX_HAVE_SIMD_REAL
-
 }      // namespace
 
-}      // namespace
+#endif // GMX_HAVE_SIMD_REAL
+
+}      // namespace gmx