Skip to content

Commit 2fa7799

Browse files
authored
Merge pull request #517 from UWB-Biocomputing/issue-513-delete-summation-point
Delete summation point from AllEdges.
2 parents 673cc3a + 7abeed5 commit 2fa7799

29 files changed

+324
-380
lines changed

Simulator/Connections/Connections.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,12 @@ void Connections::createSynapsesFromWeights()
121121
// if the synapse weight is not zero (which means there is a connection), create the synapse
122122
if (edges_->W_[iEdg] != 0.0) {
123123
BGFLOAT theW = edges_->W_[iEdg];
124-
BGFLOAT *sumPoint = &(vertices.summationMap_[i]);
125124
int srcVertex = edges_->sourceVertexIndex_[iEdg];
126125
int destVertex = edges_->destVertexIndex_[iEdg];
127126
edgeType type = layout.edgType(srcVertex, destVertex);
128127
edges_->edgeCounts_[i]++;
129-
edges_->createEdge(iEdg, srcVertex, destVertex, sumPoint,
130-
Simulator::getInstance().getDeltaT(), type);
128+
edges_->createEdge(iEdg, srcVertex, destVertex, Simulator::getInstance().getDeltaT(),
129+
type);
131130
edges_->W_[iEdg] = theW;
132131
}
133132
}

Simulator/Connections/NG911/Connections911.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ void Connections911::setup()
3131
size_t srcV = gm.source(*it);
3232
size_t destV = gm.target(*it);
3333
edgeType type = layout.edgType(srcV, destV);
34-
BGFLOAT *sumPoint = &vertices.summationMap_[destV];
3534

3635
BGFLOAT dist = layout.dist_(srcV, destV);
3736
LOG4CPLUS_DEBUG(edgeLogger_, "Source: " << srcV << " Dest: " << destV << " Dist: " << dist);
3837

3938
BGSIZE iEdg;
40-
edges_->addEdge(iEdg, type, srcV, destV, sumPoint, Simulator::getInstance().getDeltaT());
39+
edges_->addEdge(iEdg, type, srcV, destV, Simulator::getInstance().getDeltaT());
4140
added++;
4241
}
4342

@@ -191,10 +190,8 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
191190
}
192191

193192
// Insert Caller to PSAP edge
194-
BGFLOAT *sumPoint = &vertices.summationMap_[closestPSAP];
195193
BGSIZE iEdg;
196-
edges_->addEdge(iEdg, CP, srcVertex, closestPSAP, sumPoint,
197-
Simulator::getInstance().getDeltaT());
194+
edges_->addEdge(iEdg, CP, srcVertex, closestPSAP, Simulator::getInstance().getDeltaT());
198195

199196
// Record added edge
200197
ChangedEdge addedEdge;
@@ -221,10 +218,8 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
221218
}
222219

223220
// Insert PSAP to Responder edge
224-
BGFLOAT *sumPoint = &vertices.summationMap_[destVertex];
225221
BGSIZE iEdg;
226-
edges_->addEdge(iEdg, PR, closestPSAP, destVertex, sumPoint,
227-
Simulator::getInstance().getDeltaT());
222+
edges_->addEdge(iEdg, PR, closestPSAP, destVertex, Simulator::getInstance().getDeltaT());
228223

229224
// Record added edge
230225
ChangedEdge addedEdge;

Simulator/Connections/Neuro/ConnGrowth.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,9 @@ void ConnGrowth::updateSynapsesWeights()
277277

