From 31b437e784c1086f098690b53402b0446aff6320 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 15 Feb 2019 15:31:42 -1000 Subject: [PATCH] GCC simd fix --- include/zeus/simd/parallelism_v2_simd.hpp | 17 +++++++++-------- include/zeus/simd/simd.hpp | 23 +++++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/include/zeus/simd/parallelism_v2_simd.hpp b/include/zeus/simd/parallelism_v2_simd.hpp index b179b1e..5004a05 100644 --- a/include/zeus/simd/parallelism_v2_simd.hpp +++ b/include/zeus/simd/parallelism_v2_simd.hpp @@ -659,7 +659,7 @@ public: #pragma GCC system_header #endif -namespace zeus::_simd { +namespace athena::_simd { enum class _StorageKind { _Scalar, @@ -837,8 +837,8 @@ constexpr bool __vectorizable() { !std::is_same<_Tp, bool>::value; } -} // namespace zeus::_simd -namespace zeus::_simd::simd_abi { +} // namespace athena::_simd +namespace athena::_simd::simd_abi { using scalar = __simd_abi<_StorageKind::_Scalar, 1>; @@ -851,8 +851,8 @@ inline constexpr size_t max_fixed_size = 32; template using compatible = fixed_size<16 / sizeof(_Tp)>; -} // namespace zeus::_simd::simd_abi -namespace zeus::_simd { +} // namespace athena::_simd::simd_abi +namespace athena::_simd { template > class simd; @@ -1280,9 +1280,10 @@ public: // generator constructor template (std::make_index_sequence()), int>::type()> + int = typename std::enable_if<__can_generate<_Generator>( + std::make_index_sequence::value>()), int>::type()> explicit simd(_Generator&& __g) { - __generator_init(std::forward<_Generator>(__g), std::make_index_sequence()); + __generator_init(std::forward<_Generator>(__g), std::make_index_sequence::value>()); } // load constructor @@ -1527,4 +1528,4 @@ public: void __set(size_t __index, bool __val) noexcept { __storage_.set(__index, __val); } }; -} // namespace zeus::_simd +} // namespace athena::_simd diff --git a/include/zeus/simd/simd.hpp b/include/zeus/simd/simd.hpp index 1d47f4c..c0d9577 100644 --- a/include/zeus/simd/simd.hpp +++ b/include/zeus/simd/simd.hpp @@ -1,6 +1,10 @@ #pragma once -#define _ZEUS_SIMD_INCLUDED -namespace zeus::_simd { +#define _ATHENA_SIMD_INCLUDED +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wignored-attributes" +#endif +namespace athena::_simd { using namespace std; } #include "parallelism_v2_simd.hpp" @@ -14,22 +18,25 @@ using namespace std; #else namespace simd_abi { template -struct zeus_native {}; +struct athena_native {}; template <> -struct zeus_native { +struct athena_native { using type = fixed_size<4>; }; template <> -struct zeus_native { +struct athena_native { using type = fixed_size<4>; }; } // namespace simd_abi #endif -namespace zeus { +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +namespace athena { template -using simd = _simd::simd::type>; +using simd = _simd::simd::type>; template using simd_values = _simd::simd_data>; using simd_floats = simd_values; using simd_doubles = simd_values; -} // namespace zeus +} // namespace athena