utils package

Utility functions for Brian2CUDA

gputools module

Tools to get information about available GPUs.

Functions

get_available_gpus()

Return list of names of available GPUs, sorted by GPU ID as reported in nvidia-smi

get_best_gpu()

Get the "best" GPU available.

get_compute_capability(gpu_id)

Get compute capability of GPU with ID gpu_id.

get_cuda_installation()

Return new dictionary of cuda installation variables

get_cuda_path()

Detect the path to the CUDA installation (e.g.

get_cuda_runtime_version()

Return CUDA runtime version (as float, e.g.

get_gpu_selection()

Return dictionary of selected gpu variable

get_nvcc_path()

Return the path to the nvcc binary.

reset_cuda_installation()

Reset detected CUDA installation.

reset_gpu_selection()

Reset selected GPU.

restore_cuda_installation(cuda_installation)

Set global cuda installation dictionary to cuda_installation

restore_gpu_selection(gpu_selection)

Set global gpu selection dictionary to gpu_selection

select_gpu()

Select GPU for simulation, based on user preference prefs.devices.cuda_standalone.cuda_backend.gpu_id or (if not provided) pick the GPU with highest compute capability.

logger module

Brian2CUDA’s logging system extensions

Exported members: suppress_brian2_logs

Functions

suppress_brian2_logs()

Suppress all logs coming from brian2.

stringtools module

Brian2CUDA regex functions.

Functions

append_f(match)

Append 'f' to the string in match if it doesn't end with 'f'.

replace_floating_point_literals(code)

Replace double-precision floating-point literals in code by single-precision literals.