Memory management

Core interface:

CuArrays.allocFunction
alloc(sz)

Allocate a number of bytes sz from the memory pool. Returns a CuPtr{Nothing}; may throw a OutOfGPUMemoryError if the allocation request cannot be satisfied.

CuArrays.freeFunction
free(sz)

Releases a buffer pointed to by ptr to the memory pool.

CuArrays.OutOfGPUMemoryErrorType
OutOfGPUMemoryError()

An operation allocated too much GPU memory for either the system or the memory pool to handle properly.

Functionality to work with external allocations:

CuArrays.reclaimFunction
reclaim([sz=typemax(Int)])

Reclaims sz bytes of cached memory. Use this to free GPU memory before calling into functionality that does not use the CuArrays memory pool. Returns the number of bytes actually reclaimed.

Missing docstring.

Missing docstring for CuArrays.extalloc. Check Documenter's build log for details.

Utilities

CuArrays.@allocatedMacro
@allocated

A macro to evaluate an expression, discarding the resulting value, instead returning the total number of bytes allocated during evaluation of the expression.

CuArrays.@timeMacro
@time ex

Run expression ex and report on execution time and GPU/CPU memory behavior. The GPU is synchronized right before and after executing ex to exclude any external effects.

CuArrays.memory_statusFunction
memory_status([io=stdout])

Report to io on the memory status of the current GPU and the active memory pool.

Debug timers

CuArrays.reset_timers!Method
reset_timers!()

Reset all debug timers. This is automatically called at initialization time,