// Copyright (c) 2018 NVIDIA Corporation // Author: Bryce Adelstein Lelbach // // Distributed under the Boost Software License v1.0 (boost.org/LICENSE_1_0.txt) #pragma once #include #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) # pragma GCC system_header #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) # pragma clang system_header #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header #if THRUST_CPP_DIALECT >= 2011 # include #endif THRUST_NAMESPACE_BEGIN /////////////////////////////////////////////////////////////////////////////// /*! Obtains the actual address of the object or function arg, even in presence of overloaded operator&. */ template __host__ __device__ T* addressof(T& arg) { return reinterpret_cast( &const_cast(reinterpret_cast(arg)) ); } /////////////////////////////////////////////////////////////////////////////// THRUST_NAMESPACE_END