Free Electron
WorkOmp.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __thread_WorkOmp_h__
8 #define __thread_WorkOmp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Execute a SpannedRange with OpenMP
17 
18  @ingroup thread
19 *//***************************************************************************/
20 class FE_DL_EXPORT WorkOmp: public WorkForceI,
21  public Initialize<WorkOmp>
22 {
23  public:
24  WorkOmp(void) {}
25 virtual ~WorkOmp(void) {}
26 
27  void initialize(void);
28 
29 virtual sp<WorkI> assignment(void) { return m_spWorkI; }
30 virtual void run(sp<WorkI> a_spWorkI,U32 a_threads,
31  sp<SpannedRange> a_spSpannedRange,String a_stage);
32 virtual void stop(void) {}
33 
34 virtual BWORD threadsAlive(void) const { return 0; }
35 
36 virtual BWORD willWaitForJobs(void) const { return FALSE; }
37 virtual void waitForJobs(BWORD a_wait) {}
38 
39 static I32 threadIndex(void);
40 static I32 threadCount(void);
41 
42  private:
43 
44  sp<WorkI> m_spWorkI;
45 };
46 
47 } /* namespace ext */
48 } /* namespace fe */
49 
50 #endif // __thread_WorkOmp_h__
Execute a SpannedRange with OpenMP.
Definition: WorkOmp.h:20
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Execute a Range.
Definition: WorkForceI.h:22
Automatically reference-counted string container.
Definition: String.h:128
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53