C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
identification.h
Go to the documentation of this file.
1/*
2 © 2023 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14// -*- C++ -*-
15
16#ifndef CPP_API_EXTENSIONS_SRC_SME_AQPP_ABSTRACTION_COMPILER_IDENTIFICATION_H
17#define CPP_API_EXTENSIONS_SRC_SME_AQPP_ABSTRACTION_COMPILER_IDENTIFICATION_H
18
19// Verify C++ Language Version
20#if defined(_MSVC_LANG)
21 static_assert(_MSVC_LANG >= 201703L);
22#elif defined(__cplusplus)
23 // NOTE: even if MSVC_LANG is 201703 or higher, __cplusplus is 1997.. bug in microsoft.
24 static_assert( __cplusplus >= 201703L, "C++ 17 is required to use this library");
25#endif
26
27// Verify Valid Compiler
28#if !(defined( __INTEL_LLVM_COMPILER) || defined( __GNUC__) || defined ( _MSC_VER))
29 static_assert( false, "Only GCC, Visual Studio or Intel ICX & DPCPP Compilers Supported at this time.")
30#endif
31
32// Verify Minimal Compiler Version(s)
33#if defined( SYCL_LANGUAGE_VERSION )
34 static_assert( SYCL_LANGUAGE_VERSION >= 202001, "Version 202001 or higher required if using SYCL language.");
35#endif
36
37#if defined( __INTEL_LLVM_COMPILER )
38 static_assert( __INTEL_LLVM_COMPILER >= 202110, "Version 202110 or higher required if using DPCPP or ICX.");
39#endif
40
41#if defined( __GNUC__ )
42 static_assert( __GNUC__ >= 11, "Version 11 or higher required if using GNU/GCC.");
43#endif
44
45#if defined( _MSC_VER)
46 static_assert( _MSC_VER >= 1929, "Version 19.11 or higher required if using Visual Studio.");
47#endif
48
49#if defined( __INTEL_LLVM_COMPILER ) || defined( __INTEL_COMPILER ) || defined( __GNUC__ )
50 #define SUPPORT_GCC_ATTRIBUTES 1
51 #define STANDARD_CPP
52#elif defined(WIN32) || defined(_WIN32)
53 #define SUPPORT_MS_ATTRIBUTES 1
54 #define MSFT_CPP
55#endif
56
57#if defined( _MSVC_LANG)
58 #if( _MSVC_LANG >= 202002)
59 #define CPP20
60 #elif (_MSVC_LANG >= 201703L)
61 #define CPP17
62 #endif
63#elif defined( __cplusplus)
64 #if (__cplusplus >= 202002L)
65 #define CPP20
66 #elif (__cplusplus >= 201703L)
67 #define CPP17
68 #endif
69#endif
70
71#if __has_include("windows.h")
72 #define ON_WINDOWS
73#endif
74
75#endif /* ABSTRACTION_COMPILER__IDENTIFICATION_H_ */
76