Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new type-erased memory resources #2824

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
06715ac
`basic_any`: a utility for defining type-erasing wrappers in terms of…
ericniebler Oct 17, 2024
a278c34
[WIP] re-re-reimplement type-erased memory resources
ericniebler Nov 15, 2024
486897e
simplify `__property_result_t` alias for older compilers
ericniebler Nov 15, 2024
308d6ac
disambiguate `basic_any<I&>` and `basic_any<__ireference<I>>` for old…
ericniebler Nov 15, 2024
53696f3
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 15, 2024
7ce5ea5
mark function arguments as potentially unused
ericniebler Nov 15, 2024
59c9fb0
fix friend declaration in C++20+ code
ericniebler Nov 15, 2024
e61bc58
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 15, 2024
ae04ac1
work around weird nvcc concepts bug
ericniebler Nov 16, 2024
0f453ab
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 16, 2024
20798d2
Merge remote-tracking branch 'origin/main' into cudax-any-resource-redux
ericniebler Nov 16, 2024
425f7cf
work around concepts bug in nvcc
ericniebler Nov 17, 2024
5d22307
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 17, 2024
4efe709
help nvc++ with void return after `if constexpr`
ericniebler Nov 17, 2024
8f8b0f3
workarounds for nvc++ and msvc bugs
ericniebler Nov 17, 2024
81fa967
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 17, 2024
72bd4e7
break `basic_any` into separate files, grouped logically
ericniebler Nov 17, 2024
6c8e651
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 17, 2024
36fd535
add missing header for `uint8_t`
ericniebler Nov 17, 2024
a2b32d0
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 17, 2024
201948c
add some missing includes
ericniebler Nov 17, 2024
fb8bc39
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 17, 2024
73ff1fe
use existing work-around for known nvc++ bug with constexpr function …
ericniebler Nov 18, 2024
2d6315f
IWYU export all headers from `basic_any.cuh`
ericniebler Nov 18, 2024
8c58244
naming and doxygen comments
ericniebler Nov 18, 2024
6ab3361
more Doxygen comments
ericniebler Nov 18, 2024
3a51c21
Merge remote-tracking branch 'origin/main' into cudax-any-resource-redux
ericniebler Nov 18, 2024
55af1ee
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 18, 2024
5fc39dc
replace `cudax::any_resource` and provide `cudax::resource_ref`
ericniebler Nov 18, 2024
bf65ccd
make `basic_any` host-only for now
ericniebler Nov 19, 2024
60e09ff
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 19, 2024
5e442f2
fixing some bugs
ericniebler Nov 19, 2024
4a33f34
fix another bug
ericniebler Nov 19, 2024
2cc7d2b
explicitly initialize basic_any ireference base
ericniebler Nov 19, 2024
2ca835b
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 19, 2024
1225795
bug fixing
ericniebler Nov 20, 2024
f17ea03
uncomment necessary requires clause
ericniebler Nov 20, 2024
569dea3
molify gcc
ericniebler Nov 20, 2024
0da06e6
turn on MSVC empty bases for `resource_ref`
ericniebler Nov 20, 2024
de83907
`interface` is a macro on windows (wtf?)
ericniebler Nov 21, 2024
748cd35
Merge remote-tracking branch 'origin/main' into cudax-any-resource-redux
ericniebler Nov 21, 2024
466e8be
Merge remote-tracking branch 'origin/main' into cudax-basic-any
ericniebler Nov 21, 2024
db5b797
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 21, 2024
85c002b
undef `interface`
ericniebler Nov 21, 2024
23fda7d
Merge remote-tracking branch 'origin/main' into cudax-basic-any
ericniebler Nov 21, 2024
0dad283
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 21, 2024
4e2282e
Merge remote-tracking branch 'origin/main' into cudax-basic-any
ericniebler Nov 22, 2024
874f344
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 22, 2024
dae30fa
Merge remote-tracking branch 'origin/main' into cudax-any-resource-redux
ericniebler Nov 25, 2024
8443c6f
more doxygen comments
ericniebler Nov 25, 2024
f9bb949
add missing `noexcept` to some member functions
ericniebler Nov 25, 2024
ab130e0
Merge remote-tracking branch 'origin/main' into cudax-basic-any
ericniebler Nov 26, 2024
98d5e9c
use trailing return types
ericniebler Nov 26, 2024
4b2aba4
change doxygen comment type
ericniebler Nov 26, 2024
c47e037
include public cstddef and cstdint headers directly
ericniebler Nov 26, 2024
c1f014b
comments on #else and #endif lines
ericniebler Nov 26, 2024
1dfa55b
Merge branch 'cudax-basic-any' into cudax-any-resource-redux
ericniebler Nov 26, 2024
82865b0
make `cudax::any_async_resource` convertible to `cuda::mr::async_reso…
ericniebler Nov 26, 2024
ac29d83
fix bad doc comment that was breaking sphinx
ericniebler Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#endif // no system header

#include <cuda/__memory_resource/properties.h>
#include <cuda/__memory_resource/resource_ref.h>
#include <cuda/std/__memory/align.h>
#include <cuda/std/__new/launder.h>
#include <cuda/std/__type_traits/type_set.h>
Expand Down Expand Up @@ -287,7 +286,7 @@ public:
_CCCL_HIDE_FROM_ABI uninitialized_async_buffer __replace_allocation(const size_t __count)
{
// Create a new buffer with a reference to the stored memory resource and swap allocation information
uninitialized_async_buffer __ret{_CUDA_VMR::async_resource_ref<_Properties...>{__mr_}, __stream_, __count};
uninitialized_async_buffer __ret{mr::async_resource_ref<_Properties...>{__mr_}, __stream_, __count};
_CUDA_VSTD::swap(__count_, __ret.__count_);
_CUDA_VSTD::swap(__buf_, __ret.__buf_);
return __ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#endif // no system header

#include <cuda/__memory_resource/properties.h>
#include <cuda/__memory_resource/resource_ref.h>
#include <cuda/std/__memory/align.h>
#include <cuda/std/__new/launder.h>
#include <cuda/std/__type_traits/type_set.h>
Expand Down Expand Up @@ -252,7 +251,7 @@ public:
_CCCL_HIDE_FROM_ABI uninitialized_buffer __replace_allocation(const size_t __count)
{
// Create a new buffer with a reference to the stored memory resource and swap allocation information
uninitialized_buffer __ret{_CUDA_VMR::resource_ref<_Properties...>{__mr_}, __count};
uninitialized_buffer __ret{mr::resource_ref<_Properties...>{__mr_}, __count};
_CUDA_VSTD::swap(__count_, __ret.__count_);
_CUDA_VSTD::swap(__buf_, __ret.__buf_);
return __ret;
Expand Down
1 change: 1 addition & 0 deletions cudax/include/cuda/experimental/__detail/config.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

namespace cuda::experimental
{
namespace __cudax = ::cuda::experimental; // NOLINT: misc-unused-alias-decls
}

#endif // __CUDAX__DETAIL_CONFIG_CUH
24 changes: 21 additions & 3 deletions cudax/include/cuda/experimental/__detail/utility.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef __CUDAX_DETAIL_UTILITY_H
#define __CUDAX_DETAIL_UTILITY_H

#include <cuda/__cccl_config>
#include <cuda/std/detail/__config>

#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
Expand All @@ -21,6 +21,8 @@
# pragma system_header
#endif // no system header

#include <cuda/std/__utility/declval.h>

namespace cuda::experimental
{
namespace detail
Expand All @@ -30,8 +32,8 @@ struct [[maybe_unused]] __ignore
{
__ignore() = default;

template <typename _Arg>
_CCCL_HOST_DEVICE constexpr __ignore(_Arg&&) noexcept
template <typename... _Args>
_CCCL_HOST_DEVICE constexpr __ignore(_Args&&...) noexcept
{}
};

Expand All @@ -42,8 +44,24 @@ struct __immovable
__immovable(__immovable&&) = delete;
__immovable& operator=(__immovable&&) = delete;
};

template <class... _Types>
struct _LIBCUDACXX_DECLSPEC_EMPTY_BASES __inherit : _Types...
{};

template <class _Type, template <class...> class _Template>
inline constexpr bool __is_specialization_of = false;

template <template <class...> class _Template, class... _Args>
inline constexpr bool __is_specialization_of<_Template<_Args...>, _Template> = true;

} // namespace detail

template <class _Tp>
using __identity_t _CCCL_NODEBUG_ALIAS = _Tp;

using _CUDA_VSTD::declval;

struct uninit_t
{
explicit uninit_t() = default;
Expand Down
Loading
Loading