AVX-512 First Attempt
This commit is contained in:
committed by
Linus Baumberger
parent
174d167b9a
commit
7b3d554117
@@ -1,6 +1,3 @@
|
||||
// # Replaced Vector2d with double
|
||||
// # Predecessor: board.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
struct Obstacle {
|
||||
|
||||
+16
-1
@@ -2,6 +2,10 @@
|
||||
#include <cmath>
|
||||
#include <new>
|
||||
|
||||
#ifdef __x86_64__
|
||||
#include "immintrin.h"
|
||||
#endif
|
||||
|
||||
//
|
||||
// $\frac{1}{\tau_{\alpha}}$; $\tau_{\alpha} = 0.5s$
|
||||
//
|
||||
@@ -96,10 +100,21 @@ const double EPS = 1e-9;
|
||||
// Squared numerical tolerance
|
||||
const double EPS_SQ = EPS * EPS;
|
||||
|
||||
#ifdef __AVX512F__
|
||||
const __m512d LN2_VEC = _mm512_set1_pd(log(2));
|
||||
const __m512d ZERO_VEC = _mm512_setzero_pd();
|
||||
const __m512d NEG_TWO_SIGMA_INV_VEC = _mm512_set1_pd(NEG_TWO_SIGMA_INV);
|
||||
const __m512d NEG_V0_AB_DIV_TWO_SIGMA_VEC = _mm512_set1_pd(NEG_V0_AB_div_TWO_SIGMA);
|
||||
const __m512d c_neg_times_dt_vec = _mm512_set1_pd(c_neg_times_dt);
|
||||
const __m512d cos_phi_inv_vec = _mm512_set1_pd(cos_phi_inv);
|
||||
const __m512d dt_neg_vec = _mm512_set1_pd(dt_neg);
|
||||
#endif
|
||||
|
||||
// Cutoff for pedestrian-pedestrian repulsion
|
||||
const double CUTOFF = 12.0;
|
||||
const double CUTOFF_SQ = CUTOFF * CUTOFF;
|
||||
|
||||
|
||||
const double cos_phi_sq = cos_phi * cos_phi;
|
||||
|
||||
const size_t CACHE_BLOCK_SIZE = std::hardware_destructive_interference_size;
|
||||
const size_t CACHE_BLOCK_SIZE = std::hardware_destructive_interference_size;
|
||||
|
||||
Reference in New Issue
Block a user