Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potential problem with handling of build_options #130

Open
tnowotny opened this issue Aug 16, 2021 · 0 comments
Open

potential problem with handling of build_options #130

tnowotny opened this issue Aug 16, 2021 · 0 comments

Comments

@tnowotny
Copy link
Contributor

tnowotny commented Aug 16, 2021

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant