DPC++ Runtime
Runtime libraries for oneAPI DPC++
defines_elementary.hpp
Go to the documentation of this file.
1
//==--- defines_elementary.hpp ---- Preprocessor directives (simplified) ---==//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#pragma once
10
11
#ifndef __has_attribute
12
#define __has_attribute(x) 0
13
#endif
14
15
#ifndef __has_builtin
16
#define __has_builtin(x) 0
17
#endif // __has_builtin
18
19
#ifndef __SYCL_ALWAYS_INLINE
20
#if __has_attribute(always_inline)
21
#define __SYCL_ALWAYS_INLINE __attribute__((always_inline))
22
#else
23
#define __SYCL_ALWAYS_INLINE
24
#endif
25
#endif // __SYCL_ALWAYS_INLINE
26
27
#ifdef SYCL_EXTERNAL
28
#define __DPCPP_SYCL_EXTERNAL SYCL_EXTERNAL
29
#else
30
#ifdef __SYCL_DEVICE_ONLY__
31
#define __DPCPP_SYCL_EXTERNAL __attribute__((sycl_device))
32
#else
33
#define __DPCPP_SYCL_EXTERNAL
34
#define SYCL_EXTERNAL
35
#endif
36
#endif
37
38
#ifndef __SYCL_ID_QUERIES_FIT_IN_INT__
39
#define __SYCL_ID_QUERIES_FIT_IN_INT__ 0
40
#endif
41
42
#ifndef __SYCL_DEPRECATED
43
#if !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
44
#define __SYCL_DEPRECATED(message) [[deprecated(message)]]
45
#else // SYCL_DISABLE_DEPRECATION_WARNINGS
46
#define __SYCL_DEPRECATED(message)
47
#endif // SYCL_DISABLE_DEPRECATION_WARNINGS
48
#endif // __SYCL_DEPRECATED
49
50
#ifndef __SYCL2020_DEPRECATED
51
#if SYCL_LANGUAGE_VERSION >= 202001 && \
52
!defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
53
#define __SYCL2020_DEPRECATED(message) __SYCL_DEPRECATED(message)
54
#else
55
#define __SYCL2020_DEPRECATED(message)
56
#endif
57
#endif // __SYCL2020_DEPRECATED
58
59
#ifndef __SYCL_WARN_IMAGE_ASPECT
60
#if !defined(SYCL_DISABLE_IMAGE_ASPECT_WARNING) && __has_attribute(diagnose_if)
61
#define __SYCL_WARN_IMAGE_ASPECT(aspect_param) \
62
__attribute__((diagnose_if( \
63
aspect_param == aspect::image, \
64
"SYCL 2020 images are not supported on any devices. Consider using " \
65
"‘aspect::ext_intel_legacy_image’ instead. Disable this warning with " \
66
"by defining SYCL_DISABLE_IMAGE_ASPECT_WARNING.", \
67
"warning")))
68
#else
69
#define __SYCL_WARN_IMAGE_ASPECT(aspect)
70
#endif
71
#endif // __SYCL_WARN_IMAGE_ASPECT
72
73
#ifndef __SYCL_HAS_CPP_ATTRIBUTE
74
#if defined(__cplusplus) && defined(__has_cpp_attribute)
75
#define __SYCL_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
76
#else
77
#define __SYCL_HAS_CPP_ATTRIBUTE(x) 0
78
#endif
79
#endif
80
81
static_assert(__cplusplus >= 201703L,
82
"DPCPP does not support C++ version earlier than C++17."
);
include
sycl
detail
defines_elementary.hpp
Generated by
1.8.17