From 886bb14299a6a8f65f382f89e86a743d72fd4039 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 20 Jan 2025 10:00:15 +0100 Subject: [PATCH] avx512 - const operator[] for SIMD<8, double> --- libsrc/core/simd_avx512.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsrc/core/simd_avx512.hpp b/libsrc/core/simd_avx512.hpp index 490ffed1..e0ae97b5 100644 --- a/libsrc/core/simd_avx512.hpp +++ b/libsrc/core/simd_avx512.hpp @@ -61,6 +61,7 @@ namespace ngcore NETGEN_INLINE auto operator[] (int i) const { return ((int64_t*)(&data))[i]; } + NETGEN_INLINE auto & operator[] (int i) { return ((int64_t*)(&data))[i]; } NETGEN_INLINE __m512i Data() const { return data; } NETGEN_INLINE __m512i & Data() { return data; } static SIMD FirstInt() { return { 0, 1, 2, 3, 4, 5, 6, 7 }; } @@ -132,6 +133,7 @@ namespace ngcore } NETGEN_INLINE double operator[] (int i) const { return ((double*)(&data))[i]; } + NETGEN_INLINE double & operator[] (int i) { return ((double*)(&data))[i]; } NETGEN_INLINE __m512d Data() const { return data; } NETGEN_INLINE __m512d & Data() { return data; }