brian2genn
brian2genn copied to clipboard
potential problem with handling of build_options
Sorry, @mstimberg to add to load but I discovered the following when looking into issue #129.
Device build options are used e.g. to set use_GPU
which determines whether GeNN shall build for GPU.
Normally, they are passed in set_device
such as
set_device('genn', use_GPU= False)
The way it is put together at the moment, these options are caught through **kwargs and then passed around for a bit to eventually get saved in device.build_options here: https://github.com/brian-team/brian2/blob/6e0374c628371aa4a04959df3fd423730f8e3337/brian2/devices/device.py#L338
However, if users call device.activate()
directly, e.g. after resetting the device, and if they omit the build options, they are deleted. I got myself caught up in that and think it is potentially not very intuitive to know that the options passed to set_device()
would have to also be passed when calling device.activate()
.
Should we refactor slightly so that device build options remain preserved when device.activate()
is called (as they are when device.reinit()
is called)?