alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
utility.hpp File Reference
#include "alpaka/core/common.hpp"
#include <algorithm>
#include <bit>
#include <climits>
#include <concepts>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  alpaka
 main alpaka namespace.
namespace  alpaka::concepts
namespace  alpaka::core

Concepts

concept  alpaka::concepts::SpecializationOf
 Validates if T is a specialization of the unspecialized template type U.

Functions

template<std::integral Integral>
ALPAKA_FN_HOST_ACC constexpr auto alpaka::divCeil (Integral a, Integral b) -> Integral
 Returns the ceiling of a / b, as integer.
template<std::integral Integral>
ALPAKA_FN_HOST_ACC constexpr auto alpaka::divExZero (Integral a, Integral b) -> Integral
 Returns the max(a / b, 1) as integer.
template<std::integral T>
constexpr T alpaka::firstSetBit (T value)
template<typename Integral, typename = std::enable_if_t<std::is_integral_v<Integral>>>
ALPAKA_FN_HOST_ACC constexpr auto alpaka::intPow (Integral base, Integral n) -> Integral
 Computes the nth power of base, in integers.
constexpr auto alpaka::ipow (std::integral auto const base, std::integral auto const exponent)
 Helper function calculating the integer power for the given base and exponent.
template<typename Integral, typename = std::enable_if_t<std::is_integral_v<Integral>>>
ALPAKA_FN_HOST_ACC constexpr auto alpaka::nthRootFloor (Integral value, Integral n) -> Integral
 Computes the floor of the nth root of value, in integers.
template<std::integral T>
constexpr T alpaka::roundDownToPowerOfTwo (T value)
 round to the next power of two which is equal or lower to the value

Variables

template<typename T, template< typename... > typename U>
constexpr bool alpaka::isSpecializationOf_v = std::false_type{}
 checks if T is a instance of U
template<template< typename... > typename U, typename... Vs>
constexpr bool alpaka::isSpecializationOf_v< U< Vs... >, U > = std::true_type{}
 checks if T is a instance of U