warp.fem.TemporaryStore#

class warp.fem.TemporaryStore[source]#

Shared pool of temporary arrays that will be persisted and reused across invocations of warp.fem functions.

A TemporaryStore instance may either be passed explicitly to warp.fem functions that accept such an argument, for instance integrate.integrate(), or can be set globally as the default store using set_default_temporary_store().

By default, there is no default temporary store, so that temporary allocations are not persisted.

__init__()[source]#

Methods

__init__()

add_temporary_convenience_methods(temporary)

borrow(shape, dtype[, pinned, device, ...])

clear()

class Pool(dtype, device, pinned)[source]#
Parameters:

pinned (bool)

class Deleter(pool)[source]#
Parameters:

pool (TemporaryStore.Pool)

detach(temporary)[source]#
Parameters:

temporary (array)

borrow(shape, dtype, requires_grad)[source]#
Parameters:

requires_grad (bool)

redeem(ptr)[source]#
Parameters:

ptr (int)

detach(array)[source]#
Parameters:

array (array)

clear()[source]#
borrow(
shape,
dtype,
pinned=False,
device=None,
requires_grad=False,
)[source]#
Parameters:
Return type:

array

static add_temporary_convenience_methods(temporary)[source]#
Parameters:

temporary (array)

Return type:

array