Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - neilkichler/cuinterval: CUDA Interval Arithmetic Library
Nothing Special   »   [go: up one dir, main page]

Skip to content

neilkichler/cuinterval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CuInterval

Cpp Version CUDA Version CMake Version Docs DOI GitHub License

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

Installation

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

Single-Header

Every release creates a single-header version. The latest one can directly be downloaded using, e.g.:

wget https://github.com/neilkichler/cuinterval/releases/download/v0.2.0/cuinterval.cuh

Header-only folder

You can grab the latest header-only version from the releases page.

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/cuinterval@0.2.0")
include(FetchContent)
FetchContent_Declare(
  cuinterval
  GIT_REPOSITORY https://github.com/neilkichler/cuinterval.git
  GIT_TAG v0.2.0
)
FetchContent_MakeAvailable(cuinterval)

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

target_link_libraries(${PROJECT_NAME} PUBLIC cuinterval)

Important

When using CUDA in a CMake project, make sure that it configures the CUDA_ARCHITECTURES property using

set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES native)

where native could be replaced by specific versions, see the CMake docs for more information.

Also, currently nvcc requires relaxed constexpr support which can be enabled using

target_compile_options(${PROJECT_NAME} PUBLIC "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-relaxed-constexpr>")

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++ (GCC 13+, Clang 17+) and CUDA (12.5.1+) compiler.

Other configurations might work but are not tested.

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
0