VTK-m  2.2
DeviceAdapterAlgorithmOpenMP.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_openmp_internal_DeviceAdapterAlgorithmOpenMP_h
11 #define vtk_m_cont_openmp_internal_DeviceAdapterAlgorithmOpenMP_h
12 
14 #include <vtkm/cont/Error.h>
15 #include <vtkm/cont/Logging.h>
17 
23 
24 #include <omp.h>
25 
26 #include <algorithm>
27 #include <type_traits>
28 
29 namespace vtkm
30 {
31 namespace cont
32 {
33 
34 template <>
36  : vtkm::cont::internal::DeviceAdapterAlgorithmGeneral<
37  DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagOpenMP>,
38  vtkm::cont::DeviceAdapterTagOpenMP>
39 {
41 
42 public:
43  template <typename T, typename U, class CIn, class COut>
46  {
48 
49  using namespace vtkm::cont::openmp;
50 
51  const vtkm::Id inSize = input.GetNumberOfValues();
52  if (inSize == 0)
53  {
54  output.Allocate(0);
55  return;
56  }
57  vtkm::cont::Token token;
58  auto inputPortal = input.PrepareForInput(DevTag(), token);
59  auto outputPortal = output.PrepareForOutput(inSize, DevTag(), token);
60  CopyHelper(inputPortal, outputPortal, 0, 0, inSize);
61  }
62 
63  template <typename T, typename U, class CIn, class CStencil, class COut>
67  {
69 
70  ::vtkm::NotZeroInitialized unary_predicate;
71  CopyIf(input, stencil, output, unary_predicate);
72  }
73 
74  template <typename T, typename U, class CIn, class CStencil, class COut, class UnaryPredicate>
78  UnaryPredicate unary_predicate)
79  {
81 
82  using namespace vtkm::cont::openmp;
83 
84  vtkm::Id inSize = input.GetNumberOfValues();
85  if (inSize == 0)
86  {
87  output.Allocate(0);
88  return;
89  }
90  vtkm::cont::Token token;
91  auto inputPortal = input.PrepareForInput(DevTag(), token);
92  auto stencilPortal = stencil.PrepareForInput(DevTag(), token);
93  auto outputPortal = output.PrepareForOutput(inSize, DevTag(), token);
94 
95  auto inIter = vtkm::cont::ArrayPortalToIteratorBegin(inputPortal);
96  auto stencilIter = vtkm::cont::ArrayPortalToIteratorBegin(stencilPortal);
97  auto outIter = vtkm::cont::ArrayPortalToIteratorBegin(outputPortal);
98 
99  CopyIfHelper helper;
100  helper.Initialize(inSize, sizeof(T));
101 
102  VTKM_OPENMP_DIRECTIVE(parallel default(shared))
103  {
104  VTKM_OPENMP_DIRECTIVE(for schedule(static))
105  for (vtkm::Id i = 0; i < helper.NumChunks; ++i)
106  {
107  helper.CopyIf(inIter, stencilIter, outIter, unary_predicate, i);
108  }
109  }
110 
111  vtkm::Id numValues = helper.Reduce(outIter);
112  token.DetachFromAll();
113  output.Allocate(numValues, vtkm::CopyFlag::On);
114  }
115 
116 
117  template <typename T, typename U, class CIn, class COut>
119  vtkm::Id inputStartIndex,
120  vtkm::Id numberOfValuesToCopy,
122  vtkm::Id outputIndex = 0)
123  {
125 
126  using namespace vtkm::cont::openmp;
127 
128  const vtkm::Id inSize = input.GetNumberOfValues();
129 
130  // Check if the ranges overlap and fail if they do.
131  if (input == output &&
132  ((outputIndex >= inputStartIndex && outputIndex < inputStartIndex + numberOfValuesToCopy) ||
133  (inputStartIndex >= outputIndex && inputStartIndex < outputIndex + numberOfValuesToCopy)))
134  {
135  return false;
136  }
137 
138  if (inputStartIndex < 0 || numberOfValuesToCopy < 0 || outputIndex < 0 ||
139  inputStartIndex >= inSize)
140  { //invalid parameters
141  return false;
142  }
143 
144  //determine if the numberOfElementsToCopy needs to be reduced
145  if (inSize < (inputStartIndex + numberOfValuesToCopy))
146  { //adjust the size
147  numberOfValuesToCopy = (inSize - inputStartIndex);
148  }
149 
150  const vtkm::Id outSize = output.GetNumberOfValues();
151  const vtkm::Id copyOutEnd = outputIndex + numberOfValuesToCopy;
152  if (outSize < copyOutEnd)
153  { //output is not large enough
154  if (outSize == 0)
155  { //since output has nothing, just need to allocate to correct length
156  output.Allocate(copyOutEnd);
157  }
158  else
159  { //we currently have data in this array, so preserve it in the new
160  //resized array
162  temp.Allocate(copyOutEnd);
163  CopySubRange(output, 0, outSize, temp);
164  output = temp;
165  }
166  }
167 
168  vtkm::cont::Token token;
169  auto inputPortal = input.PrepareForInput(DevTag(), token);
170  auto outputPortal = output.PrepareForInPlace(DevTag(), token);
171 
172  CopyHelper(inputPortal, outputPortal, inputStartIndex, outputIndex, numberOfValuesToCopy);
173 
174  return true;
175  }
176 
177  template <typename T, typename U, class CIn>
178  VTKM_CONT static U Reduce(const vtkm::cont::ArrayHandle<T, CIn>& input, U initialValue)
179  {
181 
182  return Reduce(input, initialValue, vtkm::Add());
183  }
184 
185  template <typename T, typename U, class CIn, class BinaryFunctor>
187  U initialValue,
188  BinaryFunctor binary_functor)
189  {
191 
192  using namespace vtkm::cont::openmp;
193 
194  vtkm::cont::Token token;
195  auto portal = input.PrepareForInput(DevTag(), token);
197 
198  return ReduceHelper::Execute(portal, initialValue, binary_functor, fastPath);
199  }
200 
201  template <typename T,
202  typename U,
203  class CKeyIn,
204  class CValIn,
205  class CKeyOut,
206  class CValOut,
207  class BinaryFunctor>
212  BinaryFunctor func)
213  {
215 
216  openmp::ReduceByKeyHelper(keys, values, keys_output, values_output, func);
217  }
218 
219  template <typename T, class CIn, class COut>
222  {
224 
225  return ScanInclusive(input, output, vtkm::Add());
226  }
227 
228  template <typename T, class CIn, class COut, class BinaryFunctor>
231  BinaryFunctor binaryFunctor)
232  {
234 
235  if (input.GetNumberOfValues() <= 0)
236  {
238  }
239 
240  vtkm::cont::Token token;
241  using InPortalT = decltype(input.PrepareForInput(DevTag(), token));
242  using OutPortalT = decltype(output.PrepareForOutput(0, DevTag(), token));
244 
245  vtkm::Id numVals = input.GetNumberOfValues();
246  Impl impl(input.PrepareForInput(DevTag(), token),
247  output.PrepareForOutput(numVals, DevTag(), token),
248  binaryFunctor);
249 
250  return impl.Execute(vtkm::Id2(0, numVals));
251  }
252 
253  template <typename T, class CIn, class COut>
256  {
258 
260  }
261 
262  template <typename T, class CIn, class COut, class BinaryFunctor>
265  BinaryFunctor binaryFunctor,
266  const T& initialValue)
267  {
269 
270  if (input.GetNumberOfValues() <= 0)
271  {
272  return initialValue;
273  }
274 
275  vtkm::cont::Token token;
276  using InPortalT = decltype(input.PrepareForInput(DevTag(), token));
277  using OutPortalT = decltype(output.PrepareForOutput(0, DevTag(), token));
279 
280  vtkm::Id numVals = input.GetNumberOfValues();
281  Impl impl(input.PrepareForInput(DevTag(), token),
282  output.PrepareForOutput(numVals, DevTag(), token),
283  binaryFunctor,
284  initialValue);
285 
286  return impl.Execute(vtkm::Id2(0, numVals));
287  }
288 
294  template <typename T, class Storage>
296  {
298 
299  Sort(values, vtkm::SortLess());
300  }
301 
302  template <typename T, class Storage, class BinaryCompare>
304  BinaryCompare binary_compare)
305  {
307 
308  openmp::sort::parallel_sort(values, binary_compare);
309  }
310 
311  template <typename T, typename U, class StorageT, class StorageU>
314  {
316 
317  SortByKey(keys, values, std::less<T>());
318  }
319 
320  template <typename T, typename U, class StorageT, class StorageU, class BinaryCompare>
323  BinaryCompare binary_compare)
324  {
326 
327  openmp::sort::parallel_sort_bykey(keys, values, binary_compare);
328  }
329 
330  template <typename T, class Storage>
332  {
334 
335  Unique(values, std::equal_to<T>());
336  }
337 
338  template <typename T, class Storage, class BinaryCompare>
340  BinaryCompare binary_compare)
341  {
343 
344  vtkm::cont::Token token;
345  auto portal = values.PrepareForInPlace(DevTag(), token);
346  auto iter = vtkm::cont::ArrayPortalToIteratorBegin(portal);
347 
348  using IterT = typename std::decay<decltype(iter)>::type;
350 
351  Uniqifier uniquifier(iter, portal.GetNumberOfValues(), binary_compare);
352  vtkm::Id outSize = uniquifier.Execute();
353  token.DetachFromAll();
354  values.Allocate(outSize, vtkm::CopyFlag::On);
355  }
356 
357  VTKM_CONT_EXPORT static void ScheduleTask(vtkm::exec::openmp::internal::TaskTiling1D& functor,
358  vtkm::Id size);
359  VTKM_CONT_EXPORT static void ScheduleTask(vtkm::exec::openmp::internal::TaskTiling3D& functor,
360  vtkm::Id3 size);
361 
362  template <typename Hints, typename FunctorType>
363  VTKM_CONT static inline void Schedule(Hints, FunctorType functor, vtkm::Id numInstances)
364  {
366 
367  vtkm::exec::openmp::internal::TaskTiling1D kernel(functor);
368  ScheduleTask(kernel, numInstances);
369  }
370 
371  template <typename FunctorType>
372  VTKM_CONT static inline void Schedule(FunctorType&& functor, vtkm::Id numInstances)
373  {
374  Schedule(vtkm::cont::internal::HintList<>{}, functor, numInstances);
375  }
376 
377  template <typename Hints, typename FunctorType>
378  VTKM_CONT static inline void Schedule(Hints, FunctorType functor, vtkm::Id3 rangeMax)
379  {
381 
382  vtkm::exec::openmp::internal::TaskTiling3D kernel(functor);
383  ScheduleTask(kernel, rangeMax);
384  }
385 
386  template <typename FunctorType>
387  VTKM_CONT static inline void Schedule(FunctorType&& functor, vtkm::Id3 rangeMax)
388  {
389  Schedule(vtkm::cont::internal::HintList<>{}, functor, rangeMax);
390  }
391 
392  VTKM_CONT static void Synchronize()
393  {
394  // Nothing to do. This device schedules all of its operations using a
395  // split/join paradigm. This means that the if the control thread is
396  // calling this method, then nothing should be running in the execution
397  // environment.
398  }
399 };
400 
401 template <>
403 {
404 public:
405  template <typename Hints, typename WorkletType, typename InvocationType>
406  static vtkm::exec::openmp::internal::TaskTiling1D MakeTask(const WorkletType& worklet,
407  const InvocationType& invocation,
408  vtkm::Id,
409  Hints = Hints{})
410  {
411  // Currently ignoring hints.
412  return vtkm::exec::openmp::internal::TaskTiling1D(worklet, invocation);
413  }
414 
415  template <typename Hints, typename WorkletType, typename InvocationType>
416  static vtkm::exec::openmp::internal::TaskTiling3D MakeTask(const WorkletType& worklet,
417  const InvocationType& invocation,
418  vtkm::Id3,
419  Hints = Hints{})
420  {
421  // Currently ignoring hints.
422  return vtkm::exec::openmp::internal::TaskTiling3D(worklet, invocation);
423  }
424 
425  template <typename WorkletType, typename InvocationType, typename RangeType>
426  VTKM_CONT static auto MakeTask(WorkletType& worklet,
427  InvocationType& invocation,
428  const RangeType& range)
429  {
430  return MakeTask<vtkm::cont::internal::HintList<>>(worklet, invocation, range);
431  }
432 };
433 }
434 } // namespace vtkm::cont
435 
436 #endif //vtk_m_cont_openmp_internal_DeviceAdapterAlgorithmOpenMP_h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Synchronize
static void Synchronize()
Definition: DeviceAdapterAlgorithmOpenMP.h:392
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Reduce
static U Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: DeviceAdapterAlgorithmOpenMP.h:178
vtkm::cont::DeviceAdapterAlgorithm::ScanExclusive
static T ScanExclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Compute an exclusive prefix sum operation on the input ArrayHandle.
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::SortByKey
static void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values)
Definition: DeviceAdapterAlgorithmOpenMP.h:312
vtkm::cont::openmp::CopyIfHelper::CopyIf
void CopyIf(InIterT inIter, StencilIterT stencilIter, OutIterT outIter, PredicateT pred, vtkm::Id chunk)
Definition: FunctorsOpenMP.h:214
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagOpenMP >::MakeTask
static vtkm::exec::openmp::internal::TaskTiling1D MakeTask(const WorkletType &worklet, const InvocationType &invocation, vtkm::Id, Hints=Hints{})
Definition: DeviceAdapterAlgorithmOpenMP.h:406
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::CopySubRange
static bool CopySubRange(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::Id inputStartIndex, vtkm::Id numberOfValuesToCopy, vtkm::cont::ArrayHandle< U, COut > &output, vtkm::Id outputIndex=0)
Definition: DeviceAdapterAlgorithmOpenMP.h:118
vtkm::cont::openmp::CopyIfHelper::NumChunks
vtkm::Id NumChunks
Definition: FunctorsOpenMP.h:191
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::DeviceAdapterTagOpenMP
Tag for a device adapter that uses OpenMP compiler extensions to run algorithms on multiple threads.
Definition: DeviceAdapterTagOpenMP.h:25
vtkm::TypeTraits
The TypeTraits class provides helpful compile-time information about the basic types used in VTKm (an...
Definition: TypeTraits.h:61
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Sort
static void Sort(vtkm::cont::ArrayHandle< T, Storage > &values)
Unstable ascending sort of input array.
Definition: DeviceAdapterAlgorithmOpenMP.h:295
vtkm::cont::DeviceAdapterAlgorithm::Schedule
static void Schedule(Functor functor, vtkm::Id numInstances)
Schedule many instances of a function to run on concurrent threads.
DeviceAdapterAlgorithmGeneral.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Schedule
static void Schedule(Hints, FunctorType functor, vtkm::Id numInstances)
Definition: DeviceAdapterAlgorithmOpenMP.h:363
vtkm::cont::ArrayHandle::GetNumberOfValues
vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:468
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::SortByKey
static void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmOpenMP.h:321
FunctorsOpenMP.h
DeviceAdapterAlgorithm.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Unique
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmOpenMP.h:339
vtkm::cont::DeviceAdapterAlgorithm::Unique
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Reduce an array to only the unique values it contains.
DeviceAdapterTagOpenMP.h
vtkm::Add
Definition: Types.h:260
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Copy
static void Copy(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: DeviceAdapterAlgorithmOpenMP.h:44
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagOpenMP >::MakeTask
static vtkm::exec::openmp::internal::TaskTiling3D MakeTask(const WorkletType &worklet, const InvocationType &invocation, vtkm::Id3, Hints=Hints{})
Definition: DeviceAdapterAlgorithmOpenMP.h:416
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::openmp::scan::Adder
Definition: ParallelScanOpenMP.h:56
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Schedule
static void Schedule(Hints, FunctorType functor, vtkm::Id3 rangeMax)
Definition: DeviceAdapterAlgorithmOpenMP.h:378
vtkm::SortLess
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is less...
Definition: BinaryPredicates.h:45
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::openmp::sort::parallel_sort
void parallel_sort(vtkm::cont::ArrayHandle< T, Container > &, BinaryCompare)
Definition: ParallelSortOpenMP.h:75
vtkm::cont::openmp::ReduceByKeyHelper
void ReduceByKeyHelper(KeysInArray keysInArray, ValuesInArray valuesInArray, KeysOutArray keysOutArray, ValuesOutArray valuesOutArray, BinaryFunctor functor)
Definition: FunctorsOpenMP.h:514
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Schedule
static void Schedule(FunctorType &&functor, vtkm::Id3 rangeMax)
Definition: DeviceAdapterAlgorithmOpenMP.h:387
vtkm::cont::DeviceAdapterAlgorithm::ScanInclusive
static T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Compute an inclusive prefix sum operation on the input ArrayHandle.
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::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 func)
Definition: DeviceAdapterAlgorithmOpenMP.h:208
vtkm::cont::DeviceAdapterAlgorithm::Sort
static void Sort(vtkm::cont::ArrayHandle< T, Storage > &values)
Unstable ascending sort of input array.
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanInclusive
static T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output, BinaryFunctor binaryFunctor)
Definition: DeviceAdapterAlgorithmOpenMP.h:229
Error.h
VTKM_CONT_EXPORT
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
vtkm::cont::DeviceAdapterAlgorithm::U
static T U
Definition: DeviceAdapterAlgorithm.h:347
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::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::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: DeviceAdapterAlgorithmOpenMP.h:64
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagOpenMP >::MakeTask
static auto MakeTask(WorkletType &worklet, InvocationType &invocation, const RangeType &range)
Definition: DeviceAdapterAlgorithmOpenMP.h:426
vtkm::cont::DeviceTaskTypes
Class providing a device-specific support for selecting the optimal Task type for a given worklet.
Definition: DeviceAdapterAlgorithm.h:744
ParallelScanOpenMP.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
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
vtkm::cont::openmp::CopyIfHelper::Initialize
void Initialize(vtkm::Id numValues, vtkm::Id valueSize)
Definition: FunctorsOpenMP.h:197
vtkm::cont::DeviceAdapterAlgorithm
Struct containing device adapter algorithms.
Definition: DeviceAdapterAlgorithm.h:41
vtkm::CopyFlag::On
@ On
vtkm::cont::DeviceAdapterAlgorithm::SortByKey
static void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values)
Unstable ascending sort of keys and values.
vtkm::cont::Token::DetachFromAll
void DetachFromAll()
Detaches this Token from all resources to allow them to be used elsewhere or deleted.
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Reduce
static U Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue, BinaryFunctor binary_functor)
Definition: DeviceAdapterAlgorithmOpenMP.h:186
VTKM_OPENMP_DIRECTIVE
#define VTKM_OPENMP_DIRECTIVE(directive)
Definition: FunctorsOpenMP.h:37
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Sort
static void Sort(vtkm::cont::ArrayHandle< T, Storage > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmOpenMP.h:303
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::Vec< vtkm::Id, 2 >
vtkm::cont::openmp::UniqueHelper
Definition: FunctorsOpenMP.h:635
vtkm::cont::openmp::OpenMPReductionSupported
std::false_type OpenMPReductionSupported
Definition: FunctorsOpenMP.h:303
vtkm::cont::openmp::CopyIfHelper::Reduce
vtkm::Id Reduce(OutIterT data)
Definition: FunctorsOpenMP.h:236
ParallelSortOpenMP.h
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::DeviceAdapterTagOpenMP >::ScanInclusive
static T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmOpenMP.h:220
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::ArrayPortalToIteratorBegin
vtkm::cont::ArrayPortalToIterators< PortalType >::IteratorType ArrayPortalToIteratorBegin(const PortalType &portal)
Convenience function for converting an ArrayPortal to a begin iterator.
Definition: ArrayPortalToIterators.h:178
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanExclusive
static T ScanExclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmOpenMP.h:254
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::TypeTraits::ZeroInitialization
static T ZeroInitialization()
A static function that returns 0 (or the closest equivalent to it) for the given type.
Definition: TypeTraits.h:77
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::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Unique
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: DeviceAdapterAlgorithmOpenMP.h:331
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
vtkm::cont::openmp::CopyIfHelper
Definition: FunctorsOpenMP.h:185
Logging.h
Logging utilities.
vtkm::cont::openmp::sort::parallel_sort_bykey
void parallel_sort_bykey(vtkm::cont::ArrayHandle< T, StorageT > &, vtkm::cont::ArrayHandle< U, StorageU > &, BinaryCompare)
Definition: ParallelSortOpenMP.h:244
TaskTilingOpenMP.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanExclusive
static T ScanExclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output, BinaryFunctor binaryFunctor, const T &initialValue)
Definition: DeviceAdapterAlgorithmOpenMP.h:263
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::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: DeviceAdapterAlgorithmOpenMP.h:75
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Schedule
static void Schedule(FunctorType &&functor, vtkm::Id numInstances)
Definition: DeviceAdapterAlgorithmOpenMP.h:372
vtkm::cont::LogLevel::Perf
@ Perf
General timing data and algorithm flow information, such as filter execution, worklet dispatches,...
vtkm::cont::openmp
OPenMP implementation for Control Environment.
Definition: FunctorsOpenMP.h:63