Skip to content

Commit

Permalink
Fix small bug with compiler identification
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinzii committed Mar 12, 2024
1 parent 44b97f3 commit 383aff7
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions include/ccmath/internal/setup/compiler_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/// !!! ATTENTION !!!


#if defined(__GNUC__) && !defined(CCMATH_COMPILER_GCC)
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(CCMATH_COMPILER_GCC)
#define CCMATH_COMPILER_GCC
#define CCMATH_COMPILER_GCC_VER ((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__)
#define CCMATH_COMPILER_GCC_VER_MAJOR __GNUC__
Expand Down Expand Up @@ -89,7 +89,7 @@
#endif

// Intel DPC++ Compiler
#if defined(SYCL_LANGUAGE_VERSION) && defined (__INTEL_LLVM_COMPILER)
#if defined(SYCL_LANGUAGE_VERSION) || defined(__INTEL_LLVM_COMPILER)
#define CCMATH_COMPILER_INTEL
#define CCMATH_COMPILER_INTEL_VER __INTEL_LLVM_COMPILER

Expand All @@ -102,16 +102,13 @@
#endif

// Nvidia HPC SDK
#if defined(__NVCOMPILER) || defined(__NVCOMPILER_LLVM__) && !defined(CCMATH_USING_CLANG_BASED_COMPILER)
#define CCMATH_COMPILER_NVIDIA
#define CCMATH_COMPILER_NVIDIA_VER (__NVCOMPILER_MAJOR__ * 10000 + __NVCOMPILER_MINOR__ * 100 + __NVCOMPILER_PATCHLEVEL__)
#define CCMATH_COMPILER_NVIDIA_VER_MAJOR __NVCOMPILER_MAJOR__
#define CCMATH_COMPILER_NVIDIA_VER_MINOR __NVCOMPILER_MINOR__
#define CCMATH_COMPILER_NVIDIA_VER_PATCH __NVCOMPILER_PATCHLEVEL__
#if defined(__NVCOMPILER) || defined(__NVCOMPILER_LLVM__)
#define CCMATH_COMPILER_NVIDIA_HPC
#define CCMATH_COMPILER_NVIDIA_HPC_VER (__NVCOMPILER_MAJOR__ * 10000 + __NVCOMPILER_MINOR__ * 100 + __NVCOMPILER_PATCHLEVEL__)
#define CCMATH_COMPILER_NVIDIA_HPC_VER_MAJOR __NVCOMPILER_MAJOR__
#define CCMATH_COMPILER_NVIDIA_HPC_VER_MINOR __NVCOMPILER_MINOR__
#define CCMATH_COMPILER_NVIDIA_HPC_VER_PATCH __NVCOMPILER_PATCHLEVEL__

#ifndef CCMATH_COMPILER_CLANG_BASED
#define CCMATH_COMPILER_CLANG_BASED
#endif
#ifndef CCMATH_FOUND_COMPILER
#define CCMATH_FOUND_COMPILER
#endif
Expand Down

0 comments on commit 383aff7

Please sign in to comment.