278278
// if not connected and weight(a,b) > 0, add a new synapse from a to b
279279
if (!connected && (W_(srcVertex, destVertex) > 0)) {
280-
// locate summation point
281-
BGFLOAT *sumPoint = &(vertices.summationMap_[destVertex]);
282280
added++;
283-
284281
BGSIZE iEdg;
285-
synapses.addEdge(iEdg, type, srcVertex, destVertex, sumPoint,
282+
synapses.addEdge(iEdg, type, srcVertex, destVertex,
286283
Simulator::getInstance().getDeltaT());
287284
synapses.W_[iEdg] = W_(srcVertex, destVertex) * synapses.edgSign(type)
288285
* AllNeuroEdges::SYNAPSE_STRENGTH_ADJUSTMENT;

Simulator/Connections/Neuro/ConnStatic.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ void ConnStatic::setup()
7474
for (BGSIZE i = 0; i < distDestVertices[srcVertex].size() && (int)i < connsPerVertex_; i++) {
7575
int destVertex = distDestVertices[srcVertex][i].destVertex;
7676
edgeType type = layout.edgType(srcVertex, destVertex);
77-
BGFLOAT *sumPoint = &vertices.summationMap_[destVertex];
7877

7978
LOG4CPLUS_DEBUG(fileLogger_,
8079
"Source: " << srcVertex << " Dest: " << destVertex
8180
<< " Dist: " << distDestVertices[srcVertex][i].dist);
8281

8382
BGSIZE iEdg;
84-
edges_->addEdge(iEdg, type, srcVertex, destVertex, sumPoint, simulator.getDeltaT());
83+
edges_->addEdge(iEdg, type, srcVertex, destVertex, simulator.getDeltaT());
8584
added++;
8685

8786

Simulator/Core/GPUModel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ class GPUModel : public Model {
145145

146146
// TODO
147147
void addEdge(AllEdges &synapses, edgeType type, const int srcVertex, const int destVertex,
148-
Coordinate &source, Coordinate &dest, BGFLOAT *sumPoint, BGFLOAT deltaT);
148+
Coordinate &source, Coordinate &dest, BGFLOAT deltaT);
149149

150150
// TODO
151151
void createEdge(AllEdges &synapses, const int neuronIndex, const int synapseIndex,
152-
Coordinate source, Coordinate dest, BGFLOAT *sp, BGFLOAT deltaT, edgeType type);
152+
Coordinate source, Coordinate dest, BGFLOAT deltaT, edgeType type);
153153
};
154154

155155
#if defined(__CUDACC__)

Simulator/Edges/AllEdges.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ void AllEdges::setupEdges(const int numVertices, const int maxEdges)
7878
W_.assign(maxTotalEdges, 0);
7979
type_.assign(maxTotalEdges, ETYPE_UNDEF);
8080
edgeCounts_.assign(numVertices, 0);
81-
summationPoint_.assign(maxTotalEdges, nullptr);
8281
destVertexIndex_.assign(maxTotalEdges, 0);
8382
sourceVertexIndex_.assign(maxTotalEdges, 0);
8483

@@ -243,7 +242,6 @@ void AllEdges::eraseEdge(const int iVert, const BGSIZE iEdg)
243242
{
244243
edgeCounts_[iVert]--;
245244
inUse_[iEdg] = false;
246-
summationPoint_[iEdg] = nullptr;
247245
W_[iEdg] = 0;
248246
}
249247

@@ -256,10 +254,9 @@ void AllEdges::eraseEdge(const int iVert, const BGSIZE iEdg)
256254
/// @param type The type of the edge to add.
257255
/// @param srcVertex The Vertex that sends to this edge.
258256
/// @param destVertex The Vertex that receives from the edge.
259-
/// @param sumPoint Summation point address.
260257
/// @param deltaT Inner simulation step duration
261258
void AllEdges::addEdge(BGSIZE &iEdg, edgeType type, const int srcVertex, const int destVertex,
262-
BGFLOAT *sumPoint, const BGFLOAT deltaT)
259+
const BGFLOAT deltaT)
263260
{
264261
if (edgeCounts_[destVertex] >= maxEdgesPerVertex_) {
265262
LOG4CPLUS_FATAL(edgeLogger_, "Vertex : " << destVertex << " ran out of space for new edges.");
@@ -280,5 +277,5 @@ void AllEdges::addEdge(BGSIZE &iEdg, edgeType type, const int srcVertex, const i
280277
edgeCounts_[destVertex]++;
281278

282279
// create an edge
283-
createEdge(iEdg, srcVertex, destVertex, sumPoint, deltaT, type);
280+
createEdge(iEdg, srcVertex, destVertex, deltaT, type);
284281
}

Simulator/Edges/AllEdges.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,19 @@ class AllEdges {
4040
/// @param type The type of the Edge to add.
4141
/// @param srcVertex The Vertex that sends to this Edge.
4242
/// @param destVertex The Vertex that receives from the Edge.
43-
/// @param sumPoint Summation point address.
4443
/// @param deltaT Inner simulation step duration
4544
virtual void addEdge(BGSIZE &iEdg, edgeType type, const int srcVertex, const int destVertex,
46-
BGFLOAT *sumPoint, const BGFLOAT deltaT);
45+
const BGFLOAT deltaT);
4746

4847
/// Create a Edge and connect it to the model.
4948
///
5049
/// @param iEdg Index of the edge to set.
5150
/// @param srcVertex Coordinates of the source Vertex.
5251
/// @param destVertex Coordinates of the destination Vertex.
53-
/// @param sumPoint Summation point address.
5452
/// @param deltaT Inner simulation step duration.
5553
/// @param type Type of the Edge to create.
56-
virtual void createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, BGFLOAT *sumPoint,
57-
const BGFLOAT deltaT, edgeType type)
54+
virtual void createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, const BGFLOAT deltaT,
55+
edgeType type)
5856
= 0;
5957

