Leave out the AVX2 dispatch with NVIDIA HPC

nvc++ defines __GNUC__, but its headers declare the AVX2 intrinsics only when
the translation unit is compiled for AVX2, so ci_nvhpc failed with undefined
_mm256_* identifiers.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-29 10:48:42 +01:00
1 parent d8abf6a861
commit fc2baa35b5
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -86,7 +86,9 @@
// to the lexer's string loop, and every translation unit has the same
// definitions. Not with MSVC (not measured), and not with GCC for Windows,
// which does not align the stack for spilled AVX registers (GCC bug 54412).
#if JSON_SCAN_SSE2 && !defined(NLOHMANN_JSON_NO_TARGET_ATTRIBUTE) && !(defined(_WIN32) && !defined(__clang__)) && ((defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && !defined(__cpp_modules)))
// Not with NVIDIA HPC (nvc++ defines __GNUC__ but declares the AVX2 intrinsics
// only when the translation unit is compiled for AVX2).
#if JSON_SCAN_SSE2 && !defined(NLOHMANN_JSON_NO_TARGET_ATTRIBUTE) && !defined(__NVCOMPILER) && !(defined(_WIN32) && !defined(__clang__)) && ((defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && !defined(__cpp_modules)))
#ifndef NLOHMANN_JSON_CPUID_INCLUDED
#define NLOHMANN_JSON_CPUID_INCLUDED
#include <cpuid.h>