diff options
Diffstat (limited to 'third_party/xsimd/include/xsimd/types/xsimd_generic_arch.hpp')
-rw-r--r-- | third_party/xsimd/include/xsimd/types/xsimd_generic_arch.hpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/third_party/xsimd/include/xsimd/types/xsimd_generic_arch.hpp b/third_party/xsimd/include/xsimd/types/xsimd_generic_arch.hpp new file mode 100644 index 0000000000..f4a2ca6aad --- /dev/null +++ b/third_party/xsimd/include/xsimd/types/xsimd_generic_arch.hpp @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and * + * Martin Renou * + * Copyright (c) QuantStack * + * Copyright (c) Serge Guelton * + * * + * Distributed under the terms of the BSD 3-Clause License. * + * * + * The full license is in the file LICENSE, distributed with this software. * + ****************************************************************************/ + +#ifndef XSIMD_GENERIC_ARCH_HPP +#define XSIMD_GENERIC_ARCH_HPP + +#include "../config/xsimd_config.hpp" + +/** + * @defgroup architectures Architecture description + * */ +namespace xsimd +{ + /** + * @ingroup architectures + * + * Base class for all architectures. + */ + struct generic + { + /// Whether this architecture is supported at compile-time. + static constexpr bool supported() noexcept { return true; } + /// Whether this architecture is available at run-time. + static constexpr bool available() noexcept { return true; } + /// If this architectures supports aligned memory accesses, the required + /// alignment. + static constexpr std::size_t alignment() noexcept { return 0; } + /// Whether this architecture requires aligned memory access. + static constexpr bool requires_alignment() noexcept { return false; } + /// Unique identifier for this architecture. + static constexpr unsigned version() noexcept { return generic::version(0, 0, 0); } + /// Name of the architecture. + static constexpr char const* name() noexcept { return "generic"; } + + protected: + static constexpr unsigned version(unsigned major, unsigned minor, unsigned patch, unsigned multiplier = 100u) noexcept { return major * multiplier * multiplier + minor * multiplier + patch; } + }; + + struct unsupported + { + }; +} + +#endif |