Skip to content

Commit 7f5a172

Browse files
reverted cmakelists back to kepler
1 parent 6ff3102 commit 7f5a172

37 files changed

+212
-216
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ cmake_minimum_required(VERSION 3.12)
1212
#
1313
#"YES" / GPU choice only available if CUDA library is installed and the GPU is CUDA capable.
1414
############################################################################################
15-
1615
if(NOT ENABLE_CUDA)
1716
set(ENABLE_CUDA NO)
1817
endif()

Simulator/Connections/Connections.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Connections::Connections()
3838

3939
// Register loadParameters function with Operation Manager
4040
function<void()> loadParamsFunc = bind(&Connections::loadParameters, this);
41-
opsManager.registerOperation(Operations::op::loadParameters, loadParamsFunc);
41+
opsManager.registerOperation(Operations::loadParameters, loadParamsFunc);
4242

4343
// Register registerGraphProperties as Operations registerGraphProperties
4444
function<void()> regGraphPropsFunc = bind(&Connections::registerGraphProperties, this);

Simulator/Connections/NG911/Connections911.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ BGSIZE Connections911::getEdgeToClosestResponder(const Call &call, BGSIZE vertex
9797

9898
vertexType requiredType;
9999
if (call.type == "Law")
100-
requiredType = LAW;
100+
requiredType = vertexType::LAW;
101101
else if (call.type == "EMS")
102-
requiredType = EMS;
102+
requiredType = vertexType::EMS;
103103
else if (call.type == "Fire")
104-
requiredType = FIRE;
104+
requiredType = vertexType::FIRE;
105105

106106
// loop over the outgoing edges looking for the responder with the shortest
107107
// Euclidean distance to the call's location.
@@ -145,7 +145,7 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
145145

146146
// Find all psaps
147147
for (int i = 0; i < numVertices; i++) {
148-
if (layout.vertexTypeMap_[i] == PSAP) {
148+
if (layout.vertexTypeMap_[i] == vertexType::PSAP) {
149149
psaps.push_back(i);
150150
}
151151
}
@@ -189,13 +189,13 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
189189
edges_->eraseEdge(destVertex, iEdg);
190190

191191
// Identify all psap-less callers
192-
if (layout.vertexTypeMap_[srcVertex] == CALR) {
192+
if (layout.vertexTypeMap_[srcVertex] == vertexType::CALR) {
193193
callersToReroute.push_back(srcVertex);
194194
}
195195

196196
// Identify all psap-less responders
197-
if (layout.vertexTypeMap_[destVertex] == LAW || layout.vertexTypeMap_[destVertex] == FIRE
198-
|| layout.vertexTypeMap_[destVertex] == EMS) {
197+
if (layout.vertexTypeMap_[destVertex] == vertexType::LAW || layout.vertexTypeMap_[destVertex] == vertexType::FIRE
198+
|| layout.vertexTypeMap_[destVertex] == vertexType::EMS) {
199199
respsToReroute.push_back(destVertex);
200200
}
201201
}
@@ -204,7 +204,7 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
204204
if (changesMade) {
205205
// This is here so that we don't delete the vertex if we can't find any edges
206206
verticesErased.push_back(randPSAP);
207-
layout.vertexTypeMap_[randPSAP] = VTYPE_UNDEF;
207+
layout.vertexTypeMap_[randPSAP] = vertexType::VTYPE_UNDEF;
208208
}
209209

210210
// Failsafe
@@ -230,13 +230,13 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
230230

231231
// Insert Caller to PSAP edge
232232
BGSIZE iEdg
233-
= edges_->addEdge(CP, srcVertex, closestPSAP, Simulator::getInstance().getDeltaT());
233+
= edges_->addEdge(edgeType::CP, srcVertex, closestPSAP, Simulator::getInstance().getDeltaT());
234234

235235
// Record added edge
236236
ChangedEdge addedEdge;
237237
addedEdge.srcV = srcVertex;
238238
addedEdge.destV = closestPSAP;
239-
addedEdge.eType = CP;
239+
addedEdge.eType = edgeType::CP;
240240
edgesAdded.push_back(addedEdge);
241241
}
242242

@@ -258,13 +258,13 @@ bool Connections911::erasePSAP(AllVertices &vertices, Layout &layout)
258258

259259
// Insert PSAP to Responder edge
260260
BGSIZE iEdg
261-
= edges_->addEdge(PR, closestPSAP, destVertex, Simulator::getInstance().getDeltaT());
261+
= edges_->addEdge(edgeType::PR, closestPSAP, destVertex, Simulator::getInstance().getDeltaT());
262262

263263
// Record added edge
264264
ChangedEdge addedEdge;
265265
addedEdge.srcV = closestPSAP;
266266
addedEdge.destV = destVertex;
267-
addedEdge.eType = PR;
267+
addedEdge.eType = edgeType::PR;
268268
edgesAdded.push_back(addedEdge);
269269
}
270270

@@ -281,8 +281,8 @@ bool Connections911::eraseRESP(AllVertices &vertices, Layout &layout)
281281

282282
// Find all resps
283283
for (int i = 0; i < numVertices; i++) {
284-
if (layout.vertexTypeMap_[i] == LAW || layout.vertexTypeMap_[i] == FIRE
285-
|| layout.vertexTypeMap_[i] == EMS) {
284+
if (layout.vertexTypeMap_[i] == vertexType::LAW || layout.vertexTypeMap_[i] == vertexType::FIRE
285+
|| layout.vertexTypeMap_[i] == vertexType::EMS) {
286286
resps.push_back(i);
287287
}
288288
}
@@ -325,7 +325,7 @@ bool Connections911::eraseRESP(AllVertices &vertices, Layout &layout)
325325
if (changesMade) {
326326
// This is here so that we don't delete the vertex if we can't find any edges
327327
verticesErased.push_back(randRESP);
328-
layout.vertexTypeMap_[randRESP] = VTYPE_UNDEF;
328+
layout.vertexTypeMap_[randRESP] = vertexType::VTYPE_UNDEF;
329329
}
330330

331331
return changesMade;
@@ -339,22 +339,22 @@ string Connections911::ChangedEdge::toString()
339339
string type_s;
340340

341341
switch (eType) {
342-
case CP:
342+
case edgeType::CP:
343343
type_s = "CP";
344344
break;
345-
case PR:
345+
case edgeType::PR:
346346
type_s = "PR";
347347
break;
348-
case PP:
348+
case edgeType::PP:
349349
type_s = "PP";
350350
break;
351-
case PC:
351+
case edgeType::PC:
352352
type_s = "PC";
353353
break;
354-
case RP:
354+
case edgeType::RP:
355355
type_s = "RP";
356356
break;
357-
case RC:
357+
case edgeType::RC:
358358
type_s = "RC";
359359
break;
360360
default:

Simulator/Core/FunctionNodes/GenericFunctionNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
#include <functional>
1515

1616
/// Constructor, Function Signature: void ()
17-
GenericFunctionNode::GenericFunctionNode(const Operations::op &operation,
17+
GenericFunctionNode::GenericFunctionNode(const Operations &operation,
1818
const std::function<void()> &func)
1919
{
2020
operationType_ = operation;
2121
function_ = func;
2222
}
2323

2424
/// Invokes the stored function if the sent operation type matches the operation type the function is stored as.
25-
bool GenericFunctionNode::invokeFunction(const Operations::op &operation) const
25+
bool GenericFunctionNode::invokeFunction(const Operations &operation) const
2626
{
2727
if (operation == operationType_) {
2828
__invoke(function_);

Simulator/Core/FunctionNodes/GenericFunctionNode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ using namespace std;
1717
class GenericFunctionNode : public IFunctionNode {
1818
public:
1919
/// Constructor, Function Signature: void ()
20-
GenericFunctionNode(const Operations::op &operationType, const std::function<void()> &function);
20+
GenericFunctionNode(const Operations &operationType, const std::function<void()> &function);
2121

2222
/// Destructor
2323
~GenericFunctionNode() = default;
2424

2525
/// Invokes the stored function if the sent operation type matches the operation type the function is stored as.
26-
bool invokeFunction(const Operations::op &operation) const override;
26+
bool invokeFunction(const Operations &operation) const override;
2727

2828
private:
2929
std::function<void()> function_; ///< Stored function.

Simulator/Core/FunctionNodes/IFunctionNode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class IFunctionNode {
1919
virtual ~IFunctionNode() = default;
2020

2121
/// Invokes the stored function if the sent operation type matches the operation type the function is stored as.
22-
virtual bool invokeFunction(const Operations::op &operation) const = 0;
22+
virtual bool invokeFunction(const Operations &operation) const = 0;
2323

2424
protected:
2525
/// The operation type of the stored function.
26-
Operations::op operationType_;
26+
Operations operationType_;
2727
};

Simulator/Core/OperationManager.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ OperationManager &OperationManager::getInstance()
2727
/// Called by lower level classes constructors on creation to register their operations with their operation type.
2828
/// This method can be overloaded to handle different function signatures.
2929
/// Handles function signature: void ()
30-
void OperationManager::registerOperation(const Operations::op &operation,
30+
void OperationManager::registerOperation(const Operations &operation,
3131
const function<void()> &function)
3232
{
3333
try {
@@ -41,7 +41,7 @@ void OperationManager::registerOperation(const Operations::op &operation,
4141
}
4242

4343
/// Takes in a operation type and invokes all registered functions that are classified as that operation type.
44-
void OperationManager::executeOperation(const Operations::op &operation) const
44+
void OperationManager::executeOperation(const Operations &operation) const
4545
{
4646
LOG4CPLUS_INFO(logger_, "Executing operation " + operationToString(operation));
4747
if (functionList_.size() > 0) {
@@ -52,24 +52,24 @@ void OperationManager::executeOperation(const Operations::op &operation) const
5252
}
5353

5454
/// Takes in the operation enum and returns the enum as a string. Used for debugging purposes.
55-
string OperationManager::operationToString(const Operations::op &operation) const
55+
string OperationManager::operationToString(const Operations &operation) const
5656
{
5757
switch (operation) {
58-
case Operations::op::printParameters:
58+
case Operations::printParameters:
5959
return "printParameters";
60-
case Operations::op::loadParameters:
60+
case Operations::loadParameters:
6161
return "loadParameters";
62-
case Operations::op::serialize:
62+
case Operations::serialize:
6363
return "serialize";
64-
case Operations::op::deserialize:
64+
case Operations::deserialize:
6565
return "deserialize";
66-
case Operations::op::deallocateGPUMemory:
66+
case Operations::deallocateGPUMemory:
6767
return "deallocateGPUMemory";
68-
case Operations::op::restoreToDefault:
68+
case Operations::restoreToDefault:
6969
return "restoreToDefault";
70-
case Operations::op::copyToGPU:
70+
case Operations::copyToGPU:
7171
return "copyToGPU";
72-
case Operations::op::copyFromGPU:
72+
case Operations::copyFromGPU:
7373
return "copyFromGPU";
7474
default:
7575
return "Operation isn't in OperationManager::operationToString()";

Simulator/Core/OperationManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class OperationManager {
3333
/// Called by lower level classes constructors on creation to register their operations with their operation type.
3434
/// This method can be overloaded to handle different function signatures.
3535
/// Handles function signature: void ()
36-
void registerOperation(const Operations::op &operation, const function<void()> &function);
36+
void registerOperation(const Operations &operation, const function<void()> &function);
3737

3838
/// Takes in a operation type and invokes all registered functions that are classified as that operation type.
39-
void executeOperation(const Operations::op &operation) const;
39+
void executeOperation(const Operations &operation) const;
4040

4141
/// Takes in the operation enum and returns the enum as a string. Used for debugging purposes.
42-
string operationToString(const Operations::op &operation) const;
42+
string operationToString(const Operations &operation) const;
4343

4444
/// Delete copy and move methods to avoid copy instances of the singleton
4545
OperationManager(const OperationManager &operationManager) = delete;

Simulator/Core/Operations.h

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@
99

1010
#pragma once
1111

12-
class Operations {
13-
public:
12+
enum class Operations {
1413
/// Available operations the OperationManager can register and execute.
15-
enum op {
16-
printParameters,
17-
loadParameters,
18-
registerGraphProperties,
19-
setup,
20-
serialize,
21-
deserialize,
22-
deallocateGPUMemory, // Make sure deallocate memory isn't called until all GPU memory is copied back.
23-
restoreToDefault, // Not sure what this refers to.
24-
copyToGPU,
25-
copyFromGPU
26-
};
14+
printParameters,
15+
loadParameters,
16+
registerGraphProperties,
17+
setup,
18+
serialize,
19+
deserialize,
20+
deallocateGPUMemory, // Make sure deallocate memory isn't called until all GPU memory is copied back.
21+
restoreToDefault, // Not sure what this refers to.
22+
copyToGPU,
23+
copyFromGPU
2724
};

Simulator/Edges/AllEdges.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AllEdges::AllEdges() : totalEdgeCount_(0), maxEdgesPerVertex_(0), countVertices_
1616
// OperationManager. This will register the appropriate overridden method
1717
// for the actual (sub)class of the object being created.
1818
function<void()> loadParametersFunc = std::bind(&AllEdges::loadParameters, this);
19-
OperationManager::getInstance().registerOperation(Operations::op::loadParameters,
19+
OperationManager::getInstance().registerOperation(Operations::loadParameters,
2020
loadParametersFunc);
2121

2222
// Register printParameters function as a printParameters operation in the
@@ -76,7 +76,7 @@ void AllEdges::setupEdges(int numVertices, int maxEdges)
7676

7777
if (maxTotalEdges != 0) {
7878
W_.assign(maxTotalEdges, 0);
79-
type_.assign(maxTotalEdges, ETYPE_UNDEF);
79+
type_.assign(maxTotalEdges, edgeType::ETYPE_UNDEF);
8080
inUse_.assign(maxTotalEdges, false);
8181
edgeCounts_.assign(numVertices, 0);
8282
destVertexIndex_.assign(maxTotalEdges, 0);
@@ -116,7 +116,7 @@ void AllEdges::writeEdge(ostream &output, BGSIZE iEdg) const
116116
output << sourceVertexIndex_[iEdg] << ends;
117117
output << destVertexIndex_[iEdg] << ends;
118118
output << W_[iEdg] << ends;
119-
output << type_[iEdg] << ends;
119+
output << static_cast<int>(type_[iEdg]) << ends;
120120
output << (inUse_[iEdg] == 1 ? "true" : "false") << ends;
121121
}
122122

@@ -128,25 +128,25 @@ edgeType AllEdges::edgeOrdinalToType(int typeOrdinal)
128128
{
129129
switch (typeOrdinal) {
130130
case 0:
131-
return II;
131+
return edgeType::II;
132132
case 1:
133-
return IE;
133+
return edgeType::IE;
134134
case 2:
135-
return EI;
135+
return edgeType::EI;
136136
case 3:
137-
return EE;
137+
return edgeType::EE;
138138
case 4:
139-
return CP;
139+
return edgeType::CP;
140140
case 5:
141-
return PR;
141+
return edgeType::PR;
142142
case 6:
143-
return PC;
143+
return edgeType::PC;
144144
case 7:
145-
return PP;
145+
return edgeType::PP;
146146
case 8:
147-
return RP;
147+
return edgeType::RP;
148148
default:
149-
return ETYPE_UNDEF;
149+
return edgeType::ETYPE_UNDEF;
150150
}
151151
}
152152

0 commit comments

Comments
 (0)