Skip to content

constants

triwarp.constants

Shared numeric tolerances, sentinel values and tuning constants.

Everything here is imported from this module rather than defined next to its first user, so that a value two modules share does not make one of them import the other. Each name is spelled twice where both scopes need it: a plain Python number for host-scope arithmetic and a wp.<dtype>(...) twin (the _CONSTANT / _F64 suffixes) for the kernel scope, which fixes the precision the value enters kernel arithmetic at.

TOLERANCE_MERGE module-attribute

TOLERANCE_MERGE = 1e-08

TOLERANCE_PLANAR module-attribute

TOLERANCE_PLANAR = 1e-05

TOLERANCE_ZERO module-attribute

TOLERANCE_ZERO = 1e-12

TOLERANCE_MOLLIFY module-attribute

TOLERANCE_MOLLIFY = 1e-05

TOLERANCE_MERGE_CONSTANT module-attribute

TOLERANCE_MERGE_CONSTANT = wp.float32(TOLERANCE_MERGE)

TOLERANCE_PLANAR_CONSTANT module-attribute

TOLERANCE_PLANAR_CONSTANT = wp.float32(TOLERANCE_PLANAR)

TOLERANCE_ZERO_CONSTANT module-attribute

TOLERANCE_ZERO_CONSTANT = wp.float32(TOLERANCE_ZERO)

TOLERANCE_ZERO_F64 module-attribute

TOLERANCE_ZERO_F64 = wp.float64(TOLERANCE_ZERO)

TOLERANCE_ZERO at float64, for the predicates that widen before deciding.

INT32_MAX module-attribute

INT32_MAX = 2 ** 31 - 1

INT32_MAX_CONSTANT module-attribute

INT32_MAX_CONSTANT = wp.int32(INT32_MAX)

INT64_MAX module-attribute

INT64_MAX = 2 ** 63 - 1

UINT64_MAX module-attribute

UINT64_MAX = 2 ** 64 - 1

UINT64_MAX_CONSTANT module-attribute

UINT64_MAX_CONSTANT = wp.uint64(UINT64_MAX)

FLOAT32_INF_CONSTANT module-attribute

FLOAT32_INF_CONSTANT = wp.INF

FLOAT64_INF_CONSTANT module-attribute

FLOAT64_INF_CONSTANT = wp.float64(float('inf'))

PI module-attribute

PI = wp.PI

TWO_PI module-attribute

TWO_PI = 2 * wp.PI

TILE_1D module-attribute

TILE_1D = 64

TILE_2D module-attribute

TILE_2D = 8

TILES_PER_BLOCK_1D module-attribute

TILES_PER_BLOCK_1D = 16

ITEMS_PER_SLICE_CUDA module-attribute

ITEMS_PER_SLICE_CUDA = 128

ITEMS_PER_SLICE_CPU module-attribute

ITEMS_PER_SLICE_CPU = 32