Skip to content
Merged
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
12 changes: 10 additions & 2 deletions src/care/host_device_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "chai/ManagedArray.hpp"

// Std library headers
#include <concepts>
#include <cstddef>


Expand Down Expand Up @@ -93,9 +94,16 @@ namespace care {
///
/// @author Peter Robinson
///
/// nullptr constructor
/// Construct from nullptr
///
CARE_HOST_DEVICE host_device_ptr(std::nullptr_t from) noexcept : MA (from) {}
/// @note The constraint prevents overload ambiguity between this
/// constructor and the size_t constructor when constructing
/// with the integer literal 0. Additionally, the constraint
/// is a workaround for a nvcc bug where overload resolution
/// can incorrectly report an ambiguity between this constructor
/// and the size_t constructor.
///
CARE_HOST_DEVICE host_device_ptr(std::same_as<std::nullptr_t> auto from) noexcept : MA (from) {}

///
/// Construct from a size
Expand Down
Loading