DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
export.hpp
Go to the documentation of this file.
1 //==---------------- export.hpp - SYCL standard header file ----------------==//
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 __SYCL_DEVICE_ONLY__
12 #ifndef __SYCL_EXPORT
13 #ifdef _WIN32
14 
15 // MSVC discourages export of classes, that use STL class in API. This
16 // results in a warning, treated as compile error. Silence C4251 to workaround.
17 #pragma warning(disable : 4251)
18 #pragma warning(disable : 4275)
19 
20 #define __SYCL_DLL_LOCAL
21 
22 #if __SYCL_BUILD_SYCL_DLL
23 #define __SYCL_EXPORT __declspec(dllexport)
24 #define __SYCL_EXPORT_DEPRECATED(x) __declspec(dllexport, deprecated(x))
25 #else
26 #define __SYCL_EXPORT __declspec(dllimport)
27 #define __SYCL_EXPORT_DEPRECATED(x) __declspec(dllimport, deprecated(x))
28 #endif //__SYCL_BUILD_SYCL_DLL
29 #else // _WIN32
30 
31 #define __SYCL_DLL_LOCAL __attribute__((visibility("hidden")))
32 
33 #define __SYCL_EXPORT __attribute__((visibility("default")))
34 #define __SYCL_EXPORT_DEPRECATED(x) \
35  __attribute__((visibility("default"), deprecated(x)))
36 #endif // _WIN32
37 #endif // __SYCL_EXPORT
38 #else
39 #ifndef __SYCL_EXPORT
40 #define __SYCL_EXPORT
41 #define __SYCL_EXPORT_DEPRECATED(x)
42 #define __SYCL_DLL_LOCAL
43 #endif
44 #endif // __SYCL_DEVICE_ONLY__