Skip to content

Undeclared Identifier Error for Multiple Runs #129

@ademirtas04

Description

@ademirtas04

Hey there! I was running my first code on Brian2Genn, and I was trying to run the code multiple times on the same Jupyter Notebook File. It seems as though the code is looking for objects in the previous run, as it sometimes gives no error and plots a graph and other times gives the undeclared identifier error. I was wondering if I was using the device.activate() and device.reinit() methods properly, or if there is something else that I am missing.

from brian2 import *
import brian2genn

%matplotlib inline

set_device('genn')

device.reinit()
device.activate()

start_scope()

G = NeuronGroup(1, 'v : 1', threshold='v>0.6', reset='v=0', method='exact')
G.v = '0.6'
SM = StateMonitor(G, 'v', record=True)
print("Completed without Errors")

run(100*ms)
print("Ran without Errors")

plot(SM.t/ms, SM.v[0])

device.reinit()
device.activate()

ERROR PROVIDED:
neurongroup_group_variable_set_conditional_codeobject.cpp
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(8,1): warning C4005: 'INFINITY': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(88): message : see previous definition of 'INFINITY' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(9,1): warning C4005: 'NAN': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(92): message : see previous definition of 'NAN' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
statemonitor_codeobject.cpp
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(8,1): warning C4005: 'INFINITY': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(88): message : see previous definition of 'INFINITY' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(9,1): warning C4005: 'NAN': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(92): message : see previous definition of 'NAN' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
main.cpp
C:\Users\ademi\GeNNworkspace\engine.cpp(45,19): error C2065: 'vneurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\engine.cpp(51,7): error C3861: 'pullneurongroupStateFromDevice': identifier not found [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(73,47): error C2065: 'ineurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(74,47): error C2065: 'vneurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(106,15): error C2065: 'ineurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(107,15): error C2065: 'vneurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions