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
35
using namespace
std
;
36
using namespace
DGtal
;
37
39
// Functions for testing class OpenMP.
41
45
bool
testOpenMP
()
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
}
61
63
// Standard services - public :
64
65
int
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;
75
trace
.
endBlock
();
76
return
res ? 0 : 1;
77
}
78
// //
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
Definition
Common.h:153
std
STL namespace.
main
int main()
Definition
testBits.cpp:56
testOpenMP
bool testOpenMP()
Definition
testOpenMP.cpp:45
tests
base
testOpenMP.cpp
Generated on Mon Jun 10 2024 17:36:09 for DGtal by
1.11.0