VTK-m  2.2
DeviceAdapterAlgorithmTBB.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_tbb_internal_DeviceAdapterAlgorithmTBB_h
11 #define vtk_m_cont_tbb_internal_DeviceAdapterAlgorithmTBB_h
12 
13 #include <vtkm/cont/ArrayHandle.h>
18 #include <vtkm/cont/Logging.h>
24 
26 
27 namespace vtkm
28 {
29 namespace cont
30 {
31 
32 template <>
34  : vtkm::cont::internal::DeviceAdapterAlgorithmGeneral<
35  DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagTBB>,
36  vtkm::cont::DeviceAdapterTagTBB>
37 {
38 public:
39  template <typename T, typename U, class CIn, class COut>
42  {
44 
45  vtkm::cont::Token token;
46 
47  const vtkm::Id inSize = input.GetNumberOfValues();
48  auto inputPortal = input.PrepareForInput(DeviceAdapterTagTBB(), token);
49  auto outputPortal = output.PrepareForOutput(inSize, DeviceAdapterTagTBB(), token);
50 
51  tbb::CopyPortals(inputPortal, outputPortal, 0, 0, inSize);
52  }
53 
54  template <typename T, typename U, class CIn, class CStencil, class COut>
58  {
60 
61  ::vtkm::NotZeroInitialized unary_predicate;
62  CopyIf(input, stencil, output, unary_predicate);
63  }
64 
65  template <typename T, typename U, class CIn, class CStencil, class COut, class UnaryPredicate>
69  UnaryPredicate unary_predicate)
70  {
72 
73  vtkm::cont::Token token;
74 
75  vtkm::Id inputSize = input.GetNumberOfValues();
76  VTKM_ASSERT(inputSize == stencil.GetNumberOfValues());
77  vtkm::Id outputSize =
79  stencil.PrepareForInput(DeviceAdapterTagTBB(), token),
80  output.PrepareForOutput(inputSize, DeviceAdapterTagTBB(), token),
81  unary_predicate);
82  token.DetachFromAll();
83  output.Allocate(outputSize, vtkm::CopyFlag::On);
84  }
85 
86  template <typename T, typename U, class CIn, class COut>
88  vtkm::Id inputStartIndex,
89  vtkm::Id numberOfElementsToCopy,
91  vtkm::Id outputIndex = 0)
92  {
94 
95  const vtkm::Id inSize = input.GetNumberOfValues();
96 
97  // Check if the ranges overlap and fail if they do.
98  if (input == output &&
99  ((outputIndex >= inputStartIndex &&
100  outputIndex < inputStartIndex + numberOfElementsToCopy) ||
101  (inputStartIndex >= outputIndex &&
102  inputStartIndex < outputIndex + numberOfElementsToCopy)))
103  {
104  return false;
105  }
106 
107  if (inputStartIndex < 0 || numberOfElementsToCopy < 0 || outputIndex < 0 ||
108  inputStartIndex >= inSize)
109  { //invalid parameters
110  return false;
111  }
112 
113  //determine if the numberOfElementsToCopy needs to be reduced
114  if (inSize < (inputStartIndex + numberOfElementsToCopy))
115  { //adjust the size
116  numberOfElementsToCopy = (inSize - inputStartIndex);
117  }
118 
119  const vtkm::Id outSize = output.GetNumberOfValues();
120  const vtkm::Id copyOutEnd = outputIndex + numberOfElementsToCopy;
121  if (outSize < copyOutEnd)
122  { //output is not large enough
123  if (outSize == 0)
124  { //since output has nothing, just need to allocate to correct length
125  output.Allocate(copyOutEnd);
126  }
127  else
128  { //we currently have data in this array, so preserve it in the new
129  //resized array
131  temp.Allocate(copyOutEnd);
132  CopySubRange(output, 0, outSize, temp);
133  output = temp;
134  }
135  }
136 
137  vtkm::cont::Token token;
138  auto inputPortal = input.PrepareForInput(DeviceAdapterTagTBB(), token);
139  auto outputPortal = output.PrepareForInPlace(DeviceAdapterTagTBB(), token);
140 
142  inputPortal, outputPortal, inputStartIndex, outputIndex, numberOfElementsToCopy);
143 
144  return true;
145  }
146 
147  template <typename T, typename U, class CIn>
148  VTKM_CONT static auto Reduce(const vtkm::cont::ArrayHandle<T, CIn>& input, U initialValue)
149  -> decltype(Reduce(input, initialValue, vtkm::Add{}))
150  {
152 
153  return Reduce(input, initialValue, vtkm::Add());
154  }
155 
156  template <typename T, typename U, class CIn, class BinaryFunctor>
158  U initialValue,
159  BinaryFunctor binary_functor)
160  -> decltype(tbb::ReducePortals(input.ReadPortal(), initialValue, binary_functor))
161  {
163 
164  vtkm::cont::Token token;
165  return tbb::ReducePortals(input.PrepareForInput(vtkm::cont::DeviceAdapterTagTBB(), token),
166  initialValue,
167  binary_functor);
168  }
169 
170  template <typename T,
171  typename U,
172  class CKeyIn,
173  class CValIn,
174  class CKeyOut,
175  class CValOut,
176  class BinaryFunctor>
181  BinaryFunctor binary_functor)
182  {
184 
185  vtkm::cont::Token token;
186 
187  vtkm::Id inputSize = keys.GetNumberOfValues();
188  VTKM_ASSERT(inputSize == values.GetNumberOfValues());
189  vtkm::Id outputSize = tbb::ReduceByKeyPortals(
190  keys.PrepareForInput(DeviceAdapterTagTBB(), token),
191  values.PrepareForInput(DeviceAdapterTagTBB(), token),
192  keys_output.PrepareForOutput(inputSize, DeviceAdapterTagTBB(), token),
193  values_output.PrepareForOutput(inputSize, DeviceAdapterTagTBB(), token),
194  binary_functor);
195  token.DetachFromAll();
196  keys_output.Allocate(outputSize, vtkm::CopyFlag::On);
197  values_output.Allocate(outputSize, vtkm::CopyFlag::On);
198  }
199 
200  template <typename T, class CIn, class COut>
203  {
205 
206  vtkm::cont::Token token;
207  return tbb::ScanInclusivePortals(
210  vtkm::Add());
211  }
212 
213  template <typename T, class CIn, class COut, class BinaryFunctor>
216  BinaryFunctor binary_functor)
217  {
219 
220  vtkm::cont::Token token;
221  return tbb::ScanInclusivePortals(
224  binary_functor);
225  }
226 
227  template <typename T, class CIn, class COut>
230  {
232 
233  vtkm::cont::Token token;
234  return tbb::ScanExclusivePortals(
237  vtkm::Add(),
239  }
240 
241  template <typename T, class CIn, class COut, class BinaryFunctor>
244  BinaryFunctor binary_functor,
245  const T& initialValue)
246  {
248 
249  vtkm::cont::Token token;
250  return tbb::ScanExclusivePortals(
253  binary_functor,
254  initialValue);
255  }
256 
257  VTKM_CONT_EXPORT static void ScheduleTask(vtkm::exec::tbb::internal::TaskTiling1D& functor,
258  vtkm::Id size);
259  VTKM_CONT_EXPORT static void ScheduleTask(vtkm::exec::tbb::internal::TaskTiling3D& functor,
260  vtkm::Id3 size);
261 
262  template <typename Hints, typename FunctorType>
263  VTKM_CONT static inline void Schedule(Hints, FunctorType functor, vtkm::Id numInstances)
264  {
266  "Schedule TBB 1D: '%s'",
267  vtkm::cont::TypeToString(functor).c_str());
268 
269  vtkm::exec::tbb::internal::TaskTiling1D kernel(functor);
270  ScheduleTask(kernel, numInstances);
271  }
272 
273  template <typename FunctorType>
274  VTKM_CONT static inline void Schedule(FunctorType&& functor, vtkm::Id numInstances)
275  {
276  Schedule(vtkm::cont::internal::HintList<>{}, functor, numInstances);
277  }
278 
279  template <typename Hints, typename FunctorType>
280  VTKM_CONT static inline void Schedule(Hints, FunctorType functor, vtkm::Id3 rangeMax)
281  {
283  "Schedule TBB 3D: '%s'",
284  vtkm::cont::TypeToString(functor).c_str());
285 
286  vtkm::exec::tbb::internal::TaskTiling3D kernel(functor);
287  ScheduleTask(kernel, rangeMax);
288  }
289 
290  template <typename FunctorType>
291  VTKM_CONT static inline void Schedule(FunctorType&& functor, vtkm::Id3 rangeMax)
292  {
293  Schedule(vtkm::cont::internal::HintList<>{}, functor, rangeMax);
294  }
295 
296  //1. We need functions for each of the following
297 
298 
299  template <typename T, class Container>
301  {
303 
304  //this is required to get sort to work with zip handles
305  std::less<T> lessOp;
306  vtkm::cont::tbb::sort::parallel_sort(values, lessOp);
307  }
308 
309  template <typename T, class Container, class BinaryCompare>
311  BinaryCompare binary_compare)
312  {
314 
315  vtkm::cont::tbb::sort::parallel_sort(values, binary_compare);
316  }
317 
318  template <typename T, typename U, class StorageT, class StorageU>
321  {
323 
324  vtkm::cont::tbb::sort::parallel_sort_bykey(keys, values, std::less<T>());
325  }
326 
327  template <typename T, typename U, class StorageT, class StorageU, class BinaryCompare>
330  BinaryCompare binary_compare)
331  {
333 
334  vtkm::cont::tbb::sort::parallel_sort_bykey(keys, values, binary_compare);
335  }
336 
337  template <typename T, class Storage>
339  {
340  Unique(values, std::equal_to<T>());
341  }
342 
343  template <typename T, class Storage, class BinaryCompare>
345  BinaryCompare binary_compare)
346  {
348 
349  vtkm::Id outputSize;
350  {
351  vtkm::cont::Token token;
352  outputSize =
353  tbb::UniquePortals(values.PrepareForInPlace(DeviceAdapterTagTBB(), token), binary_compare);
354  }
355  values.Allocate(outputSize, vtkm::CopyFlag::On);
356  }
357 
358  VTKM_CONT static void Synchronize()
359  {
360  // Nothing to do. This device schedules all of its operations using a
361  // split/join paradigm. This means that the if the control threaad is
362  // calling this method, then nothing should be running in the execution
363  // environment.
364  }
365 };
366 
369 template <>
371 {
372 public:
374 
376  {
377  this->StartReady = false;
378  this->StopReady = false;
379  }
380 
382  {
383  this->Reset();
384  this->StartTime = this->GetCurrentTime();
385  this->StartReady = true;
386  }
387 
389  {
390  this->StopTime = this->GetCurrentTime();
391  this->StopReady = true;
392  }
393 
394  VTKM_CONT bool Started() const { return this->StartReady; }
395 
396  VTKM_CONT bool Stopped() const { return this->StopReady; }
397 
398  VTKM_CONT bool Ready() const { return true; }
399 
401  {
402  assert(this->StartReady);
403  if (!this->StartReady)
404  {
406  "Start() function should be called first then trying to call Stop() and"
407  " GetElapsedTime().");
408  return 0;
409  }
410 
411  ::tbb::tick_count startTime = this->StartTime;
412  ::tbb::tick_count stopTime = this->StopReady ? this->StopTime : this->GetCurrentTime();
413 
414  ::tbb::tick_count::interval_t elapsedTime = stopTime - startTime;
415 
416  return static_cast<vtkm::Float64>(elapsedTime.seconds());
417  }
418 
419  VTKM_CONT::tbb::tick_count GetCurrentTime() const
420  {
422  return ::tbb::tick_count::now();
423  }
424 
425 private:
427  bool StopReady;
428  ::tbb::tick_count StartTime;
429  ::tbb::tick_count StopTime;
430 };
431 
432 template <>
434 {
435 public:
436  template <typename Hints, typename WorkletType, typename InvocationType>
437  static vtkm::exec::tbb::internal::TaskTiling1D MakeTask(WorkletType& worklet,
438  InvocationType& invocation,
439  vtkm::Id,
440  Hints = Hints{})
441  {
442  // Currently ignoring hints.
443  return vtkm::exec::tbb::internal::TaskTiling1D(worklet, invocation);
444  }
445 
446  template <typename Hints, typename WorkletType, typename InvocationType>
447  static vtkm::exec::tbb::internal::TaskTiling3D MakeTask(WorkletType& worklet,
448  InvocationType& invocation,
449  vtkm::Id3,
450  Hints = Hints{})
451  {
452  // Currently ignoring hints.
453  return vtkm::exec::tbb::internal::TaskTiling3D(worklet, invocation);
454  }
455 
456  template <typename WorkletType, typename InvocationType, typename RangeType>
457  VTKM_CONT static auto MakeTask(WorkletType& worklet,
458  InvocationType& invocation,
459  const RangeType& range)
460  {
461  return MakeTask<vtkm::cont::internal::HintList<>>(worklet, invocation, range);
462  }
463 };
464 }
465 } // namespace vtkm::cont
466 
467 #endif //vtk_m_cont_tbb_internal_DeviceAdapterAlgorithmTBB_h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Sort
static void Sort(vtkm::cont::ArrayHandle< T, Container > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmTBB.h:310
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Schedule
static void Schedule(Hints, FunctorType functor, vtkm::Id3 rangeMax)
Definition: DeviceAdapterAlgorithmTBB.h:280
vtkm::cont::TypeToString
std::string TypeToString(const std::type_info &t)
Use RTTI information to retrieve the name of the type T.
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Reduce
static auto Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue, BinaryFunctor binary_functor) -> decltype(tbb::ReducePortals(input.ReadPortal(), initialValue, binary_functor))
Definition: DeviceAdapterAlgorithmTBB.h:157
VTKM_LOG_SCOPE
#define VTKM_LOG_SCOPE(level,...)
Definition: Logging.h:211
vtkm::cont::DeviceAdapterTimerImplementation::StopTime
TimeStamp StopTime
Definition: DeviceAdapterAlgorithm.h:704
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::CopySubRange
static bool CopySubRange(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::Id inputStartIndex, vtkm::Id numberOfElementsToCopy, vtkm::cont::ArrayHandle< U, COut > &output, vtkm::Id outputIndex=0)
Definition: DeviceAdapterAlgorithmTBB.h:87
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::Reset
void Reset()
Definition: DeviceAdapterAlgorithmTBB.h:375
ArrayHandle.h
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::Started
bool Started() const
Definition: DeviceAdapterAlgorithmTBB.h:394
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Copy
static void Copy(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: DeviceAdapterAlgorithmTBB.h:40
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::CopyIf
static void CopyIf(const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< U, CStencil > &stencil, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmTBB.h:55
vtkm::cont::tbb::ReduceByKeyPortals
vtkm::Id ReduceByKeyPortals(KeysInPortalType keysInPortal, ValuesInPortalType valuesInPortal, KeysOutPortalType keysOutPortal, ValuesOutPortalType valuesOutPortal, BinaryOperationType binaryOperation)
Definition: FunctorsTBB.h:787
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Schedule
static void Schedule(FunctorType &&functor, vtkm::Id numInstances)
Definition: DeviceAdapterAlgorithmTBB.h:274
vtkm::TypeTraits
The TypeTraits class provides helpful compile-time information about the basic types used in VTKm (an...
Definition: TypeTraits.h:61
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::ScanInclusive
static T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmTBB.h:201
vtkm::cont::DeviceAdapterAlgorithm::Schedule
static void Schedule(Functor functor, vtkm::Id numInstances)
Schedule many instances of a function to run on concurrent threads.
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::ScanExclusive
static T ScanExclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output, BinaryFunctor binary_functor, const T &initialValue)
Definition: DeviceAdapterAlgorithmTBB.h:242
DeviceAdapterTagTBB.h
DeviceAdapterAlgorithmGeneral.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::ScanInclusive
static T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output, BinaryFunctor binary_functor)
Definition: DeviceAdapterAlgorithmTBB.h:214
vtkm::cont::ArrayHandle::GetNumberOfValues
vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:468
IteratorFromArrayPortal.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::CopyIf
static void CopyIf(const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< U, CStencil > &stencil, vtkm::cont::ArrayHandle< T, COut > &output, UnaryPredicate unary_predicate)
Definition: DeviceAdapterAlgorithmTBB.h:66
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::Ready
bool Ready() const
Definition: DeviceAdapterAlgorithmTBB.h:398
DeviceAdapterAlgorithm.h
vtkm::cont::tbb::UniquePortals
vtkm::Id UniquePortals(PortalType portal, BinaryOperationType binaryOperation)
Definition: FunctorsTBB.h:1364
vtkm::cont::DeviceAdapterAlgorithm::Unique
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Reduce an array to only the unique values it contains.
ArrayHandleZip.h
vtkm::Add
Definition: Types.h:260
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::DeviceAdapterTimerImplementation
DeviceAdapterTimerImplementation()
Definition: DeviceAdapterAlgorithmTBB.h:373
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::Stopped
bool Stopped() const
Definition: DeviceAdapterAlgorithmTBB.h:396
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::Stop
void Stop()
Definition: DeviceAdapterAlgorithmTBB.h:388
vtkm::cont::ArrayHandle::PrepareForInPlace
WritePortalType PrepareForInPlace(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this array to be used in an in-place operation (both as input and output) in the execution e...
Definition: ArrayHandle.h:618
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::SortByKey
static void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmTBB.h:328
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::StopTime
::tbb::tick_count StopTime
Definition: DeviceAdapterAlgorithmTBB.h:429
vtkm::cont::tbb::sort::parallel_sort_bykey
void parallel_sort_bykey(vtkm::cont::ArrayHandle< T, StorageT > &, vtkm::cont::ArrayHandle< U, StorageU > &, BinaryCompare)
Definition: ParallelSortTBB.h:225
ArrayHandleIndex.h
VTKM_CONT_EXPORT
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
FunctorsTBB.h
vtkm::cont::DeviceAdapterAlgorithm::U
static T U
Definition: DeviceAdapterAlgorithm.h:347
vtkm::cont::DeviceAdapterTimerImplementation::StartReady
bool StartReady
Definition: DeviceAdapterAlgorithm.h:701
vtkm::cont::ArrayHandle::PrepareForOutput
WritePortalType PrepareForOutput(vtkm::Id numberOfValues, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares (allocates) this array to be used as an output from an operation in the execution environmen...
Definition: ArrayHandle.h:638
vtkm::cont::DeviceAdapterTimerImplementation::StopReady
bool StopReady
Definition: DeviceAdapterAlgorithm.h:702
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::GetElapsedTime
vtkm::Float64 GetElapsedTime() const
Definition: DeviceAdapterAlgorithmTBB.h:400
vtkm::cont::DeviceTaskTypes
Class providing a device-specific support for selecting the optimal Task type for a given worklet.
Definition: DeviceAdapterAlgorithm.h:744
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::SortByKey
static void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values)
Definition: DeviceAdapterAlgorithmTBB.h:319
vtkm::cont::DeviceAdapterTagTBB
Tag for a device adapter that uses the Intel Threading Building Blocks library to run algorithms on m...
Definition: DeviceAdapterTagTBB.h:27
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
VTKM_LOG_SCOPE_FUNCTION
#define VTKM_LOG_SCOPE_FUNCTION(level)
Definition: Logging.h:214
TaskTiling.h
vtkm::cont::DeviceAdapterAlgorithm
Struct containing device adapter algorithms.
Definition: DeviceAdapterAlgorithm.h:41
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Reduce
static auto Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue) -> decltype(Reduce(input, initialValue, vtkm::Add
Definition: DeviceAdapterAlgorithmTBB.h:148
vtkm::CopyFlag::On
@ On
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::ScanExclusive
static T ScanExclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmTBB.h:228
vtkm::cont::Token::DetachFromAll
void DetachFromAll()
Detaches this Token from all resources to allow them to be used elsewhere or deleted.
ErrorExecution.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Schedule
static void Schedule(Hints, FunctorType functor, vtkm::Id numInstances)
Definition: DeviceAdapterAlgorithmTBB.h:263
vtkm::cont::LogLevel::Error
@ Error
Important but non-fatal errors, such as device fail-over.
vtkm::cont::DeviceAdapterAlgorithm::CopySubRange
static bool CopySubRange(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::Id inputStartIndex, vtkm::Id numberOfElementsToCopy, vtkm::cont::ArrayHandle< U, COut > &output, vtkm::Id outputIndex=0)
Copy the contents of a section of one ArrayHandle to another.
VTKM_LOG_S
#define VTKM_LOG_S(level,...)
Writes a message using stream syntax to the indicated log level.
Definition: Logging.h:208
vtkm::cont::DeviceAdapterTimerImplementation
Class providing a device-specific timer.
Definition: DeviceAdapterAlgorithm.h:613
vtkm::Vec< vtkm::Id, 3 >
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagTBB >::MakeTask
static auto MakeTask(WorkletType &worklet, InvocationType &invocation, const RangeType &range)
Definition: DeviceAdapterAlgorithmTBB.h:457
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Unique
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: DeviceAdapterAlgorithmTBB.h:338
vtkm::cont::tbb::CopyIfPortals
vtkm::Id CopyIfPortals(InputPortalType inputPortal, StencilPortalType stencilPortal, OutputPortalType outputPortal, UnaryPredicateType unaryPredicate)
Definition: FunctorsTBB.h:347
vtkm::NotZeroInitialized
Predicate that takes a single argument x, and returns True if it isn't the identity of the Type T.
Definition: UnaryPredicates.h:32
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Sort
static void Sort(vtkm::cont::ArrayHandle< T, Container > &values)
Definition: DeviceAdapterAlgorithmTBB.h:300
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Unique
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmTBB.h:344
vtkm::cont::DeviceAdapterAlgorithm::CopyIf
static void CopyIf(const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< U, CStencil > &stencil, vtkm::cont::ArrayHandle< T, COut > &output)
Conditionally copy elements in the input array to the output array.
vtkm::cont::DeviceAdapterTimerImplementation::Reset
void Reset()
Resets the timer.
Definition: DeviceAdapterAlgorithm.h:630
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::StopReady
bool StopReady
Definition: DeviceAdapterAlgorithmTBB.h:427
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagTBB >::MakeTask
static vtkm::exec::tbb::internal::TaskTiling3D MakeTask(WorkletType &worklet, InvocationType &invocation, vtkm::Id3, Hints=Hints{})
Definition: DeviceAdapterAlgorithmTBB.h:447
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::StartTime
::tbb::tick_count StartTime
Definition: DeviceAdapterAlgorithmTBB.h:428
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::cont::ArrayHandle::PrepareForInput
ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this array to be used as an input to an operation in the execution environment.
Definition: ArrayHandle.h:599
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Synchronize
static void Synchronize()
Definition: DeviceAdapterAlgorithmTBB.h:358
vtkm::cont::DeviceAdapterAlgorithm::Reduce
static U Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Compute a accumulated sum operation on the input ArrayHandle.
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagTBB >::MakeTask
static vtkm::exec::tbb::internal::TaskTiling1D MakeTask(WorkletType &worklet, InvocationType &invocation, vtkm::Id, Hints=Hints{})
Definition: DeviceAdapterAlgorithmTBB.h:437
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::GetCurrentTime
::tbb::tick_count GetCurrentTime() const
Definition: DeviceAdapterAlgorithmTBB.h:419
vtkm::cont::ArrayHandle::Allocate
void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:490
Logging.h
Logging utilities.
ParallelSortTBB.h
vtkm::cont::DeviceAdapterTimerImplementation::GetCurrentTime
TimeStamp GetCurrentTime() const
Definition: DeviceAdapterAlgorithm.h:682
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::Start
void Start()
Definition: DeviceAdapterAlgorithmTBB.h:381
vtkm::cont::DeviceAdapterTimerImplementation::StartTime
TimeStamp StartTime
Definition: DeviceAdapterAlgorithm.h:703
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagTBB >::StartReady
bool StartReady
Definition: DeviceAdapterAlgorithmTBB.h:426
vtkm::cont::tbb::sort::parallel_sort
void parallel_sort(vtkm::cont::ArrayHandle< T, Container > &, BinaryCompare)
Definition: ParallelSortTBB.h:79
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::Schedule
static void Schedule(FunctorType &&functor, vtkm::Id3 rangeMax)
Definition: DeviceAdapterAlgorithmTBB.h:291
vtkm::cont::tbb::CopyPortals
void CopyPortals(const InputPortalType &inPortal, const OutputPortalType &outPortal, vtkm::Id inOffset, vtkm::Id outOffset, vtkm::Id numValues)
Definition: FunctorsTBB.h:146
vtkm::cont::LogLevel::Perf
@ Perf
General timing data and algorithm flow information, such as filter execution, worklet dispatches,...
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagTBB >::ReduceByKey
static void ReduceByKey(const vtkm::cont::ArrayHandle< T, CKeyIn > &keys, const vtkm::cont::ArrayHandle< U, CValIn > &values, vtkm::cont::ArrayHandle< T, CKeyOut > &keys_output, vtkm::cont::ArrayHandle< U, CValOut > &values_output, BinaryFunctor binary_functor)
Definition: DeviceAdapterAlgorithmTBB.h:177