Skip to content

Commit

Permalink
Uninitialised variable not copied to device in Izh_sparse
Browse files Browse the repository at this point in the history
A very minor edit to Izh_sparse. The inhibitory U variable is an `uninitialisedVar()`, initialised on host, but is not copied to device since it is not set to `varMode::LOC_HOST_DEVICE_INIT_HOST`. This is causing undefined behaviour.

Is this a more general problem with uninitialised vars, where a user may be unaware that their host-initialised vars are not copied over when copy-to-device is called? It certainly tripped me up for a while.
  • Loading branch information
jamesturner246 authored Apr 13, 2019
1 parent 511d6e2 commit 59a9044
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions userproject/Izh_sparse_project/model/Izh_sparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void modelDefinition(NNmodel &model)

// Override the variable mode of V and b so they can be used to calculate U on host
inh->setVarMode("V", VarMode::LOC_HOST_DEVICE_INIT_HOST);
inh->setVarMode("U", VarMode::LOC_HOST_DEVICE_INIT_HOST);
inh->setVarMode("b", VarMode::LOC_HOST_DEVICE_INIT_HOST);

model.addSynapsePopulation<WeightUpdateModels::StaticPulse, PostsynapticModels::DeltaCurr>("Exc_Exc", SynapseMatrixType::SPARSE_INDIVIDUALG, NO_DELAY,
Expand Down

0 comments on commit 59a9044

Please sign in to comment.