ceildiv.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
7 
8 namespace raft_proto {
9 template <typename T, typename U>
10 HOST DEVICE auto constexpr ceildiv(T dividend, U divisor)
11 {
12  return (dividend + divisor - T{1}) / divisor;
13 }
14 } // namespace raft_proto
#define DEVICE
Definition: gpu_support.hpp:24
#define HOST
Definition: gpu_support.hpp:23
Definition: buffer.hpp:24
HOST DEVICE constexpr auto ceildiv(T dividend, U divisor)
Definition: ceildiv.hpp:10