Skip to content
Snippets Groups Projects
Commit 1aebbd6e authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Merge branch 'fixSonarqubeWarnings' into 'develop'

Fix some Code Smells (Sonarqube)

See merge request irmb/VirtualFluids_dev!169
parents 1c206058 1c141a3a
No related branches found
No related tags found
1 merge request!169Fix some Code Smells (Sonarqube)
......@@ -22,7 +22,7 @@ private:
public:
uint numberOfSendIndices = 0;
LevelGridBuilderStub(SPtr<Grid> grid) : LevelGridBuilder(), grid(grid){};
explicit LevelGridBuilderStub(SPtr<Grid> grid) : LevelGridBuilder(), grid(grid){};
uint getCommunicationProcess(int direction) override
{
......@@ -59,7 +59,7 @@ public:
class CudaMemoryManagerDouble : public CudaMemoryManager
{
public:
CudaMemoryManagerDouble(std::shared_ptr<Parameter> parameter) : CudaMemoryManager(parameter){};
explicit CudaMemoryManagerDouble(std::shared_ptr<Parameter> parameter) : CudaMemoryManager(parameter){};
void cudaAllocProcessNeighborX(int lev, unsigned int processNeighbor) override{};
void cudaCopyProcessNeighborXIndex(int lev, unsigned int processNeighbor) override{};
......
......@@ -493,7 +493,7 @@ void IndexRearrangementForStreams::reorderRecvIndicesForCommAfterFtoC(
VF_LOG_INFO("Reorder recv indices for communication after fine to coarse: level: {} direction: {}", level,
direction);
if (sendIndicesForCommAfterFtoCPositions.size() <= 0)
if (sendIndicesForCommAfterFtoCPositions.size() == 0)
VF_LOG_WARNING("ReorderRecvIndicesForCommAfterFtoC(): sendIndicesForCommAfterFtoCPositions is empty.");
uint numberOfRecvIndices = builder->getNumberOfReceiveIndices(direction, level);
......
......@@ -18,7 +18,7 @@
namespace indexRearrangementTests
{
template <typename T>
bool vectorsAreEqual(const T *vector1, const std::vector<T> vectorExpected)
bool vectorsAreEqual(const T *vector1, const std::vector<T>& vectorExpected)
{
for (uint i = 0; i < vectorExpected.size(); i++) {
if (vector1[i] != vectorExpected[i])
......@@ -179,7 +179,7 @@ public:
return 0;
}
void setReceivedIndices(std::vector<uint> receivedIndices)
void setReceivedIndices(const std::vector<uint>& receivedIndices)
{
this->receivedIndices = receivedIndices;
}
......
......@@ -99,20 +99,20 @@ public:
virtual void cudaCopyProcessNeighborXIndex(int lev, unsigned int processNeighbor);
void cudaFreeProcessNeighborX(int lev, unsigned int processNeighbor);
//
void cudaAllocProcessNeighborY(int lev, unsigned int processNeighbor);
virtual void cudaAllocProcessNeighborY(int lev, unsigned int processNeighbor);
void cudaCopyProcessNeighborYFsHD(int lev, unsigned int processNeighbor, const unsigned int &memsizeFsRecv,
int streamIndex);
void cudaCopyProcessNeighborYFsDH(int lev, unsigned int processNeighbor, const unsigned int &memsizeFsSend,
int streamIndex);
void cudaCopyProcessNeighborYIndex(int lev, unsigned int processNeighbor);
virtual void cudaCopyProcessNeighborYIndex(int lev, unsigned int processNeighbor);
void cudaFreeProcessNeighborY(int lev, unsigned int processNeighbor);
//
void cudaAllocProcessNeighborZ(int lev, unsigned int processNeighbor);
virtual void cudaAllocProcessNeighborZ(int lev, unsigned int processNeighbor);
void cudaCopyProcessNeighborZFsHD(int lev, unsigned int processNeighbor, const unsigned int &memsizeFsRecv,
int streamIndex);
void cudaCopyProcessNeighborZFsDH(int lev, unsigned int processNeighbor, const unsigned int &memsizeFsSend,
int streamIndex);
void cudaCopyProcessNeighborZIndex(int lev, unsigned int processNeighbor);
virtual void cudaCopyProcessNeighborZIndex(int lev, unsigned int processNeighbor);
void cudaFreeProcessNeighborZ(int lev, unsigned int processNeighbor);
//////////////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment