VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkThreadedStreamingPipeline.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright (c) 2008, 2009 by SCI Institute, University of Utah. 00017 00018 This is part of the Parallel Dataflow System originally developed by 00019 Huy T. Vo and Claudio T. Silva. For more information, see: 00020 00021 "Parallel Dataflow Scheme for Streaming (Un)Structured Data" by Huy 00022 T. Vo, Daniel K. Osmari, Brian Summa, Joao L.D. Comba, Valerio 00023 Pascucci and Claudio T. Silva, SCI Institute, University of Utah, 00024 Technical Report #UUSCI-2009-004, 2009. 00025 00026 "Multi-Threaded Streaming Pipeline For VTK" by Huy T. Vo and Claudio 00027 T. Silva, SCI Institute, University of Utah, Technical Report 00028 #UUSCI-2009-005, 2009. 00029 -------------------------------------------------------------------------*/ 00043 #ifndef __vtkThreadedStreamingPipeline_h 00044 #define __vtkThreadedStreamingPipeline_h 00045 00046 #include "vtkCommonExecutionModelModule.h" // For export macro 00047 #include "vtkCompositeDataPipeline.h" 00048 00049 class vtkComputingResources; 00050 class vtkExecutionScheduler; 00051 class vtkExecutiveCollection; 00052 00053 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkThreadedStreamingPipeline : public vtkCompositeDataPipeline 00054 { 00055 public: 00056 static vtkThreadedStreamingPipeline* New(); 00057 vtkTypeMacro(vtkThreadedStreamingPipeline,vtkCompositeDataPipeline); 00058 void PrintSelf(ostream &os, vtkIndent indent); 00059 00061 static vtkInformationIntegerKey* AUTO_PROPAGATE(); 00062 00064 static vtkInformationObjectBaseKey* EXTRA_INFORMATION(); 00065 00066 //BTX 00068 00070 enum 00071 { 00072 PROCESSING_UNIT_NONE = 0, 00073 PROCESSING_UNIT_CPU = 1, 00074 PROCESSING_UNIT_GPU = 2 00075 }; 00076 //ETX 00078 00080 static void SetMultiThreadedEnabled(bool enabled); 00081 00083 static void SetAutoPropagatePush(bool enabled); 00084 00087 static void Pull(vtkExecutiveCollection *execs); 00088 00091 static void Pull(vtkExecutiveCollection *execs, vtkInformation *info); 00092 00095 static void Push(vtkExecutiveCollection *execs); 00096 00099 static void Push(vtkExecutiveCollection *execs, vtkInformation *info); 00100 00103 static void Pull(vtkExecutive *exec); 00104 00107 static void Pull(vtkExecutive *exec, vtkInformation *info); 00108 00111 static void Push(vtkExecutive *exec); 00112 00115 static void Push(vtkExecutive *exec, vtkInformation *info); 00116 00118 void Pull(); 00119 00121 void Pull(vtkInformation *info); 00122 00124 void Push(); 00125 00127 void Push(vtkInformation *info); 00128 00130 void ReleaseInputs(); 00131 00133 00135 virtual int ProcessRequest(vtkInformation* request, 00136 vtkInformationVector** inInfo, 00137 vtkInformationVector* outInfo); 00139 00141 int ForceUpdateData(int processingUnit, vtkInformation *info); 00142 00144 void UpdateRequestDataTimeFromSource(); 00145 00147 vtkComputingResources *GetResources(); 00148 00149 float LastDataRequestTime; 00150 float LastDataRequestTimeFromSource; 00151 vtkInformation *ForceDataRequest; 00152 vtkComputingResources *Resources; 00153 vtkExecutionScheduler *Scheduler; 00154 00155 protected: 00156 vtkThreadedStreamingPipeline(); 00157 ~vtkThreadedStreamingPipeline(); 00158 00159 virtual int ForwardUpstream(vtkInformation* request); 00160 virtual int ForwardUpstream(int i, int j, vtkInformation* request); 00161 00162 private: 00163 vtkThreadedStreamingPipeline(const vtkThreadedStreamingPipeline&); // Not implemented. 00164 void operator=(const vtkThreadedStreamingPipeline&); // Not implemented. 00165 }; 00166 00167 #endif