File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,7 @@ void AllSpikingNeurons::setupVertices()
2020
2121 hasFired_.assign (size_, false );
2222 vertexEvents_.assign (size_, maxSpikes);
23- #if defined(USE_GPU)
24- // We don't allocate memory for summationPoints_ in CPU when building the GPU
25- // implementation. This is to avoid misusing it in GPU code.
26- // summationPoints_ = nullptr;
27-
28- #else
2923 summationPoints_.assign (size_, 0 );
30-
31- #endif
3224}
3325
3426// / Register spike history variables for all neurons.
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ void AllSpikingNeurons::copyToDevice(void *deviceAddress)
8484 HANDLE_ERROR (cudaMemcpy (pSpikeHistory[i], vertexEvents_[i].dataSeries_ .data (),
8585 maxSpikes * sizeof (uint64_t ), cudaMemcpyHostToDevice));
8686 }
87+
88+ HANDLE_ERROR (cudaMemcpy (allVerticesDevice.summationPoints_ , summationPoints_.data (),
89+ count * sizeof (BGFLOAT), cudaMemcpyHostToDevice));
8790}
8891void AllSpikingNeurons::copyFromDevice (void *deviceAddress)
8992{
@@ -141,6 +144,9 @@ void AllSpikingNeurons::copyFromDevice(void *deviceAddress)
141144 HANDLE_ERROR (cudaMemcpy (vertexEvents_[i].dataSeries_ .data (), pSpikeHistory[i],
142145 maxSpikes * sizeof (uint64_t *), cudaMemcpyDeviceToHost));
143146 }
147+
148+ HANDLE_ERROR (cudaMemcpy (summationPoints_.data (), allVerticesDevice.summationPoints_ ,
149+ numVertices * sizeof (BGFLOAT), cudaMemcpyDeviceToHost));
144150}
145151
146152// / Clear the spike counts out of all neurons in device memory.
You can’t perform that action at this time.
0 commit comments