DGtal  1.4.beta
testOpenMP.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
Include dependency graph for testOpenMP.cpp:

Go to the source code of this file.

Functions

bool testOpenMP ()
 
int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr ) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2012/10/26

Functions for testing class OpenMP.

This file is part of the DGtal library.

Definition in file testOpenMP.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 65 of file testOpenMP.cpp.

66 {
67  trace.beginBlock ( "Testing class OpenMP" );
68  trace.info() << "Args:";
69  for ( int i = 0; i < argc; ++i )
70  trace.info() << " " << argv[ i ];
71  trace.info() << endl;
72 
73  bool res = testOpenMP(); // && ... other tests
74  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
75  trace.endBlock();
76  return res ? 0 : 1;
77 }
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
std::ostream & info()
double endBlock()
Trace trace
Definition: Common.h:153
bool testOpenMP()
Definition: testOpenMP.cpp:45

References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testOpenMP(), and DGtal::trace.

◆ testOpenMP()

bool testOpenMP ( )

Example of a test. To be completed.

Definition at line 45 of file testOpenMP.cpp.

46 {
47  trace.beginBlock ( "Testing basic OpenMP ..." );
48 
49 #ifdef WITH_OPENMP
50  trace.info() << "Parallel helloworld"<<std::endl;
51 #pragma omp parallel
52  trace.info()<<"Hello, world.\n";
53 #else
54  trace.info() << "no parallel helloworld"<<std::endl;
55 #endif
56 
57  trace.endBlock();
58 
59  return true;
60 }

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.

Referenced by main().