Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion libcudacxx/include/cuda/__functional/maximum.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <cuda/std/__type_traits/common_type.h>
#include <cuda/std/__type_traits/is_extended_floating_point.h>
#include <cuda/std/__type_traits/is_floating_point.h>
#include <cuda/std/__utility/ctad_support.h>

#include <cuda/std/__cccl/prologue.h>

Expand All @@ -48,7 +49,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT maximum
}
}
};
_LIBCUDACXX_CTAD_SUPPORTED_FOR_TYPE(maximum);
_CCCL_CTAD_SUPPORTED_FOR_TYPE(maximum);

template <>
struct _CCCL_TYPE_VISIBILITY_DEFAULT maximum<void>
Expand Down
3 changes: 2 additions & 1 deletion libcudacxx/include/cuda/__functional/minimum.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <cuda/std/__type_traits/common_type.h>
#include <cuda/std/__type_traits/is_extended_floating_point.h>
#include <cuda/std/__type_traits/is_floating_point.h>
#include <cuda/std/__utility/ctad_support.h>

#include <cuda/std/__cccl/prologue.h>

Expand All @@ -48,7 +49,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT minimum
}
}
};
_LIBCUDACXX_CTAD_SUPPORTED_FOR_TYPE(minimum);
_CCCL_CTAD_SUPPORTED_FOR_TYPE(minimum);

template <>
struct _CCCL_TYPE_VISIBILITY_DEFAULT minimum<void>
Expand Down
7 changes: 4 additions & 3 deletions libcudacxx/include/cuda/__mdspan/host_device_mdspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <cuda/std/__type_traits/remove_all_extents.h>
#include <cuda/std/__type_traits/remove_pointer.h>
#include <cuda/std/__type_traits/remove_reference.h>
#include <cuda/std/__utility/delegate_constructors.h>
#include <cuda/std/mdspan>

