Go to the documentation of this file.
18 #ifndef viskores_cont_DeviceAdapterAlgorithm_h
19 #define viskores_cont_DeviceAdapterAlgorithm_h
28 #include <sys/timeb.h>
29 #include <sys/types.h>
48 template <
class DeviceAdapterTag>
50 #ifdef VISKORES_DOXYGEN_ONLY
56 template <
typename IndicesStorage>
67 template <
typename T,
typename U,
class CIn,
class COut>
82 template <
typename T,
typename U,
class CIn,
class CStencil,
class COut>
98 template <
typename T,
typename U,
class CIn,
class CStencil,
class COut,
class UnaryPredicate>
102 UnaryPredicate unary_predicate);
122 template <
typename T,
typename U,
class CIn,
class COut>
141 template <
typename WordType>
145 template <
typename WordType>
152 template <
typename T,
typename S>
154 template <
typename T,
typename S>
169 template <
typename T,
class CIn,
class CVal,
class COut>
184 template <
typename T,
class CIn,
class CVal,
class COut,
class BinaryCompare>
188 BinaryCompare binary_compare);
197 template <
class CIn,
class COut>
211 template <
typename T,
typename U,
class CIn>
224 template <
typename T,
typename U,
class CIn,
class BinaryFunctor>
227 BinaryFunctor binary_functor);
237 template <
typename T,
248 BinaryFunctor binary_functor);
262 template <
typename T,
class CIn,
class COut>
279 template <
typename T,
class CIn,
class COut,
class BinaryFunctor>
282 BinaryFunctor binary_functor);
292 template <
typename T,
297 typename BinaryFunctor>
301 BinaryFunctor binary_functor);
310 template <
typename T,
typename U,
typename KIn,
typename VIn,
typename VOut>
327 template <
typename T,
class CIn,
class COut>
343 template <
typename T,
class CIn,
class COut,
class BinaryFunctor>
346 BinaryFunctor binaryFunctor,
347 const T& initialValue)
350 template <
typename T,
366 const U& initialValue,
367 BinaryFunctor binaryFunctor);
376 template <
typename T,
typename U,
class KIn,
typename VIn,
typename VOut>
405 template <
typename T,
class CIn,
class COut>
430 template <
typename T,
class CIn,
class COut,
class BinaryFunctor>
433 BinaryFunctor binaryFunctor,
434 const T& initialValue);
453 template <
class Functor>
478 template <
class Functor,
class IndiceType>
486 template <
typename T,
class Storage>
496 template <
typename T,
class Storage,
class BinaryCompare>
498 BinaryCompare binary_compare);
505 template <
typename T,
typename U,
class StorageT,
class StorageU>
516 template <
typename T,
typename U,
class StorageT,
class StorageU,
class BinaryCompare>
519 BinaryCompare binary_compare)
535 template <
typename T,
541 typename BinaryFunctor>
545 BinaryFunctor binaryFunctor);
554 template <
typename T,
class Storage>
567 template <
typename T,
class Storage,
class BinaryCompare>
569 BinaryCompare binary_compare);
580 template <
typename T,
class CIn,
class CVal,
class COut>
595 template <
typename T,
class CIn,
class CVal,
class COut,
class BinaryCompare>
599 BinaryCompare binary_compare);
608 template <
class CIn,
class COut>
613 #else // VISKORES_DOXYGEN_ONLY
615 #endif //VISKORES_DOXYGEN_ONLY
624 template <
class DeviceAdapterTag>
680 "Start() function should be called first then trying to call GetElapsedTime().");
702 ::ftime(¤tTime);
703 retval.
Seconds = currentTime.time;
707 gettimeofday(¤tTime,
nullptr);
708 retval.
Seconds = currentTime.tv_sec;
729 template <
class DeviceAdapterTag>
738 #ifdef VISKORES_DOXYGEN_ONLY
756 template <
typename DeviceTag>
761 #endif //viskores_cont_DeviceAdapterAlgorithm_h
viskores::Int64 Seconds
Definition: DeviceAdapterAlgorithm.h:630
static void CopyIf(const viskores::cont::ArrayHandle< T, CIn > &input, const viskores::cont::ArrayHandle< U, CStencil > &stencil, viskores::cont::ArrayHandle< T, COut > &output)
Conditionally copy elements in the input array to the output array.
Struct containing device adapter algorithms.
Definition: DeviceAdapterAlgorithm.h:49
@ Error
Important but non-fatal errors, such as device fail-over.
static void UpperBounds(const viskores::cont::ArrayHandle< T, CIn > &input, const viskores::cont::ArrayHandle< T, CVal > &values, viskores::cont::ArrayHandle< viskores::Id, COut > &output)
Output is the last index in input for each item in values that wouldn't alter the ordering of input.
TimeStamp GetCurrentTime() const
Definition: DeviceAdapterAlgorithm.h:695
void Start()
Definition: DeviceAdapterAlgorithm.h:648
bool StartReady
Definition: DeviceAdapterAlgorithm.h:714
Manages an array-worth of data.
Definition: ArrayHandle.h:313
bool Started() const
Definition: DeviceAdapterAlgorithm.h:661
Class providing a device-specific runtime support detector.
Definition: DeviceAdapterRuntimeDetectorCuda.h:33
bool Ready() const
Definition: DeviceAdapterAlgorithm.h:665
static T VIn
Definition: DeviceAdapterAlgorithm.h:360
bool Exists() const
Returns true if the given device adapter is supported on the current machine.
static T U
Definition: DeviceAdapterAlgorithm.h:358
void Reset()
Resets the timer.
Definition: DeviceAdapterAlgorithm.h:642
static T VOut
Definition: DeviceAdapterAlgorithm.h:361
static T ScanExclusive(const viskores::cont::ArrayHandle< T, CIn > &input, viskores::cont::ArrayHandle< T, COut > &output)
Compute an exclusive prefix sum operation on the input ArrayHandle.
static U Reduce(const viskores::cont::ArrayHandle< T, CIn > &input, U initialValue)
Compute a accumulated sum operation on the input ArrayHandle.
static void Sort(viskores::cont::ArrayHandle< T, Storage > &values)
Unstable ascending sort of input array.
viskores::Int64 Microseconds
Definition: DeviceAdapterAlgorithm.h:631
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:212
static void ScanInclusiveByKey(const viskores::cont::ArrayHandle< T, KIn > &keys, const viskores::cont::ArrayHandle< U, VIn > &values, viskores::cont::ArrayHandle< U, VOut > &values_output, BinaryFunctor binary_functor)
Compute a segmented inclusive prefix sum operation on the input key value pairs.
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
static bool CopySubRange(const viskores::cont::ArrayHandle< T, CIn > &input, viskores::Id inputStartIndex, viskores::Id numberOfElementsToCopy, viskores::cont::ArrayHandle< U, COut > &output, viskores::Id outputIndex=0)
Copy the contents of a section of one ArrayHandle to another.
static void SortByKey(viskores::cont::ArrayHandle< T, StorageT > &keys, viskores::cont::ArrayHandle< U, StorageU > &values)
Unstable ascending sort of keys and values.
#define VISKORES_CONT
Definition: ExportMacros.h:65
Definition: BitField.h:507
Groups connected points that have the same field value.
Definition: Atomic.h:27
static void ScanExtended(const viskores::cont::ArrayHandle< T, CIn > &input, viskores::cont::ArrayHandle< T, COut > &output)
Compute an extended prefix sum operation on the input ArrayHandle.
static void Copy(const viskores::cont::ArrayHandle< T, CIn > &input, viskores::cont::ArrayHandle< U, COut > &output)
Copy the contents of one ArrayHandle to another.
TimeStamp StopTime
Definition: DeviceAdapterAlgorithm.h:717
static void Unique(viskores::cont::ArrayHandle< T, Storage > &values)
Reduce an array to only the unique values it contains.
Definition: DeviceAdapterAlgorithm.h:628
static T ScanInclusive(const viskores::cont::ArrayHandle< T, CIn > &input, viskores::cont::ArrayHandle< T, COut > &output)
Compute an inclusive prefix sum operation on the input ArrayHandle.
static void Transform(const viskores::cont::ArrayHandle< T, StorageT > &input1, const viskores::cont::ArrayHandle< U, StorageU > &input2, viskores::cont::ArrayHandle< V, StorageV > &output, BinaryFunctor binaryFunctor)
Apply a given binary operation function element-wise to input arrays.
Class providing a device-specific timer.
Definition: DeviceAdapterAlgorithm.h:625
static T KIn
Definition: DeviceAdapterAlgorithm.h:359
void Stop()
Definition: DeviceAdapterAlgorithm.h:655
viskores::Float64 GetElapsedTime() const
Returns the elapsed time in seconds between the construction of this class or the last call to Reset ...
Definition: DeviceAdapterAlgorithm.h:673
static void ReduceByKey(const viskores::cont::ArrayHandle< T, CKeyIn > &keys, const viskores::cont::ArrayHandle< U, CValIn > &values, viskores::cont::ArrayHandle< T, CKeyOut > &keys_output, viskores::cont::ArrayHandle< U, CValOut > &values_output, BinaryFunctor binary_functor)
Compute a accumulated sum operation on the input key value pairs.
#define VISKORES_LOG_S(level,...)
Writes a message using stream syntax to the indicated log level.
Definition: Logging.h:216
static viskores::Id BitFieldToUnorderedSet(const viskores::cont::BitField &bits, viskores::cont::ArrayHandle< Id, IndicesStorage > &indices)
Create a unique, unsorted list of indices denoting which bits are set in a bitfield.
static T class BinaryFunctor static void ScanExclusiveByKey(const viskores::cont::ArrayHandle< T, KIn > &keys, const viskores::cont::ArrayHandle< U, VIn > &values, viskores::cont::ArrayHandle< U, VOut > &output, const U &initialValue, BinaryFunctor binaryFunctor)
DeviceAdapterTimerImplementation()
When a timer is constructed, all threads are synchronized and the current time is marked so that GetE...
Definition: DeviceAdapterAlgorithm.h:636
TimeStamp StartTime
Definition: DeviceAdapterAlgorithm.h:716
bool Stopped() const
Definition: DeviceAdapterAlgorithm.h:663
Class providing a device-specific support for selecting the optimal Task type for a given worklet.
Definition: DeviceAdapterAlgorithm.h:757
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
static void Fill(viskores::cont::BitField &bits, bool value, viskores::Id numBits)
Fill the BitField with a specific pattern of bits.
static viskores::Id CountSetBits(const viskores::cont::BitField &bits)
Returns the total number of "1" bits in BitField.
static void LowerBounds(const viskores::cont::ArrayHandle< T, CIn > &input, const viskores::cont::ArrayHandle< T, CVal > &values, viskores::cont::ArrayHandle< viskores::Id, COut > &output)
Output is the first index in input for each item in values that wouldn't alter the ordering of input.
static void Schedule(Functor functor, viskores::Id numInstances)
Schedule many instances of a function to run on concurrent threads.
bool StopReady
Definition: DeviceAdapterAlgorithm.h:715