Skip to content
New issue

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

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

Already on GitHub? # to your account

Custom header files are missing when used in device.insert_code calls #131

Closed
denisalevi opened this issue Sep 7, 2021 · 1 comment
Closed

Comments

@denisalevi
Copy link
Member

Hi there,

I'm trying to run benchmarks on the newest releases of GeNN (4.5.1) and brian2GeNN (1.6) and wanted to use the insert_code mechanism which you used for the brian2geNN paper benchmarks (https://github.com/brian-team/brian2genn_benchmarks).

I used the <chrono> library for time point measurements, which I included via prefs.codegen.cpp.headers. This fails because the custom header is not included into model.cpp, which does includes code_lines blocks, which are filled via the insert_code mechanism.

This example reproduces the issue

from brian2 import *
import brian2genn

set_device('genn')

prefs.codegen.cpp.headers += ['<chrono>']
device.insert_code(
    "before_start", "std::chrono::high_resolution_clock::time_point _time_point;"
)

run(0*second)

I'll open a PR with a fix.

@denisalevi
Copy link
Member Author

Closed with PR #132

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

No branches or pull requests

1 participant