diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp index 17185ef21a9a3aa459cd7c8ca8eb34cb1360fe62..3009bc4ae449b917f494cdf39145a2e94df2ddb8 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp @@ -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{}; diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp index 58e753b05153699ee93ee1e655ff21c742fe6e25..4cd8769407220ec97030489585009d435a6cce8e 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp @@ -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); diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp index 5b8bd50bdebcbd4e37a240223b52b967f274d1ae..7bf534013ab68ba6a58fb3f33ca4ae03610cc12d 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp @@ -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; } diff --git a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h index ca7a63244092f77ec398d830373197dfe385be26..d410340d2de7797cf23a781a64d11f592d62a6fb 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h +++ b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h @@ -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); //////////////////////////////////////////////////////////////////////////