Skip to content

Commit

Permalink
instances in include
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Dec 6, 2024
1 parent 001f3be commit 3bbfdba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cpp/include/cudf/detail/utilities/device_operators.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ struct DeviceSum {
template <typename T, std::enable_if_t<cudf::is_fixed_point<T>()>* = nullptr>
static constexpr T identity()
{
#ifndef __CUDA_ARCH__
CUDF_FAIL("fixed_point does not yet support device operator identity");
#else
CUDF_UNREACHABLE("fixed_point does not yet support device operator identity");
#endif
return T{};
}
};
Expand Down Expand Up @@ -141,7 +145,11 @@ struct DeviceMin {
template <typename T, std::enable_if_t<cudf::is_fixed_point<T>()>* = nullptr>
static constexpr T identity()
{
#ifndef __CUDA_ARCH__
CUDF_FAIL("fixed_point does not yet support DeviceMin identity");
#else
CUDF_UNREACHABLE("fixed_point does not yet support DeviceMin identity");
#endif
return cuda::std::numeric_limits<T>::max();
}

Expand Down Expand Up @@ -189,7 +197,11 @@ struct DeviceMax {
template <typename T, std::enable_if_t<cudf::is_fixed_point<T>()>* = nullptr>
static constexpr T identity()
{
#ifndef __CUDA_ARCH__
CUDF_FAIL("fixed_point does not yet support DeviceMax identity");
#else
CUDF_UNREACHABLE("fixed_point does not yet support DeviceMax identity");
#endif
return cuda::std::numeric_limits<T>::lowest();
}

Expand Down Expand Up @@ -225,7 +237,11 @@ struct DeviceProduct {
template <typename T, std::enable_if_t<cudf::is_fixed_point<T>()>* = nullptr>
static constexpr T identity()
{
#ifndef __CUDA_ARCH__
CUDF_FAIL("fixed_point does not yet support DeviceProduct identity");
#else
CUDF_UNREACHABLE("fixed_point does not yet support DeviceProduct identity");
#endif
return T{1, numeric::scale_type{0}};
}
};
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/cudf/utilities/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ class base_2dspan {
constexpr base_2dspan(RowType<T, dynamic_extent> flat_view, size_t columns)
: _flat{flat_view}, _size{columns == 0 ? 0 : flat_view.size() / columns, columns}
{
#ifndef __CUDA_ARCH__
CUDF_EXPECTS(_size.first * _size.second == flat_view.size(), "Invalid 2D span size");
#endif
}

/**
Expand Down

0 comments on commit 3bbfdba

Please sign in to comment.