Skip to content

Commit

Permalink
Make int_div_ceil callable from device
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Oct 17, 2024
1 parent f841fce commit 69a4223
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/cuco/detail/extent/extent.inl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <cuco/detail/error.hpp>
#include <cuco/detail/prime.hpp> // TODO move to detail/extent/
#include <cuco/detail/utility/math.hpp>
#include <cuco/detail/utility/math.cuh>
#include <cuco/detail/utils.hpp>
#include <cuco/utility/fast_int.cuh>

Expand Down
2 changes: 1 addition & 1 deletion include/cuco/detail/prime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#include <cuco/detail/utility/math.hpp>
#include <cuco/detail/utility/math.cuh>

#include <algorithm>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/detail/utility/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#pragma once

#include <cuco/detail/error.hpp>
#include <cuco/detail/utility/math.hpp>
#include <cuco/detail/utility/math.cuh>

namespace cuco {
namespace detail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#pragma once

#include <type_traits>
#include <cuda/std/type_traits>

namespace cuco {
namespace detail {
Expand All @@ -35,10 +35,10 @@ namespace detail {
* @return Ceiling of the integer division
*/
template <typename T, typename U>
constexpr T int_div_ceil(T dividend, U divisor) noexcept
__host__ __device__ constexpr T int_div_ceil(T dividend, U divisor) noexcept
{
static_assert(std::is_integral_v<T>);
static_assert(std::is_integral_v<U>);
static_assert(cuda::std::is_integral_v<T>);
static_assert(cuda::std::is_integral_v<U>);
return (dividend + divisor - 1) / divisor;
}

Expand Down

0 comments on commit 69a4223

Please sign in to comment.