Go to the documentation of this file.
10 #ifndef vtk_m_cont_DeviceAdapterAlgorithm_h
11 #define vtk_m_cont_DeviceAdapterAlgorithm_h
20 #include <sys/timeb.h>
21 #include <sys/types.h>
40 template <
class DeviceAdapterTag>
42 #ifdef VTKM_DOXYGEN_ONLY
48 template <
typename IndicesStorage>
59 template <
typename T,
typename U,
class CIn,
class COut>
74 template <
typename T,
typename U,
class CIn,
class CStencil,
class COut>
90 template <
typename T,
typename U,
class CIn,
class CStencil,
class COut,
class UnaryPredicate>
94 UnaryPredicate unary_predicate);
114 template <
typename T,
typename U,
class CIn,
class COut>
133 template <
typename WordType>
135 template <
typename WordType>
142 template <
typename T,
typename S>
144 template <
typename T,
typename S>
159 template <
typename T,
class CIn,
class CVal,
class COut>
174 template <
typename T,
class CIn,
class CVal,
class COut,
class BinaryCompare>
178 BinaryCompare binary_compare);
187 template <
class CIn,
class COut>
200 template <
typename T,
typename U,
class CIn>
213 template <
typename T,
typename U,
class CIn,
class BinaryFunctor>
216 BinaryFunctor binary_functor);
226 template <
typename T,
237 BinaryFunctor binary_functor);
251 template <
typename T,
class CIn,
class COut>
268 template <
typename T,
class CIn,
class COut,
class BinaryFunctor>
271 BinaryFunctor binary_functor);
281 template <
typename T,
286 typename BinaryFunctor>
290 BinaryFunctor binary_functor);
299 template <
typename T,
typename U,
typename KIn,
typename VIn,
typename VOut>
316 template <
typename T,
class CIn,
class COut>
332 template <
typename T,
class CIn,
class COut,
class BinaryFunctor>
335 BinaryFunctor binaryFunctor,
336 const T& initialValue)
339 template <
typename T,
355 const U& initialValue,
356 BinaryFunctor binaryFunctor);
365 template <
typename T,
typename U,
class KIn,
typename VIn,
typename VOut>
394 template <
typename T,
class CIn,
class COut>
419 template <
typename T,
class CIn,
class COut,
class BinaryFunctor>
422 BinaryFunctor binaryFunctor,
423 const T& initialValue);
442 template <
class Functor>
467 template <
class Functor,
class IndiceType>
475 template <
typename T,
class Storage>
485 template <
typename T,
class Storage,
class BinaryCompare>
487 BinaryCompare binary_compare);
494 template <
typename T,
typename U,
class StorageT,
class StorageU>
505 template <
typename T,
typename U,
class StorageT,
class StorageU,
class BinaryCompare>
508 BinaryCompare binary_compare)
524 template <
typename T,
530 typename BinaryFunctor>
534 BinaryFunctor binaryFunctor);
543 template <
typename T,
class Storage>
556 template <
typename T,
class Storage,
class BinaryCompare>
558 BinaryCompare binary_compare);
569 template <
typename T,
class CIn,
class CVal,
class COut>
584 template <
typename T,
class CIn,
class CVal,
class COut,
class BinaryCompare>
588 BinaryCompare binary_compare);
597 template <
class CIn,
class COut>
601 #else // VTKM_DOXYGEN_ONLY
603 #endif //VTKM_DOXYGEN_ONLY
612 template <
class DeviceAdapterTag>
667 "Start() function should be called first then trying to call GetElapsedTime().");
689 ::ftime(¤tTime);
690 retval.
Seconds = currentTime.time;
694 gettimeofday(¤tTime,
nullptr);
695 retval.
Seconds = currentTime.tv_sec;
716 template <
class DeviceAdapterTag>
725 #ifdef VTKM_DOXYGEN_ONLY
743 template <
typename DeviceTag>
748 #endif //vtk_m_cont_DeviceAdapterAlgorithm_h
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.
TimeStamp StopTime
Definition: DeviceAdapterAlgorithm.h:704
Manages an array-worth of data.
Definition: ArrayHandle.h:300
static void Fill(vtkm::cont::BitField &bits, bool value, vtkm::Id numBits)
Fill the BitField with a specific pattern of bits.
bool Ready() const
Definition: DeviceAdapterAlgorithm.h:653
Groups connected points that have the same field value.
Definition: Atomic.h:19
static void UpperBounds(const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< T, CVal > &values, vtkm::cont::ArrayHandle< vtkm::Id, COut > &output)
Output is the last index in input for each item in values that wouldn't alter the ordering of input.
static void Schedule(Functor functor, vtkm::Id numInstances)
Schedule many instances of a function to run on concurrent threads.
static void ScanExtended(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Compute an extended prefix sum operation on the input ArrayHandle.
bool Started() const
Definition: DeviceAdapterAlgorithm.h:649
vtkm::Int64 Seconds
Definition: DeviceAdapterAlgorithm.h:618
static void Copy(const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Copy the contents of one ArrayHandle to another.
static void Transform(const vtkm::cont::ArrayHandle< T, StorageT > &input1, const vtkm::cont::ArrayHandle< U, StorageU > &input2, vtkm::cont::ArrayHandle< V, StorageV > &output, BinaryFunctor binaryFunctor)
Apply a given binary operation function element-wise to input arrays.
static void ScanInclusiveByKey(const vtkm::cont::ArrayHandle< T, KIn > &keys, const vtkm::cont::ArrayHandle< U, VIn > &values, vtkm::cont::ArrayHandle< U, VOut > &values_output, BinaryFunctor binary_functor)
Compute a segmented inclusive prefix sum operation on the input key value pairs.
static vtkm::Id CountSetBits(const vtkm::cont::BitField &bits)
Returns the total number of "1" bits in BitField.
static void Unique(vtkm::cont::ArrayHandle< T, Storage > &values)
Reduce an array to only the unique values it contains.
static T VIn
Definition: DeviceAdapterAlgorithm.h:349
static T class BinaryFunctor static void ScanExclusiveByKey(const vtkm::cont::ArrayHandle< T, KIn > &keys, const vtkm::cont::ArrayHandle< U, VIn > &values, vtkm::cont::ArrayHandle< U, VOut > &output, const U &initialValue, BinaryFunctor binaryFunctor)
Class providing a device-specific runtime support detector.
Definition: DeviceAdapterRuntimeDetectorCuda.h:25
void Stop()
Definition: DeviceAdapterAlgorithm.h:643
static T KIn
Definition: DeviceAdapterAlgorithm.h:348
vtkm::Int64 Microseconds
Definition: DeviceAdapterAlgorithm.h:619
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.
static void Sort(vtkm::cont::ArrayHandle< T, Storage > &values)
Unstable ascending sort of input array.
bool Stopped() const
Definition: DeviceAdapterAlgorithm.h:651
static T U
Definition: DeviceAdapterAlgorithm.h:347
bool StartReady
Definition: DeviceAdapterAlgorithm.h:701
bool StopReady
Definition: DeviceAdapterAlgorithm.h:702
Class providing a device-specific support for selecting the optimal Task type for a given worklet.
Definition: DeviceAdapterAlgorithm.h:744
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:204
Struct containing device adapter algorithms.
Definition: DeviceAdapterAlgorithm.h:41
bool Exists() const
Returns true if the given device adapter is supported on the current machine.
static void SortByKey(vtkm::cont::ArrayHandle< T, StorageT > &keys, vtkm::cont::ArrayHandle< U, StorageU > &values)
Unstable ascending sort of keys and values.
DeviceAdapterTimerImplementation()
When a timer is constructed, all threads are synchronized and the current time is marked so that GetE...
Definition: DeviceAdapterAlgorithm.h:624
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)
Compute a accumulated sum operation on the input key value pairs.
@ Error
Important but non-fatal errors, such as device fail-over.
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.
#define VTKM_LOG_S(level,...)
Writes a message using stream syntax to the indicated log level.
Definition: Logging.h:208
Class providing a device-specific timer.
Definition: DeviceAdapterAlgorithm.h:613
vtkm::Float64 GetElapsedTime() const
Returns the elapsed time in seconds between the construction of this class or the last call to Reset ...
Definition: DeviceAdapterAlgorithm.h:661
static void LowerBounds(const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< T, CVal > &values, vtkm::cont::ArrayHandle< vtkm::Id, COut > &output)
Output is the first index in input for each item in values that wouldn't alter the ordering of input.
Definition: BitField.h:497
Definition: DeviceAdapterAlgorithm.h:616
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.
void Reset()
Resets the timer.
Definition: DeviceAdapterAlgorithm.h:630
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
static U Reduce(const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Compute a accumulated sum operation on the input ArrayHandle.
void Start()
Definition: DeviceAdapterAlgorithm.h:636
TimeStamp GetCurrentTime() const
Definition: DeviceAdapterAlgorithm.h:682
static vtkm::Id BitFieldToUnorderedSet(const vtkm::cont::BitField &bits, vtkm::cont::ArrayHandle< Id, IndicesStorage > &indices)
Create a unique, unsorted list of indices denoting which bits are set in a bitfield.
TimeStamp StartTime
Definition: DeviceAdapterAlgorithm.h:703
static T VOut
Definition: DeviceAdapterAlgorithm.h:350