mirror of https://github.com/AxioDL/zeus.git
GCC simd fix
This commit is contained in:
parent
2041ec3156
commit
31b437e784
|
@ -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 <class _Tp>
|
||||
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 _Tp, class _Abi = simd_abi::compatible<_Tp>>
|
||||
class simd;
|
||||
|
@ -1280,9 +1280,10 @@ public:
|
|||
|
||||
// generator constructor
|
||||
template <class _Generator,
|
||||
int = typename std::enable_if<__can_generate<_Generator>(std::make_index_sequence<size()>()), int>::type()>
|
||||
int = typename std::enable_if<__can_generate<_Generator>(
|
||||
std::make_index_sequence<simd_size<_Tp, _Abi>::value>()), int>::type()>
|
||||
explicit simd(_Generator&& __g) {
|
||||
__generator_init(std::forward<_Generator>(__g), std::make_index_sequence<size()>());
|
||||
__generator_init(std::forward<_Generator>(__g), std::make_index_sequence<simd_size<_Tp, _Abi>::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
|
||||
|
|
|
@ -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 <typename T>
|
||||
struct zeus_native {};
|
||||
struct athena_native {};
|
||||
template <>
|
||||
struct zeus_native<float> {
|
||||
struct athena_native<float> {
|
||||
using type = fixed_size<4>;
|
||||
};
|
||||
template <>
|
||||
struct zeus_native<double> {
|
||||
struct athena_native<double> {
|
||||
using type = fixed_size<4>;
|
||||
};
|
||||
} // namespace simd_abi
|
||||
#endif
|
||||
namespace zeus {
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
namespace athena {
|
||||
template <typename T>
|
||||
using simd = _simd::simd<T, typename _simd::simd_abi::zeus_native<T>::type>;
|
||||
using simd = _simd::simd<T, typename _simd::simd_abi::athena_native<T>::type>;
|
||||
template <typename T>
|
||||
using simd_values = _simd::simd_data<simd<T>>;
|
||||
using simd_floats = simd_values<float>;
|
||||
using simd_doubles = simd_values<double>;
|
||||
} // namespace zeus
|
||||
} // namespace athena
|
||||
|
|
Loading…
Reference in New Issue