Speclib  0.1.2
The library for writing better CUDA libraries
Arbitrary Precision Integers

Integer types of any width. More...

Typedefs

template<int Bits>
using __uint = unsigned _ExtInt(Bits)
 Arbitrary length fixed-width unsigned integer. More...
 
template<int Bits>
using __int = _ExtInt(Bits)
 Arbitrary length fixed-width signed integer. More...
 

Detailed Description

Integer types of any width.

These allow you to use metaprogramming to select the size of your ints, or to simply use any width of int you like. The compiler does a much better job than nvcc or vanilla clang when it comes to handling longer ints, so feel free to use things like __uint<128> to do arithmetic.

These are also useful for things like emitting the narrowest possible sort key for radix sorts.

Typedef Documentation

◆ __int

template<int Bits>
using __int = _ExtInt(Bits)

Arbitrary length fixed-width signed integer.

◆ __uint

template<int Bits>
using __uint = unsigned _ExtInt(Bits)

Arbitrary length fixed-width unsigned integer.

This allows you to use template meteprogramming to select the type of your integers.