Loading src/TNL/Devices/Host.h +11 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,17 @@ class Host static void enableOMP(); static inline bool isOMPEnabled() { return ompEnabled; }; static inline bool isOMPEnabled() { // This MUST stay in the header since we are interested in whether the // client was compiled with OpenMP support, not the libtnl.so file. // Also, keeping it in the header makes it inline-able. #ifdef HAVE_OPENMP return ompEnabled; #else return false; #endif } static void setMaxThreadsCount( int maxThreadsCount ); Loading src/TNL/Meshes/GridDetails/GridTraverser_impl.h +14 −1 Original line number Diff line number Diff line Loading @@ -75,19 +75,24 @@ processEntities( else { //TODO: This does not work with gcc-5.4 and older, should work at gcc 6.x /*for( entity.getCoordinates().x() = begin.x(); /*#pragma omp parallel for firstprivate( entity, begin, end ) if( Devices::Host::isOMPEnabled() ) for( entity.getCoordinates().x() = begin.x(); entity.getCoordinates().x() <= end.x(); entity.getCoordinates().x() ++ ) { entity.refresh(); EntitiesProcessor::processEntity( entity.getMesh(), *userDataPointer, entity ); }*/ #ifdef HAVE_OPENMP #pragma omp parallel firstprivate( begin, end ) if( Devices::Host::isOMPEnabled() ) #endif { GridEntity entity( *gridPointer ); entity.setOrientation( entityOrientation ); entity.setBasis( entityBasis ); #ifdef HAVE_OPENMP #pragma omp for #endif for( IndexType x = begin.x(); x<= end.x(); x ++ ) { entity.getCoordinates().x() = x; Loading Loading @@ -283,12 +288,16 @@ processEntities( entity.refresh(); EntitiesProcessor::processEntity( entity.getMesh(), *userDataPointer, entity ); }*/ #ifdef HAVE_OPENMP #pragma omp parallel firstprivate( begin, end ) if( Devices::Host::isOMPEnabled() ) #endif { GridEntity entity( *gridPointer ); entity.setOrientation( entityOrientation ); entity.setBasis( entityBasis ); #ifdef HAVE_OPENMP #pragma omp for #endif for( IndexType y = begin.y(); y <= end.y(); y ++ ) for( IndexType x = begin.x(); x<= end.x(); x ++ ) { Loading Loading @@ -481,12 +490,16 @@ processEntities( entity.refresh(); EntitiesProcessor::processEntity( entity.getMesh(), *userDataPointer, entity ); }*/ #ifdef HAVE_OPENMP #pragma omp parallel firstprivate( begin, end ) if( Devices::Host::isOMPEnabled() ) #endif { GridEntity entity( *gridPointer ); entity.setOrientation( entityOrientation ); entity.setBasis( entityBasis ); #ifdef HAVE_OPENMP #pragma omp for #endif for( IndexType z = begin.y(); z <= end.y(); z ++ ) for( IndexType y = begin.y(); y <= end.y(); y ++ ) for( IndexType x = begin.x(); x<= end.x(); x ++ ) Loading Loading
src/TNL/Devices/Host.h +11 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,17 @@ class Host static void enableOMP(); static inline bool isOMPEnabled() { return ompEnabled; }; static inline bool isOMPEnabled() { // This MUST stay in the header since we are interested in whether the // client was compiled with OpenMP support, not the libtnl.so file. // Also, keeping it in the header makes it inline-able. #ifdef HAVE_OPENMP return ompEnabled; #else return false; #endif } static void setMaxThreadsCount( int maxThreadsCount ); Loading
src/TNL/Meshes/GridDetails/GridTraverser_impl.h +14 −1 Original line number Diff line number Diff line Loading @@ -75,19 +75,24 @@ processEntities( else { //TODO: This does not work with gcc-5.4 and older, should work at gcc 6.x /*for( entity.getCoordinates().x() = begin.x(); /*#pragma omp parallel for firstprivate( entity, begin, end ) if( Devices::Host::isOMPEnabled() ) for( entity.getCoordinates().x() = begin.x(); entity.getCoordinates().x() <= end.x(); entity.getCoordinates().x() ++ ) { entity.refresh(); EntitiesProcessor::processEntity( entity.getMesh(), *userDataPointer, entity ); }*/ #ifdef HAVE_OPENMP #pragma omp parallel firstprivate( begin, end ) if( Devices::Host::isOMPEnabled() ) #endif { GridEntity entity( *gridPointer ); entity.setOrientation( entityOrientation ); entity.setBasis( entityBasis ); #ifdef HAVE_OPENMP #pragma omp for #endif for( IndexType x = begin.x(); x<= end.x(); x ++ ) { entity.getCoordinates().x() = x; Loading Loading @@ -283,12 +288,16 @@ processEntities( entity.refresh(); EntitiesProcessor::processEntity( entity.getMesh(), *userDataPointer, entity ); }*/ #ifdef HAVE_OPENMP #pragma omp parallel firstprivate( begin, end ) if( Devices::Host::isOMPEnabled() ) #endif { GridEntity entity( *gridPointer ); entity.setOrientation( entityOrientation ); entity.setBasis( entityBasis ); #ifdef HAVE_OPENMP #pragma omp for #endif for( IndexType y = begin.y(); y <= end.y(); y ++ ) for( IndexType x = begin.x(); x<= end.x(); x ++ ) { Loading Loading @@ -481,12 +490,16 @@ processEntities( entity.refresh(); EntitiesProcessor::processEntity( entity.getMesh(), *userDataPointer, entity ); }*/ #ifdef HAVE_OPENMP #pragma omp parallel firstprivate( begin, end ) if( Devices::Host::isOMPEnabled() ) #endif { GridEntity entity( *gridPointer ); entity.setOrientation( entityOrientation ); entity.setBasis( entityBasis ); #ifdef HAVE_OPENMP #pragma omp for #endif for( IndexType z = begin.y(); z <= end.y(); z ++ ) for( IndexType y = begin.y(); y <= end.y(); y ++ ) for( IndexType x = begin.x(); x<= end.x(); x ++ ) Loading