From 3333da62a5bb9796175c719232c5b85bd9c1b41d Mon Sep 17 00:00:00 2001 From: Patrick Stotko Date: Tue, 27 Aug 2024 08:19:50 +0200 Subject: [PATCH] memory: Drop workaround for to_address --- src/stdgpu/impl/memory_detail.h | 19 ------------------- src/stdgpu/memory.h | 10 ++-------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/stdgpu/impl/memory_detail.h b/src/stdgpu/impl/memory_detail.h index 44451526b..3ad2f1d9d 100644 --- a/src/stdgpu/impl/memory_detail.h +++ b/src/stdgpu/impl/memory_detail.h @@ -670,9 +670,6 @@ to_address(T* p) noexcept return p; } -// Use pre-C++17 SFINAE for dispatching due to wrong missing-return warning caused by NVCC -// (potentially fixed in CUDA 11.5+) -/* template STDGPU_HOST_DEVICE auto to_address(const Ptr& p) noexcept @@ -693,22 +690,6 @@ to_address(const Ptr& p) noexcept return static_cast(nullptr); } } -*/ - -template )> -STDGPU_HOST_DEVICE auto -to_address(const Ptr& p) noexcept -{ - return to_address(p.operator->()); -} - -template && detail::has_get_v)> -STDGPU_HOST_DEVICE auto -to_address(const Ptr& p) noexcept -{ - return to_address(p.get()); -} template STDGPU_HOST_DEVICE T* diff --git a/src/stdgpu/memory.h b/src/stdgpu/memory.h index 286221440..80b8946d1 100644 --- a/src/stdgpu/memory.h +++ b/src/stdgpu/memory.h @@ -741,18 +741,12 @@ to_address(T* p) noexcept; * \brief Converts a potential fancy pointer to a raw pointer * \tparam Ptr The fancy pointer type * \param[in] p A fancy pointer - * \return The raw pointer held by the fancy pointer obtained via operator->() + * \return The raw pointer held by the fancy pointer obtained via operator->() or get() */ -template )> +template STDGPU_HOST_DEVICE auto to_address(const Ptr& p) noexcept; -//! @cond Doxygen_Suppress -template && detail::has_get_v)> -STDGPU_HOST_DEVICE auto -to_address(const Ptr& p) noexcept; -//! @endcond - /** * \ingroup memory * \brief Destroys the value at the given pointer