|
22 | 22 | __SYCL_INLINE_NAMESPACE(cl) { |
23 | 23 | namespace sycl { |
24 | 24 |
|
25 | | -#ifdef _WIN32 |
26 | | -namespace detail { |
27 | | -// SYCL library is designed such a way that STL objects cross DLL boundary, |
28 | | -// which is not guaranteed to work and considered not safe in general. |
29 | | -// Only using same dynamic C++ runtime library for sycl[d].dll and for |
30 | | -// the application using sycl[d].dll is guaranteed to work properly. |
31 | | -inline constexpr bool isMSVCDynamicCXXRuntime() { |
32 | | -// The options /MD and /MDd that make the code to use dynamic runtime also |
33 | | -// define the _DLL macro. |
34 | | -#ifdef _DLL |
35 | | - return true; |
36 | | -#else |
37 | | - return false; |
38 | | -#endif |
39 | | -} |
40 | | -static_assert(isMSVCDynamicCXXRuntime(), |
41 | | - "SYCL library is designed to work with dynamic C++ runtime, " |
42 | | - "please use /MD or /MDd switches."); |
43 | | -} // namespace detail |
44 | | -#endif // _WIN32 |
| 25 | + template < class T, class Alloc = std::allocator<T> > |
| 26 | + using vector_class = std::vector<T, Alloc>; |
45 | 27 |
|
46 | | -template <class T, class Alloc = std::allocator<T>> |
47 | | -using vector_class = std::vector<T, Alloc>; |
| 28 | + using string_class = std::string; |
48 | 29 |
|
49 | | -using string_class = std::string; |
| 30 | + template <class Sig> |
| 31 | + using function_class = std::function<Sig>; |
50 | 32 |
|
51 | | -template <class Sig> using function_class = std::function<Sig>; |
| 33 | + using mutex_class = std::mutex; |
52 | 34 |
|
53 | | -using mutex_class = std::mutex; |
| 35 | + template <class T, class Deleter = std::default_delete<T>> |
| 36 | + using unique_ptr_class = std::unique_ptr<T, Deleter>; |
54 | 37 |
|
55 | | -template <class T, class Deleter = std::default_delete<T>> |
56 | | -using unique_ptr_class = std::unique_ptr<T, Deleter>; |
| 38 | + template <class T> |
| 39 | + using shared_ptr_class = std::shared_ptr<T>; |
57 | 40 |
|
58 | | -template <class T> using shared_ptr_class = std::shared_ptr<T>; |
| 41 | + template <class T> |
| 42 | + using weak_ptr_class = std::weak_ptr<T>; |
59 | 43 |
|
60 | | -template <class T> using weak_ptr_class = std::weak_ptr<T>; |
| 44 | + template <class T> |
| 45 | + using hash_class = std::hash<T>; |
61 | 46 |
|
62 | | -template <class T> using hash_class = std::hash<T>; |
63 | | - |
64 | | -using exception_ptr_class = std::exception_ptr; |
65 | | - |
66 | | -template <typename T, typename... ArgsT> |
67 | | -unique_ptr_class<T> make_unique_ptr(ArgsT &&... Args) { |
68 | | - return unique_ptr_class<T>(new T(std::forward<ArgsT>(Args)...)); |
69 | | -} |
| 47 | + using exception_ptr_class = std::exception_ptr; |
70 | 48 |
|
| 49 | + template <typename T, typename... ArgsT> |
| 50 | + unique_ptr_class<T> make_unique_ptr(ArgsT &&... Args) { |
| 51 | + return unique_ptr_class<T>(new T(std::forward<ArgsT>(Args)...)); |
| 52 | + } |
71 | 53 | } // sycl |
72 | 54 | } // cl |
73 | 55 |
|
0 commit comments