Loading src/TNL/Meshes/MeshDetails/Traverser_impl.h +3 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ processBoundaryEntities( const MeshPointer& meshPointer, // TODO: if the Mesh::IdType is void, then we should also pass the entityIndex EntitiesProcessor::processEntity( *mesh, userData, entity ); }; if( std::is_same< DeviceType, Devices::Cuda >::value ) Pointers::synchronizeSmartPointersOnDevice< DeviceType >(); Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, Loading Loading @@ -67,7 +66,6 @@ processInteriorEntities( const MeshPointer& meshPointer, // TODO: if the Mesh::IdType is void, then we should also pass the entityIndex EntitiesProcessor::processEntity( *mesh, userData, entity ); }; if( std::is_same< DeviceType, Devices::Cuda >::value ) Pointers::synchronizeSmartPointersOnDevice< DeviceType >(); Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, Loading Loading @@ -96,7 +94,6 @@ processAllEntities( const MeshPointer& meshPointer, // TODO: if the Mesh::IdType is void, then we should also pass the entityIndex EntitiesProcessor::processEntity( *mesh, userData, entity ); }; if( std::is_same< DeviceType, Devices::Cuda >::value ) Pointers::synchronizeSmartPointersOnDevice< DeviceType >(); Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, Loading src/TNL/Pointers/SmartPointersRegister.h +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #include <TNL/Pointers/SmartPointer.h> #include <TNL/Timer.h> #include <TNL/Cuda/DeviceInfo.h> #include <TNL/Devices/Sequential.h> #include <TNL/Devices/Host.h> namespace TNL { namespace Pointers { Loading Loading @@ -109,6 +111,10 @@ Timer& getSmartPointersSynchronizationTimer() template< typename Device > bool synchronizeSmartPointersOnDevice( int deviceId = -1 ) { // TODO: better way to skip synchronization of host-only smart pointers if( std::is_same< Device, Devices::Sequential >::value || std::is_same< Device, Devices::Host >::value ) return true; getSmartPointersSynchronizationTimer< Device >().start(); bool b = getSmartPointersRegister< Device >().synchronizeDevice( deviceId ); getSmartPointersSynchronizationTimer< Device >().stop(); Loading Loading
src/TNL/Meshes/MeshDetails/Traverser_impl.h +3 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ processBoundaryEntities( const MeshPointer& meshPointer, // TODO: if the Mesh::IdType is void, then we should also pass the entityIndex EntitiesProcessor::processEntity( *mesh, userData, entity ); }; if( std::is_same< DeviceType, Devices::Cuda >::value ) Pointers::synchronizeSmartPointersOnDevice< DeviceType >(); Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, Loading Loading @@ -67,7 +66,6 @@ processInteriorEntities( const MeshPointer& meshPointer, // TODO: if the Mesh::IdType is void, then we should also pass the entityIndex EntitiesProcessor::processEntity( *mesh, userData, entity ); }; if( std::is_same< DeviceType, Devices::Cuda >::value ) Pointers::synchronizeSmartPointersOnDevice< DeviceType >(); Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, Loading Loading @@ -96,7 +94,6 @@ processAllEntities( const MeshPointer& meshPointer, // TODO: if the Mesh::IdType is void, then we should also pass the entityIndex EntitiesProcessor::processEntity( *mesh, userData, entity ); }; if( std::is_same< DeviceType, Devices::Cuda >::value ) Pointers::synchronizeSmartPointersOnDevice< DeviceType >(); Algorithms::ParallelFor< DeviceType >::exec( (GlobalIndexType) 0, entitiesCount, Loading
src/TNL/Pointers/SmartPointersRegister.h +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #include <TNL/Pointers/SmartPointer.h> #include <TNL/Timer.h> #include <TNL/Cuda/DeviceInfo.h> #include <TNL/Devices/Sequential.h> #include <TNL/Devices/Host.h> namespace TNL { namespace Pointers { Loading Loading @@ -109,6 +111,10 @@ Timer& getSmartPointersSynchronizationTimer() template< typename Device > bool synchronizeSmartPointersOnDevice( int deviceId = -1 ) { // TODO: better way to skip synchronization of host-only smart pointers if( std::is_same< Device, Devices::Sequential >::value || std::is_same< Device, Devices::Host >::value ) return true; getSmartPointersSynchronizationTimer< Device >().start(); bool b = getSmartPointersRegister< Device >().synchronizeDevice( deviceId ); getSmartPointersSynchronizationTimer< Device >().stop(); Loading