#include <cuda/std/__cccl/prologue.h>
Expand All @@ -45,7 +46,7 @@ template <typename _ElementType,
class host_mdspan : public ::cuda::std::mdspan<_ElementType, _Extents, _LayoutPolicy, host_accessor<_AccessorPolicy>>
{
public:
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(
_CCCL_DELEGATE_CONSTRUCTORS(
host_mdspan, ::cuda::std::mdspan, _ElementType, _Extents, _LayoutPolicy, host_accessor<_AccessorPolicy>);

_CCCL_API friend constexpr void swap(host_mdspan& __x, host_mdspan& __y) noexcept
Expand Down Expand Up @@ -105,7 +106,7 @@ class device_mdspan
: public ::cuda::std::mdspan<_ElementType, _Extents, _LayoutPolicy, device_accessor<_AccessorPolicy>>
{
public:
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(
_CCCL_DELEGATE_CONSTRUCTORS(
device_mdspan, ::cuda::std::mdspan, _ElementType, _Extents, _LayoutPolicy, device_accessor<_AccessorPolicy>);

_CCCL_API friend constexpr void swap(device_mdspan& __x, device_mdspan& __y) noexcept
Expand Down Expand Up @@ -167,7 +168,7 @@ class managed_mdspan
: public ::cuda::std::mdspan<_ElementType, _Extents, _LayoutPolicy, managed_accessor<_AccessorPolicy>>
{
public:
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(
_CCCL_DELEGATE_CONSTRUCTORS(
managed_mdspan, ::cuda::std::mdspan, _ElementType, _Extents, _LayoutPolicy, managed_accessor<_AccessorPolicy>);

_CCCL_API friend constexpr void swap(managed_mdspan& __x, managed_mdspan& __y) noexcept
Expand Down
3 changes: 2 additions & 1 deletion libcudacxx/include/cuda/__mdspan/restrict_mdspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <cuda/std/__type_traits/remove_all_extents.h>
#include <cuda/std/__type_traits/remove_pointer.h>
#include <cuda/std/__type_traits/remove_reference.h>
#include <cuda/std/__utility/delegate_constructors.h>
#include <cuda/std/mdspan>

#include <cuda/std/__cccl/prologue.h>
Expand All @@ -46,7 +47,7 @@ class restrict_mdspan
: public ::cuda::std::mdspan<_ElementType, _Extents, _LayoutPolicy, restrict_accessor<_AccessorPolicy>>
{
public:
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(
_CCCL_DELEGATE_CONSTRUCTORS(
restrict_mdspan, ::cuda::std::mdspan, _ElementType, _Extents, _LayoutPolicy, restrict_accessor<_AccessorPolicy>);

_CCCL_API friend constexpr void swap(restrict_mdspan& __x, restrict_mdspan& __y) noexcept
Expand Down
9 changes: 5 additions & 4 deletions libcudacxx/include/cuda/__memory_resource/any_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <cuda/__memory_resource/resource.h>
#include <cuda/__utility/basic_any.h>
#include <cuda/std/__concepts/concept_macros.h>
#include <cuda/std/__utility/delegate_constructors.h>
#include <cuda/std/__utility/forward.h>
#include <cuda/std/optional>

Expand Down Expand Up @@ -208,7 +209,7 @@ struct _CCCL_DECLSPEC_EMPTY_BASES any_synchronous_resource
, __with_try_get_property<any_synchronous_resource<_Properties...>>
{
// Inherit constructors from __basic_any
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(any_synchronous_resource, ::cuda::__basic_any, __iresource<_Properties...>);
_CCCL_DELEGATE_CONSTRUCTORS(any_synchronous_resource, ::cuda::__basic_any, __iresource<_Properties...>);

// any_resource is convertible to any_synchronous_resource
_CCCL_TEMPLATE(class... _OtherProperties)
Expand Down Expand Up @@ -238,7 +239,7 @@ struct _CCCL_DECLSPEC_EMPTY_BASES any_resource
, __with_try_get_property<any_resource<_Properties...>>
{
// Inherit constructors from __basic_any
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(any_resource, ::cuda::__basic_any, __iasync_resource<_Properties...>);
_CCCL_DELEGATE_CONSTRUCTORS(any_resource, ::cuda::__basic_any, __iasync_resource<_Properties...>);

using default_queries = ::cuda::mr::properties_list<_Properties...>;

Expand Down Expand Up @@ -266,7 +267,7 @@ struct _CCCL_DECLSPEC_EMPTY_BASES synchronous_resource_ref
, __with_try_get_property<synchronous_resource_ref<_Properties...>>
{
// Inherit constructors from __basic_any
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(synchronous_resource_ref, ::cuda::__basic_any, __iresource<_Properties...>&);
_CCCL_DELEGATE_CONSTRUCTORS(synchronous_resource_ref, ::cuda::__basic_any, __iresource<_Properties...>&);

synchronous_resource_ref(const synchronous_resource_ref& __other) noexcept = default;

Expand Down Expand Up @@ -327,7 +328,7 @@ struct _CCCL_DECLSPEC_EMPTY_BASES resource_ref
, __with_try_get_property<resource_ref<_Properties...>>
{
// Inherit other constructors from __basic_any
_LIBCUDACXX_DELEGATE_CONSTRUCTORS(resource_ref, ::cuda::__basic_any, __iasync_resource<_Properties...>&);
_CCCL_DELEGATE_CONSTRUCTORS(resource_ref, ::cuda::__basic_any, __iasync_resource<_Properties...>&);

resource_ref(const resource_ref& __other) noexcept = default;

Expand Down
24 changes: 12 additions & 12 deletions libcudacxx/include/cuda/std/__atomic/api/owned.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ struct __atomic_common

__atomic_storage_t<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(, )
_LIBCUDACXX_ATOMIC_COMMON_IMPL(, volatile)
Expand All @@ -63,9 +63,9 @@ struct __atomic_arithmetic

__atomic_storage_t<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(, )
_LIBCUDACXX_ATOMIC_COMMON_IMPL(, volatile)
Expand All @@ -85,9 +85,9 @@ struct __atomic_bitwise

__atomic_storage_t<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(, )
_LIBCUDACXX_ATOMIC_COMMON_IMPL(, volatile)
Expand All @@ -110,9 +110,9 @@ struct __atomic_pointer

__atomic_storage_t<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(, )
_LIBCUDACXX_ATOMIC_COMMON_IMPL(, volatile)
Expand Down
24 changes: 12 additions & 12 deletions libcudacxx/include/cuda/std/__atomic/api/reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ struct __atomic_ref_common

__atomic_ref_storage<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(const, )
};
Expand All @@ -58,9 +58,9 @@ struct __atomic_ref_arithmetic

__atomic_ref_storage<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(const, )
_LIBCUDACXX_ATOMIC_ARITHMETIC_IMPL(const, )
Expand All @@ -75,9 +75,9 @@ struct __atomic_ref_bitwise

__atomic_ref_storage<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(const, )
_LIBCUDACXX_ATOMIC_ARITHMETIC_IMPL(const, )
Expand All @@ -93,9 +93,9 @@ struct __atomic_ref_pointer

__atomic_ref_storage<_Tp> __a;

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
static constexpr bool is_always_lock_free = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0);
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_LIBCUDACXX_ATOMIC_COMMON_IMPL(const, )
_LIBCUDACXX_ATOMIC_POINTER_IMPL(const, )
Expand Down
8 changes: 4 additions & 4 deletions libcudacxx/include/cuda/std/__atomic/functions/cuda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ _CCCL_BEGIN_NAMESPACE_CUDA_STD

_CCCL_DEVICE inline bool __cuda_is_local(const volatile void* __ptr)
{
# if defined(_LIBCUDACXX_ATOMIC_UNSAFE_AUTOMATIC_STORAGE) && !defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH)
# if defined(_CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE) && !defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH)
return false;
# else // ^^^ _LIBCUDACXX_ATOMIC_UNSAFE_AUTOMATIC_STORAGE && !defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH) ^^^
// / vvv !_LIBCUDACXX_ATOMIC_UNSAFE_AUTOMATIC_STORAGE || defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH)
# else // ^^^ _CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE && !defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH) ^^^
// / vvv !_CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE || defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH)
// vvv
return ::cuda::device::is_address_from(__ptr, ::cuda::device::address_space::local);
# endif // ^^^ !_LIBCUDACXX_ATOMIC_UNSAFE_AUTOMATIC_STORAGE || defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH)
# endif // ^^^ !_CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE || defined(_LIBCUDACXX_FORCE_PTX_AUTOMATIC_STORAGE_PATH)
// ^^^
}

Expand Down
23 changes: 11 additions & 12 deletions libcudacxx/include/cuda/std/__atomic/order.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@

_CCCL_BEGIN_NAMESPACE_CUDA_STD

#define _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m) \
_LIBCUDACXX_DIAGNOSE_WARNING( \
__m == memory_order_consume || __m == memory_order_acquire || __m == memory_order_acq_rel, \
"memory order argument to atomic operation is invalid")

#define _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m) \
_LIBCUDACXX_DIAGNOSE_WARNING(__m == memory_order_release || __m == memory_order_acq_rel, \
"memory order argument to atomic operation is invalid")

#define _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
_LIBCUDACXX_DIAGNOSE_WARNING(__f == memory_order_release || __f == memory_order_acq_rel, \
"memory order argument to atomic operation is invalid")
#define _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m) \
_CCCL_DIAGNOSE_WARNING(__m == memory_order_consume || __m == memory_order_acquire || __m == memory_order_acq_rel, \
"memory order argument to atomic operation is invalid")

#define _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m) \
_CCCL_DIAGNOSE_WARNING(__m == memory_order_release || __m == memory_order_acq_rel, \
"memory order argument to atomic operation is invalid")

#define _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
_CCCL_DIAGNOSE_WARNING(__f == memory_order_release || __f == memory_order_acq_rel, \
"memory order argument to atomic operation is invalid")

#ifndef __ATOMIC_RELAXED
# define __ATOMIC_RELAXED 0
Expand Down
6 changes: 3 additions & 3 deletions libcudacxx/include/cuda/std/__atomic/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@

_CCCL_BEGIN_NAMESPACE_CUDA_STD

#if defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#if defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)
template <typename _Tp>
struct __atomic_is_always_lock_free
{
enum
{
__value = _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0)
__value = _CCCL_ATOMIC_ALWAYS_LOCK_FREE(sizeof(_Tp), 0)
};
};
#else
Expand All @@ -84,7 +84,7 @@ struct __atomic_is_always_lock_free
__value = sizeof(_Tp) <= 8
};
};
#endif // defined(_LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE)
#endif // defined(_CCCL_ATOMIC_ALWAYS_LOCK_FREE)

_CCCL_END_NAMESPACE_CUDA_STD

Expand Down
10 changes: 5 additions & 5 deletions libcudacxx/include/cuda/std/__atomic/types/locked.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct __atomic_locked_storage
static constexpr __atomic_tag __tag = __atomic_tag::__atomic_locked_tag;

_Tp __a_value;
mutable __atomic_storage<_LIBCUDACXX_ATOMIC_FLAG_TYPE> __a_lock;
mutable __atomic_storage<_CCCL_ATOMIC_FLAG_TYPE> __a_lock;

_CCCL_HIDE_FROM_ABI explicit constexpr __atomic_locked_storage() noexcept = default;

Expand All @@ -51,24 +51,24 @@ struct __atomic_locked_storage
template <typename _Sco>
_CCCL_HOST_DEVICE inline void __lock(_Sco) const volatile noexcept
{
while (1 == __atomic_exchange_dispatch(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(true), memory_order_acquire, _Sco{}))
while (1 == __atomic_exchange_dispatch(&__a_lock, _CCCL_ATOMIC_FLAG_TYPE(true), memory_order_acquire, _Sco{}))
/*spin*/;
}
template <typename _Sco>
_CCCL_HOST_DEVICE inline void __lock(_Sco) const noexcept
{
while (1 == __atomic_exchange_dispatch(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(true), memory_order_acquire, _Sco{}))
while (1 == __atomic_exchange_dispatch(&__a_lock, _CCCL_ATOMIC_FLAG_TYPE(true), memory_order_acquire, _Sco{}))
/*spin*/;
}
template <typename _Sco>
_CCCL_HOST_DEVICE inline void __unlock(_Sco) const volatile noexcept
{
__atomic_store_dispatch(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(false), memory_order_release, _Sco{});
__atomic_store_dispatch(&__a_lock, _CCCL_ATOMIC_FLAG_TYPE(false), memory_order_release, _Sco{});
}
template <typename _Sco>
_CCCL_HOST_DEVICE inline void __unlock(_Sco) const noexcept
{
__atomic_store_dispatch(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(false), memory_order_release, _Sco{});
__atomic_store_dispatch(&__a_lock, _CCCL_ATOMIC_FLAG_TYPE(false), memory_order_release, _Sco{});
}
};

Expand Down
Loading