Browse Source

Added static variables to get template parameters in Vector classes.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
d434270da8
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      include/simd/vector.hpp

+ 6
- 0
include/simd/vector.hpp View File

@@ -30,6 +30,9 @@ struct Vector;
*/ */
template <> template <>
struct Vector<float, 4> { struct Vector<float, 4> {
typedef float T;
constexpr static int N = 4;

union { union {
__m128 v; __m128 v;
/** Accessing this array of scalars is slow and defeats the purpose of vectorizing. /** Accessing this array of scalars is slow and defeats the purpose of vectorizing.
@@ -96,6 +99,9 @@ struct Vector<float, 4> {


template <> template <>
struct Vector<int32_t, 4> { struct Vector<int32_t, 4> {
typedef int32_t T;
constexpr static int N = 4;

union { union {
__m128i v; __m128i v;
int32_t s[4]; int32_t s[4];


Loading…
Cancel
Save