VTK-m  1.8
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 <>
35 struct DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagOpenMP>
36  : vtkm::cont::internal::DeviceAdapterAlgorithmGeneral<
37  DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagOpenMP>,
38  vtkm::cont::DeviceAdapterTagOpenMP>
39 {
40  using DevTag = DeviceAdapterTagOpenMP;
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 <class FunctorType>
363  VTKM_CONT static inline void Schedule(FunctorType functor, vtkm::Id numInstances)
364  {
366 
367  vtkm::exec::openmp::internal::TaskTiling1D kernel(functor);
368  ScheduleTask(kernel, numInstances);
369  }
370 
371  template <class FunctorType>
372  VTKM_CONT static inline void Schedule(FunctorType functor, vtkm::Id3 rangeMax)
373  {
375 
376  vtkm::exec::openmp::internal::TaskTiling3D kernel(functor);
377  ScheduleTask(kernel, rangeMax);
378  }
379 
380  VTKM_CONT static void Synchronize()
381  {
382  // Nothing to do. This device schedules all of its operations using a
383  // split/join paradigm. This means that the if the control thread is
384  // calling this method, then nothing should be running in the execution
385  // environment.
386  }
387 };
388 
389 template <>
390 class DeviceTaskTypes<vtkm::cont::DeviceAdapterTagOpenMP>
391 {
392 public:
393  template <typename WorkletType, typename InvocationType>
394  static vtkm::exec::openmp::internal::TaskTiling1D MakeTask(const WorkletType& worklet,
395  const InvocationType& invocation,
396  vtkm::Id)
397  {
398  return vtkm::exec::openmp::internal::TaskTiling1D(worklet, invocation);
399  }
400 
401  template <typename WorkletType, typename InvocationType>
402  static vtkm::exec::openmp::internal::TaskTiling3D MakeTask(const WorkletType& worklet,
403  const InvocationType& invocation,
404  vtkm::Id3)
405  {
406  return vtkm::exec::openmp::internal::TaskTiling3D(worklet, invocation);
407  }
408 };
409 }
410 } // namespace vtkm::cont
411 
412 #endif //vtk_m_cont_openmp_internal_DeviceAdapterAlgorithmOpenMP_h
vtkm::cont::ArrayPortalToIteratorBegin
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT 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::ArrayHandle::GetNumberOfValues
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:497
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanExclusive
static VTKM_CONT T ScanExclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmOpenMP.h:254
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::SortByKey
static VTKM_CONT 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::openmp::CopyIfHelper::NumChunks
vtkm::Id NumChunks
Definition: FunctorsOpenMP.h:191
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Unique
static VTKM_CONT void Unique(vtkm::cont::ArrayHandle< T, Storage > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmOpenMP.h:339
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:287
vtkm
VTKM_NO_DEPRECATED_VIRTUAL.
Definition: Algorithms.h:18
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Sort
static VTKM_CONT void Sort(vtkm::cont::ArrayHandle< T, Storage > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmOpenMP.h:303
vtkm::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagOpenMP >::MakeTask
static vtkm::exec::openmp::internal::TaskTiling3D MakeTask(const WorkletType &worklet, const InvocationType &invocation, vtkm::Id3)
Definition: DeviceAdapterAlgorithmOpenMP.h:402
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Reduce
static VTKM_CONT U Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: DeviceAdapterAlgorithmOpenMP.h:178
vtkm::TypeTraits
The TypeTraits class provides helpful compile-time information about the basic types used in VTKm (an...
Definition: TypeTraits.h:61
vtkm::cont::ArrayHandle::Allocate
VTKM_CONT 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:514
vtkm::cont::ArrayHandle::PrepareForInput
VTKM_CONT 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:629
vtkm::cont::Token::DetachFromAll
VTKM_CONT void DetachFromAll()
Detaches this Token from all resources to allow them to be used elsewhere or deleted.
vtkm::cont::DeviceAdapterAlgorithm::Reduce
static VTKM_CONT 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 >::Schedule
static VTKM_CONT void Schedule(FunctorType functor, vtkm::Id3 rangeMax)
Definition: DeviceAdapterAlgorithmOpenMP.h:372
DeviceAdapterAlgorithmGeneral.h
FunctorsOpenMP.h
vtkm::cont::ArrayHandle::PrepareForInPlace
VTKM_CONT 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:648
vtkm::cont::DeviceAdapterAlgorithm::Sort
static VTKM_CONT void Sort(vtkm::cont::ArrayHandle< T, Storage > &values)
Unstable ascending sort of input array.
DeviceAdapterAlgorithm.h
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Schedule
static VTKM_CONT void Schedule(FunctorType functor, vtkm::Id numInstances)
Definition: DeviceAdapterAlgorithmOpenMP.h:363
vtkm::cont::DeviceAdapterAlgorithm::ScanExclusive
static VTKM_CONT 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.
DeviceAdapterTagOpenMP.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanInclusive
static VTKM_CONT T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: DeviceAdapterAlgorithmOpenMP.h:220
vtkm::Add
Definition: Types.h:222
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 >::Copy
static VTKM_CONT void Copy(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: DeviceAdapterAlgorithmOpenMP.h:44
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::openmp::sort::parallel_sort
void parallel_sort(vtkm::cont::ArrayHandle< T, Container > &, BinaryCompare)
Definition: ParallelSortOpenMP.h:75
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanExclusive
static VTKM_CONT 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::openmp::ReduceByKeyHelper
void ReduceByKeyHelper(KeysInArray keysInArray, ValuesInArray valuesInArray, KeysOutArray keysOutArray, ValuesOutArray valuesOutArray, BinaryFunctor functor)
Definition: FunctorsOpenMP.h:514
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::CopyIf
static VTKM_CONT 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
Error.h
vtkm::cont::DeviceAdapterAlgorithm::ScanInclusive
static VTKM_CONT 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 >::Reduce
static VTKM_CONT U Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue, BinaryFunctor binary_functor)
Definition: DeviceAdapterAlgorithmOpenMP.h:186
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Synchronize
static VTKM_CONT void Synchronize()
Definition: DeviceAdapterAlgorithmOpenMP.h:380
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_LOG_SCOPE_FUNCTION
#define VTKM_LOG_SCOPE_FUNCTION(level)
Definition: Logging.h:258
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::U
static VTKM_CONT T U
Definition: DeviceAdapterAlgorithm.h:347
vtkm::cont::DeviceAdapterAlgorithm::Unique
static VTKM_CONT void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Reduce an array to only the unique values it contains.
VTKM_OPENMP_DIRECTIVE
#define VTKM_OPENMP_DIRECTIVE(directive)
Definition: FunctorsOpenMP.h:37
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::CopyIf
static VTKM_CONT 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::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::DeviceAdapterAlgorithm::CopySubRange
static VTKM_CONT 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::cont::DeviceTaskTypes< vtkm::cont::DeviceAdapterTagOpenMP >::MakeTask
static vtkm::exec::openmp::internal::TaskTiling1D MakeTask(const WorkletType &worklet, const InvocationType &invocation, vtkm::Id)
Definition: DeviceAdapterAlgorithmOpenMP.h:394
vtkm::cont::openmp::CopyIfHelper::Reduce
vtkm::Id Reduce(OutIterT data)
Definition: FunctorsOpenMP.h:236
ParallelSortOpenMP.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::ScanInclusive
static VTKM_CONT T ScanInclusive(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output, BinaryFunctor binaryFunctor)
Definition: DeviceAdapterAlgorithmOpenMP.h:229
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 >::ReduceByKey
static VTKM_CONT 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< vtkm::cont::DeviceAdapterTagOpenMP >::Sort
static VTKM_CONT void Sort(vtkm::cont::ArrayHandle< T, Storage > &values)
Unstable ascending sort of input array.
Definition: DeviceAdapterAlgorithmOpenMP.h:295
vtkm::cont::DeviceAdapterAlgorithm::SortByKey
static VTKM_CONT void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values)
Unstable ascending sort of keys and values.
vtkm::cont::ArrayHandle::PrepareForOutput
VTKM_CONT 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:668
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::CopySubRange
static VTKM_CONT 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::DeviceAdapterAlgorithm::CopyIf
static VTKM_CONT 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::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
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::SortByKey
static VTKM_CONT void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values, BinaryCompare binary_compare)
Definition: DeviceAdapterAlgorithmOpenMP.h:321
TaskTilingOpenMP.h
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::DevTag
DeviceAdapterTagOpenMP DevTag
Definition: DeviceAdapterAlgorithmOpenMP.h:40
vtkm::TypeTraits::ZeroInitialization
static VTKM_EXEC_CONT T ZeroInitialization()
Definition: TypeTraits.h:75
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
vtkm::cont::DeviceAdapterAlgorithm< vtkm::cont::DeviceAdapterTagOpenMP >::Unique
static VTKM_CONT void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: DeviceAdapterAlgorithmOpenMP.h:331