forked from hxim/paq8px
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMixerFactory.cpp
More file actions
28 lines (26 loc) · 884 Bytes
/
MixerFactory.cpp
File metadata and controls
28 lines (26 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "MixerFactory.hpp"
MixerFactory::MixerFactory(const Shared* const sh) : shared(sh) {}
Mixer* MixerFactory::createMixer(const int n, const int m, const int s, const int promoted) const {
const SIMDType chosenSimd = shared->chosenSimd;
if (chosenSimd == SIMDType::SIMD_NONE) {
return new Mixer_Scalar(shared, n, m, s, promoted);
}
#ifdef X64_SIMD_AVAILABLE
else if (chosenSimd == SIMDType::SIMD_SSE2) {
return new Mixer_SSE2(shared, n, m, s, promoted);
}
else if (chosenSimd == SIMDType::SIMD_AVX2) {
return new Mixer_AVX2(shared, n, m, s, promoted);
}
else if (chosenSimd == SIMDType::SIMD_AVX512) {
return new Mixer_AVX512(shared, n, m, s, promoted);
}
#endif
#ifdef ARM_NEON_AVAILABLE
else if (chosenSimd == SIMDType::SIMD_NEON) {
return new Mixer_Neon(shared, n, m, s, promoted);
}
#endif
assert(false);
return nullptr;
}