DGtal 1.4.0
Loading...
Searching...
No Matches
testOpenMP.cpp
Go to the documentation of this file.
1
31#include <iostream>
32#include "DGtal/base/Common.h"
34
35using namespace std;
36using namespace DGtal;
37
39// Functions for testing class OpenMP.
41
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
58
59 return true;
60}
61
63// Standard services - public :
64
65int main( int argc, char** argv )
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;
76 return res ? 0 : 1;
77}
78// //
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
std::ostream & info()
double endBlock()
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
Definition Common.h:153
STL namespace.
int main()
Definition testBits.cpp:56
bool testOpenMP()