6058
/// Populate a edge index map.
@@ -206,9 +204,6 @@ class AllEdges {
206204
/// The weight (scaling factor, strength, maximal amplitude) of the edge.
207205
vector<BGFLOAT> W_;
208206

209-
/// This edge's summation point's address.
210-
vector<BGFLOAT *> summationPoint_;
211-
212207
/// Synapse type
213208
vector<edgeType> type_;
214209

Simulator/Edges/NG911/All911Edges.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,17 @@ void All911Edges::setupEdges()
3737
W_.assign(maxTotalEdges, 0);
3838
type_.assign(maxTotalEdges, ETYPE_UNDEF);
3939
edgeCounts_.assign(numVertices, 0);
40-
summationPoint_.assign(maxTotalEdges, nullptr);
4140
destVertexIndex_.assign(maxTotalEdges, 0);
4241
sourceVertexIndex_.assign(maxTotalEdges, 0);
4342
inUse_ = make_unique<bool[]>(maxTotalEdges);
4443
fill_n(inUse_.get(), maxTotalEdges, false);
4544
}
4645
}
4746

48-
void All911Edges::createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, BGFLOAT *sumPoint,
49-
const BGFLOAT deltaT, edgeType type)
47+
void All911Edges::createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, const BGFLOAT deltaT,
48+
edgeType type)
5049
{
5150
inUse_[iEdg] = true;
52-
summationPoint_[iEdg] = sumPoint;
5351
destVertexIndex_[iEdg] = destVertex;
5452
sourceVertexIndex_[iEdg] = srcVertex;
5553
W_[iEdg] = 10; // Figure this out

Simulator/Edges/NG911/All911Edges.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@ class All911Edges : public AllEdges {
5252
/// @param iEdg Index of the edge to set.
5353
/// @param srcVertex Coordinates of the source Vertex.
5454
/// @param destVertex Coordinates of the destination Vertex.
55-
/// @param sumPoint Summation point address.
5655
/// @param deltaT Inner simulation step duration.
5756
/// @param type Type of the Edge to create.
58-
virtual void createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, BGFLOAT *sumPoint,
59-
const BGFLOAT deltaT, edgeType type) override;
57+
virtual void createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, const BGFLOAT deltaT,
58+
edgeType type) override;
6059

6160
protected:
6261
#if defined(USE_GPU)

Simulator/Edges/Neuro/AllDSSynapses.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,14 @@ void AllDSSynapses::resetEdge(const BGSIZE iEdg, const BGFLOAT deltaT)
108108
/// Create a Synapse and connect it to the model.
109109
///
110110
/// @param iEdg Index of the synapse to set.
111-
/// @param srcVertex Coordinates of the source Neuron.
112-
/// @param destVertex Coordinates of the destination Neuron.
113-
/// @param sumPoint Summation point address.
111+
/// @param srcVertex Coordinates of the source Neuron.
112+
/// @param destVertex Coordinates of the destination Neuron.
114113
/// @param deltaT Inner simulation step duration.
115114
/// @param type Type of the Synapse to create.
116-
void AllDSSynapses::createEdge(const BGSIZE iEdg, int srcVertex, int destVertex, BGFLOAT *sumPoint,
115+
void AllDSSynapses::createEdge(const BGSIZE iEdg, int srcVertex, int destVertex,
117116
const BGFLOAT deltaT, edgeType type)
118117
{
119-
AllSpikingSynapses::createEdge(iEdg, srcVertex, destVertex, sumPoint, deltaT, type);
118+
AllSpikingSynapses::createEdge(iEdg, srcVertex, destVertex, deltaT, type);
120119

121120
U_[iEdg] = DEFAULT_U;
122121

0 commit comments

Comments
 (0)