estimate_ram_usage#

estimate_ram_usage(shape1, shape2, matching_method, ncores, analyzer_method=None, backend=None, float_nbytes=4, complex_nbytes=8, integer_nbytes=4)[source]#

Estimate the RAM usage for a given convolution operation based on input shapes, matching_method, and number of cores.

Parameters:
shape1tuple

The shape of the input target.

shape2tuple

The shape of the input template.

matching_methodstr

The method used for the operation.

is_gpubool, optional

Whether the computation is performed on GPU. This factors in FFT plan caching.

analyzer_methodstr, optional

The method used for score analysis.

backendstr, optional

Backend used for computation.

ncoresint

The number of CPU cores used for the operation.

float_nbytesint

Number of bytes of the used float, e.g. 4 for float32.

complex_nbytesint

Number of bytes of the used complex, e.g. 8 for complex64.

integer_nbytesint

Number of bytes of the used integer, e.g. 4 for int32.

Returns:
int

The estimated RAM usage for the operation in bytes.

Raises:
ValueError

If an unsupported matching_methode is provided.

Notes

Residual memory from other objects that may remain allocated during template matching, e.g. the full sized target when using splitting, are not considered by this function.