Go to the documentation of this file.
18 #ifndef viskores_cont_ArrayHandleDiscard_h
19 #define viskores_cont_ArrayHandleDiscard_h
25 #include <type_traits>
36 template <
typename ValueType_>
37 class ArrayPortalDiscard
40 using ValueType = ValueType_;
51 : NumberOfValues(numValues)
59 template <
class OtherV>
60 VISKORES_CONT ArrayPortalDiscard(
const ArrayPortalDiscard<OtherV>& src)
61 : NumberOfValues(src.NumberOfValues)
66 viskores::Id GetNumberOfValues()
const {
return this->NumberOfValues; }
95 struct VISKORES_ALWAYS_EXPORT StorageTagDiscard
99 struct VISKORES_ALWAYS_EXPORT DiscardMetaData
104 template <
typename ValueType>
105 class Storage<ValueType, StorageTagDiscard>
108 using WritePortalType = viskores::exec::internal::ArrayPortalDiscard<ValueType>;
112 using ReadPortalType = viskores::exec::internal::ArrayPortalDiscard<ValueType>;
114 VISKORES_CONT static std::vector<viskores::cont::internal::Buffer> CreateBuffers()
116 DiscardMetaData metaData;
117 metaData.NumberOfValues = 0;
118 return viskores::cont::internal::CreateBuffers(metaData);
123 const std::vector<viskores::cont::internal::Buffer>& buffers,
128 buffers[0].GetMetaData<DiscardMetaData>().NumberOfValues = numValues;
132 const std::vector<viskores::cont::internal::Buffer>&)
138 const std::vector<viskores::cont::internal::Buffer>& buffers)
140 return buffers[0].GetMetaData<DiscardMetaData>().NumberOfValues;
143 VISKORES_CONT static void Fill(
const std::vector<viskores::cont::internal::Buffer>&,
153 const std::vector<viskores::cont::internal::Buffer>&,
161 const std::vector<viskores::cont::internal::Buffer>& buffers,
165 return WritePortalType(GetNumberOfValues(buffers));
169 template <
typename ValueType_>
170 struct ArrayHandleDiscardTraits
172 using ValueType = ValueType_;
173 using StorageTag = StorageTagDiscard;
182 template <
typename ValueType_>
193 template <
typename T>
198 template <
typename T>
206 #endif // viskores_cont_ArrayHandleDiscard_h
ArrayHandleDiscard is a write-only array that discards all data written to it.
Definition: ArrayHandleDiscard.h:183
Treat a Vec or Vec-like object as a flat Vec.
Definition: VecFlat.h:240
Helper to determine if an ArrayHandle type is an ArrayHandleDiscard.
Definition: ArrayHandleDiscard.h:194
static T ZeroInitialization()
A static function that returns 0 (or the closest equivalent to it) for the given type.
Definition: TypeTraits.h:85
typename viskores::cont::detail::GetTypeInParentheses< void(typename internal::ArrayHandleDiscardTraits< ValueType_ >::Superclass) >::type Superclass
Definition: ArrayHandleDiscard.h:189
#define VISKORES_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:61
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
#define VISKORES_UNREACHABLE(msg)
VISKORES_UNREACHABLE is similar to VTK_ASSUME, with the significant difference that it is not conditi...
Definition: Unreachable.h:39
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
Groups connected points that have the same field value.
Definition: Atomic.h:27
#define VISKORES_ASSERT(condition)
Definition: Assert.h:51
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
This class is thrown when a Viskores function or method encounters an invalid value that inhibits pro...
Definition: ErrorBadValue.h:33
#define VISKORES_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass)
Macro to make default methods in ArrayHandle subclasses.
Definition: ArrayHandle.h:256
auto Get(const viskores::Tuple< Ts... > &tuple)
Retrieve the object from a viskores::Tuple at the given index.
Definition: Tuple.h:89
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:25
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
#define VISKORES_EXEC
Definition: ExportMacros.h:59