Skip to content

neilkichler/cuinterval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

63899db · Feb 26, 2025
Feb 10, 2025
Feb 26, 2025
Feb 21, 2025
Feb 19, 2025
Feb 13, 2025
Mar 13, 2024
Feb 1, 2024
Mar 19, 2024
Jun 28, 2024
Feb 26, 2025
Feb 28, 2024
Jan 30, 2025

Repository files navigation

CuInterval

CuInterval is a CUDA interval arithmetic library. It includes all fundamental and set-based interval operations of the IEEE Standard for Interval Arithmetic. Other flavors, including decorations are not supported.

Supported Operations

The following operations are implemented as CUDA kernels. All operations are correctly-rounded, given the limitations of the precision of the underlying CUDA operation. The tightest interval is always a subset of the computed interval. The lower and upper bounds of the basic operations are at most 3 ulps away from the lower and upper bounds of the tightest interval, respectively. The error for a particular operation is given below.

Basic Operations
Operation Function Description Error [ulps]
pos IR IR 0
neg IR IR 0
add IR 2 IR 0
sub IR 2 IR 0
mul IR 2 IR 0
div IR 2 IR 0
recip IR IR 0
sqr IR IR 0
sqrt IR IR 0
fma IR 3 IR 0
Power functions
Operation Function Description Error [ulps]
pown IR × N IR 0 1
pow IR 2 IR 0 1
rootn IR 0 × N IR 2
cbrt IR 0 IR 1
exp IR IR 3
exp2 IR IR 3
exp10 IR IR 3
expm1 IR IR 3
log IR 0 IR 3
log2 IR 0 IR 3
log10 IR 0 IR 3
log1p IR 1 IR 3
Trigonometric functions
Operation Function Description Error [ulps]
sin IR IR 2
cos IR IR 2
tan IR IR 3
asin IR IR 3
acos IR IR 3
atan IR IR 3
atan2 IR 2 IR 3
cot IR IR 2
sinpi IR IR 3
cospi IR IR 3
Hyperbolic functions
Operation Function Description Error [ulps]
sinh IR IR 3
cosh IR IR 2
tanh IR IR 2
asinh IR IR 3
acosh IR IR 3
atanh IR IR 3
Special functions
Operation Function Description Error [ulps]
erf IR IR 2
erfc IR IR 5
Integer functions
Operation Function Description Error [ulps]
sign IR { 1 , 0 , 1 } 0
ceil IR Z 0
floor IR Z 0
trunc IR Z 0
roundTiesToEven IR Z 0
roundTiesToAway IR Z 0
Absmax functions
Operation Function Description Error [ulps]
abs IR IR 0 0
min IR 2 IR 0
max IR 2 IR 0
Numeric functions
Operation Function Description Error [ulps]
inf IR R 0
sup IR R 0
mid IR R 0
wid IR R 0
rad IR R 0
mag IR R 0
mig IR R 0
Boolean functions
Operation Function Description Error [ulps]
equal IR 2 B 0
subset IR 2 B 0
interior IR 2 B 0
disjoint IR 2 B 0
isEmpty IR B 0
isEntire IR B 0
less IR 2 B 0
strictLess IR 2 B 0
precedes IR 2 B 0
strictPrecedes IR 2 B 0
isMember R × IR B 0
isSingleton IR B 0
isCommonInterval IR B 0
Set operations
Operation Function Description Error [ulps]
intersection IR 2 IR 0
convexHull IR 2 IR 0
Cancellative add and subtract
Operation Function Description Error [ulps]
cancelMinus IR 2 IR 0
cancelPlus IR 2 IR 0

Installation

Please make sure that you have installed everything mentioned in the section Build Requirements.

System-wide

git clone https://github.com/neilkichler/cuinterval.git
cd cuinterval
cmake --preset release
cmake --build build
cmake --install build

CMake Project

CPMAddPackage("gh:neilkichler/[email protected]")
include(FetchContent)
FetchContent_Declare(
  cuinterval
  GIT_REPOSITORY [email protected]:neilkichler/cuinterval.git
  GIT_TAG main
)
FetchContent_MakeAvailable(cuinterval)

In either case, you can link to the library using:

target_link_libraries(${PROJECT_NAME} PUBLIC cuinterval)

Example

Have a look at the examples folder.

Documentation

The documentation is available here.

Build

Build Requirements

We use C++20, CMake v3.25.2+, Ninja (optional), and a recent C++ and CUDA compiler.

Ubuntu

apt install cmake gcc ninja-build

Cluster

module load CMake CUDA GCC Ninja

Build and run tests

Using Workflows

cmake --workflow --preset dev

Using Presets

cmake --preset debug
cmake --build --preset debug
ctest --preset debug

Using regular CMake

cmake -S . -B build -GNinja
cmake --build build
./build/tests/tests

About

CUDA Interval Arithmetic Library

Topics

Resources

License

Stars

Watchers

Forks