diff --git a/include/details/__config b/include/details/__config index 9bbce7b..1ed4d44 100644 --- a/include/details/__config +++ b/include/details/__config @@ -49,10 +49,10 @@ THE SOFTWARE. #define _LIBCPP_HAS_NO_INT128 #define _LIBCPP_FREESTANDING #define _LIBCPP_HAS_NO_SEMAPHORES +#define _LIBCPP_HAS_NO_IS_AGGREGATE #define _LIBCPP_HAS_NO_THREAD_CONTENTION_TABLE #define _LIBCPP_HAS_NO_THREAD_CONTENTION_STATE #define _LIBCPP_HAS_NO_PLATFORM_WAIT -#define _LIBCPP_HAS_CLOCK_API_EXTERNAL #ifndef _LIBCUPP_HAS_TREE_BARRIER # define _LIBCPP_HAS_NO_TREE_BARRIER #endif diff --git a/include/simt/chrono b/include/simt/chrono index fe2204a..db4f591 100644 --- a/include/simt/chrono +++ b/include/simt/chrono @@ -26,10 +26,6 @@ THE SOFTWARE. #ifndef _SIMT_CHRONO #define _SIMT_CHRONO -#ifndef __CUDACC_RTC__ - #include -#endif //__CUDACC_RTC__ - #include "ctime" #include "type_traits" #include "ratio" @@ -38,63 +34,27 @@ THE SOFTWARE. #include "../details/__config" +#ifdef _LIBCUDACXX_USE_CXX20_CHRONO +# define _LIBCPP_STD_VER_PREV _LIBCPP_STD_VER +# undef _LIBCPP_STD_VER +# define _LIBCPP_STD_VER 20 +#endif //_LIBCUDACXX_USE_CXX20_CHRONO + +#ifndef __CUDACC_RTC__ + #include +#endif //__CUDACC_RTC__ + +#define _LIBCUDACXX_USE_CUDA_CLOCK + #include "../../libcxx/include/chrono" -_LIBCPP_BEGIN_NAMESPACE_STD - -namespace chrono { - -class _LIBCPP_TYPE_VIS system_clock -{ -public: - typedef nanoseconds duration; - typedef duration::rep rep; - typedef duration::period period; - typedef chrono::time_point time_point; - static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false; - - inline _LIBCPP_INLINE_VISIBILITY - static time_point now() _NOEXCEPT - { -#ifdef __CUDA_ARCH__ - uint64_t time; - asm("mov.u64 %0, %globaltimer;":"=l"(time)::); - return time_point(nanoseconds(time)); -#else - return time_point(nanoseconds( - ::std::chrono::duration_cast<::std::chrono::nanoseconds>( - ::std::chrono::system_clock::now().time_since_epoch() - ).count() - )); -#endif - } - inline _LIBCPP_INLINE_VISIBILITY - static time_t to_time_t(const time_point& __t) _NOEXCEPT - { - return time_t(duration_cast(__t.time_since_epoch()).count()); - } - inline _LIBCPP_INLINE_VISIBILITY - static time_point from_time_t(time_t __t) _NOEXCEPT - { - return time_point(seconds(__t));; - } -}; - -using steady_clock = system_clock; -using high_resolution_clock = steady_clock; - -#if _LIBCPP_STD_VER > 17 - -template -using sys_time = time_point; -using sys_seconds = sys_time; -using sys_days = sys_time; - -#endif - -} - -_LIBCPP_END_NAMESPACE_STD +#undef _LIBCUDACXX_USE_CUDA_CLOCK + +#ifdef _LIBCUDACXX_USE_CXX20_CHRONO +# undef _LIBCPP_STD_VER +# define _LIBCPP_STD_VER _LIBCPP_STD_VER_PREV +# undef _LIBCPP_STD_VER_PREV +#endif //_LIBCUDACXX_USE_CXX20_CHRONO #endif //_SIMT_CHRONO diff --git a/include/simt/type_traits b/include/simt/type_traits index 5e29b70..f6a81ab 100644 --- a/include/simt/type_traits +++ b/include/simt/type_traits @@ -25,6 +25,12 @@ THE SOFTWARE. #ifndef _SIMT_TYPE_TRAITS #define _SIMT_TYPE_TRAITS +#ifdef _LIBCUDACXX_USE_CXX17_TYPE_TRAITS +# define _LIBCPP_STD_VER_PREV _LIBCPP_STD_VER +# undef _LIBCPP_STD_VER +# define _LIBCPP_STD_VER 17 +#endif //_LIBCUDACXX_USE_CXX17_TYPE_TRAITS + #ifndef __CUDACC_RTC__ #include #endif //__CUDACC_RTC__ @@ -35,4 +41,10 @@ THE SOFTWARE. #include "../../libcxx/include/type_traits" +#ifdef _LIBCUDACXX_USE_CXX17_TYPE_TRAITS +# undef _LIBCPP_STD_VER +# define _LIBCPP_STD_VER _LIBCPP_STD_VER_PREV +# undef _LIBCPP_STD_VER_PREV +#endif //_LIBCUDACXX_USE_CXX17_TYPE_TRAITS + #endif //_SIMT_TYPE_TRAITS diff --git a/libcxx b/libcxx index a4ace1c..1f4f3a4 160000 --- a/libcxx +++ b/libcxx @@ -1 +1 @@ -Subproject commit a4ace1ce72e2e5376c4e3965e632357e7d55e0b6 +Subproject commit 1f4f3a4e4fbc2fec63807e43db251600b7ad8dc4