diff --git a/include/nlohmann/detail/input/simd_scan.hpp b/include/nlohmann/detail/input/simd_scan.hpp index ffff69f3e..ca62c4a19 100644 --- a/include/nlohmann/detail/input/simd_scan.hpp +++ b/include/nlohmann/detail/input/simd_scan.hpp @@ -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 diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 4167c8772..24a0ebaf4 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -12642,7 +12642,9 @@ NLOHMANN_JSON_NAMESPACE_END // 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