forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvtkThreadedStreamingPipeline.h
176 lines (136 loc) · 5.97 KB
/
vtkThreadedStreamingPipeline.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*=========================================================================
Program: Visualization Toolkit
Module: vtkThreadedStreamingPipeline.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright (c) 2008, 2009 by SCI Institute, University of Utah.
This is part of the Parallel Dataflow System originally developed by
Huy T. Vo and Claudio T. Silva. For more information, see:
"Parallel Dataflow Scheme for Streaming (Un)Structured Data" by Huy
T. Vo, Daniel K. Osmari, Brian Summa, Joao L.D. Comba, Valerio
Pascucci and Claudio T. Silva, SCI Institute, University of Utah,
Technical Report #UUSCI-2009-004, 2009.
"Multi-Threaded Streaming Pipeline For VTK" by Huy T. Vo and Claudio
T. Silva, SCI Institute, University of Utah, Technical Report
#UUSCI-2009-005, 2009.
-------------------------------------------------------------------------*/
// .NAME vtkThreadedStreamingPipeline - Executive supporting multi-threads
// .SECTION Description
// vtkThreadeStreamingDemandDrivenPipeline is an executive that supports
// updating input ports based on the number of threads available.
// .SECTION See Also
// vtkExecutionScheduler
#ifndef __vtkThreadedStreamingPipeline_h
#define __vtkThreadedStreamingPipeline_h
#include "vtkCompositeDataPipeline.h"
class vtkComputingResources;
class vtkExecutionScheduler;
class vtkExecutiveCollection;
class VTK_FILTERING_EXPORT vtkThreadedStreamingPipeline : public vtkCompositeDataPipeline
{
public:
static vtkThreadedStreamingPipeline* New();
vtkTypeMacro(vtkThreadedStreamingPipeline,vtkCompositeDataPipeline);
void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Key to store the priority of a task
static vtkInformationIntegerKey* AUTO_PROPAGATE();
// Description:
// Key to store the additional information for an update request
static vtkInformationObjectBaseKey* EXTRA_INFORMATION();
// Description:
// Definition of different types of processing units an algorithm
// can be executed
//BTX
enum
{
PROCESSING_UNIT_NONE = 0,
PROCESSING_UNIT_CPU = 1,
PROCESSING_UNIT_GPU = 2
};
//ETX
// Description:
// Enable/Disable Multi-Threaded updating mechanism
static void SetMultiThreadedEnabled(bool enabled);
// Description:
// Enable/Disable automatic propagation of Push events
static void SetAutoPropagatePush(bool enabled);
// Description:
// Trigger the updates on certain execs and asking all of its
// upstream modules to be updated as well (propagate up)
static void Pull(vtkExecutiveCollection *execs);
// Description:
// Trigger the updates on certain execs and asking all of its
// upstream modules to be updated as well (propagate up)
static void Pull(vtkExecutiveCollection *execs, vtkInformation *info);
// Description:
// Trigger the updates on certain execs and asking all of its
// downstream modules to be updated as well (propagate down)
static void Push(vtkExecutiveCollection *execs);
// Description:
// Trigger the updates on certain execs and asking all of its
// downstream modules to be updated as well (propagate down)
static void Push(vtkExecutiveCollection *execs, vtkInformation *info);
// Description:
// A simplified version of Pull() which only acts upon a single executive
static void Pull(vtkExecutive *exec);
// Description:
// A simplified version of Pull() which only acts upon a single executive
static void Pull(vtkExecutive *exec, vtkInformation *info);
// Description:
// A simplified version of Push() which only acts upon a single executive
static void Push(vtkExecutive *exec);
// Description:
// A simplified version of Push() which only acts upon a single executive
static void Push(vtkExecutive *exec, vtkInformation *info);
// Description:
// Triggers upstream modules to update but not including itself
void Pull();
// Description:
// Triggers upstream modules to update but not including itself
void Pull(vtkInformation *info);
// Description:
// Triggers downstream modules to update but not including itself
void Push();
// Description:
// Triggers downstream modules to update but not including itself
void Push(vtkInformation *info);
// Description:
// Release all the locks for input ports living upstream
void ReleaseInputs();
// Description:
// Generalized interface for asking the executive to fullfill update
// requests.
virtual int ProcessRequest(vtkInformation* request,
vtkInformationVector** inInfo,
vtkInformationVector* outInfo);
// Description:
// Send a direct REQUEST_DATA (on all ports) to this executive
int ForceUpdateData(int processingUnit, vtkInformation *info);
// Description:
// Update the LastDataRequestTimeFromSource using its upstream time
void UpdateRequestDataTimeFromSource();
// Description:
// Return the scheduling for this executive
vtkComputingResources *GetResources();
float LastDataRequestTime;
float LastDataRequestTimeFromSource;
vtkInformation *ForceDataRequest;
vtkComputingResources *Resources;
vtkExecutionScheduler *Scheduler;
protected:
vtkThreadedStreamingPipeline();
~vtkThreadedStreamingPipeline();
virtual int ForwardUpstream(vtkInformation* request);
virtual int ForwardUpstream(int i, int j, vtkInformation* request);
private:
vtkThreadedStreamingPipeline(const vtkThreadedStreamingPipeline&); // Not implemented.
void operator=(const vtkThreadedStreamingPipeline&); // Not implemented.
};
#endif