diff --git a/tests/cuda/communication/GPUPackInfoCommunicationTest.cpp b/tests/cuda/communication/GPUPackInfoCommunicationTest.cpp index 8d0d66c8ea643d86778064fc7f0ae6001e1e31d5..27fdba33bb1c0d921cdd989a7f3879d4580ce4b0 100644 --- a/tests/cuda/communication/GPUPackInfoCommunicationTest.cpp +++ b/tests/cuda/communication/GPUPackInfoCommunicationTest.cpp @@ -101,14 +101,6 @@ int main( int argc, char ** argv ) debug::enterTestMode(); mpi::Environment mpiEnv( argc, argv ); - std::vector< cudaStream_t > streams; - - for( uint_t i = 0; i < StencilType::Size; ++i ) - { - cudaStream_t stream(nullptr); - WALBERLA_CUDA_CHECK( cudaStreamCreate(&stream) ); - streams.push_back( stream ); - } const Vector3< uint_t > cells = Vector3< uint_t >( 4, 4, 4 ); @@ -153,7 +145,7 @@ int main( int argc, char ** argv ) // Setup communication scheme for asynchronous GPUPackInfo, which uses CUDA streams CommSchemeType asyncCommScheme(blocks); - asyncCommScheme.addPackInfo( make_shared< GPUPackInfoType >( asyncGPUFieldId, streams ) ); + asyncCommScheme.addPackInfo( make_shared< GPUPackInfoType >( asyncGPUFieldId ) ); // Perform one communication step for each scheme syncCommScheme(); @@ -180,8 +172,6 @@ int main( int argc, char ** argv ) } } - for( uint_t i = 0; i < StencilType::Size; ++i ) - WALBERLA_CUDA_CHECK( cudaStreamDestroy(streams[i]) ); return EXIT_SUCCESS; } diff --git a/tests/cuda/communication/GPUPackInfoTest.cpp b/tests/cuda/communication/GPUPackInfoTest.cpp index 29fc84f259cb66a1928337fe85c467a83ae2c6b6..0cafd76f5178022de70a3cf3d96e0fc2f139e7b5 100644 --- a/tests/cuda/communication/GPUPackInfoTest.cpp +++ b/tests/cuda/communication/GPUPackInfoTest.cpp @@ -62,8 +62,8 @@ public: typedef cuda::communication::GPUPackInfo< cuda::GPUField<int> > GPUPackInfoType; - GPUPackInfoTester( IBlock* block, BlockDataID fieldId, std::vector< cudaStream_t > & streams ) : - block_( block ), fieldId_( fieldId ), streams_(streams) {} + GPUPackInfoTester( IBlock* block, BlockDataID fieldId ) : + block_( block ), fieldId_( fieldId ) {} virtual ~GPUPackInfoTester() {} @@ -87,7 +87,7 @@ public: } cuda::fieldCpy( gpuField, cpuField ); - GPUPackInfoType gpuPackInfo( fieldId_, streams_ ); + GPUPackInfoType gpuPackInfo( fieldId_ ); communicate( gpuPackInfo, dir ); cuda::fieldCpy( cpuField, gpuField ); @@ -106,7 +106,6 @@ protected: IBlock* block_; BlockDataID fieldId_; - std::vector< cudaStream_t > streams_; }; @@ -114,7 +113,7 @@ protected: class GPUPackInfoBufferTester: public GPUPackInfoTester { public: - GPUPackInfoBufferTester( IBlock* block, BlockDataID fieldId, std::vector< cudaStream_t > & streams): GPUPackInfoTester( block, fieldId, streams ) {} + GPUPackInfoBufferTester( IBlock* block, BlockDataID fieldId): GPUPackInfoTester( block, fieldId ) {} protected: void communicate( GPUPackInfoType& gpuPackInfo, stencil::Direction dir ) @@ -140,7 +139,7 @@ protected: class GPUPackInfoLocalTester: public GPUPackInfoTester { public: - GPUPackInfoLocalTester( IBlock* block, BlockDataID fieldId, std::vector< cudaStream_t > & streams ): GPUPackInfoTester( block, fieldId, streams ) {} + GPUPackInfoLocalTester( IBlock* block, BlockDataID fieldId ): GPUPackInfoTester( block, fieldId ) {} protected: void communicate( GPUPackInfoType& gpuPackInfo, stencil::Direction dir ) @@ -159,13 +158,6 @@ int main(int argc, char **argv) for(; fieldLayoutIndex < fieldLayouts.size(); ++fieldLayoutIndex ) { - std::vector< cudaStream_t > streams; - for( uint_t s = 0; s < stencil::D3Q27::Size; ++s ) - { - cudaStream_t stream(nullptr); - WALBERLA_CUDA_CHECK( cudaStreamCreate( &stream ) ); - streams.push_back( stream ); - } // Create BlockForest uint_t processes = uint_c( MPIManager::instance()->numProcesses() ); auto blocks = createUniformBlockGrid(processes,1,1, //blocks @@ -179,8 +171,8 @@ int main(int argc, char **argv) for( auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt ) { - GPUPackInfoBufferTester bufferTester( &(*blockIt), scalarGPUFieldId, streams ); - GPUPackInfoLocalTester localTester( &(*blockIt), scalarGPUFieldId, streams ); + GPUPackInfoBufferTester bufferTester( &(*blockIt), scalarGPUFieldId ); + GPUPackInfoLocalTester localTester( &(*blockIt), scalarGPUFieldId ); for( auto dir = stencil::D3Q27::beginNoCenter(); dir != stencil::D3Q27::end(); ++dir ) { @@ -188,12 +180,6 @@ int main(int argc, char **argv) bufferTester.test( *dir ); } } - - for( auto streamIt = streams.begin(); streamIt != streams.end(); ++streamIt ) - { - cudaStream_t & stream = *streamIt; - WALBERLA_CUDA_CHECK( cudaStreamDestroy( stream ) ); - } } return 0;