File size: 942 Bytes
8ae5fc5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | //===------------------------- atomic.cpp ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCUDACXX_HAS_NO_THREADS
#include "atomic"
_LIBCUDACXX_BEGIN_NAMESPACE_STD
#if !defined(_LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE) && (_LIBCUDACXX_STD_VER >= 11)
__libcpp_contention_t __libcpp_contention_state_[ 256 /* < there's no magic in this number */ ];
_LIBCUDACXX_FUNC_VIS
__libcpp_contention_t * __libcpp_contention_state(void const volatile * p) _NOEXCEPT {
return __libcpp_contention_state_ + ((std::uintptr_t)p & 255);
}
#endif //_LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE
_LIBCUDACXX_END_NAMESPACE_STD
#endif //_LIBCUDACXX_HAS_NO_THREADS
|