feat(tulip): implement some more SIMD
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#ifndef TULIP_SIMD_DISPATCH_HPP
|
||||
#define TULIP_SIMD_DISPATCH_HPP
|
||||
|
||||
#include "./config.hpp"
|
||||
|
||||
namespace tulip {
|
||||
namespace simd {
|
||||
namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct preferred_isa {
|
||||
using type = simd::scalar_isa;
|
||||
};
|
||||
|
||||
#ifdef TULIP_AVX2_SUPPORT
|
||||
template <>
|
||||
struct preferrpreferred_isa<float> {
|
||||
using type = simd::avx2_isa;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct preferrpreferred_isa<double> {
|
||||
using type = simd::avx2_isa;
|
||||
};
|
||||
#elif defined(TULIP_AVX_SUPPORT)
|
||||
template <>
|
||||
struct preferrpreferred_isa<float> {
|
||||
using type = simd::avx_isa;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
using preferred_isa_t = typename preferred_isa<T>::type;
|
||||
|
||||
} // namespace detail
|
||||
} // namespace simd
|
||||
} // namespace tulip
|
||||
|
||||
#endif // TULIP_SIMD_DISPATCH_HPP
|
||||
Reference in New Issue
Block a user