Remove exports for header-only functions/methods

Change the VTKM_CONT_EXPORT to VTKM_CONT. (Likewise for EXEC and
EXEC_CONT.) Remove the inline from these macros so that they can be
applied to everything, including implementations in a library.

Because inline is not declared in these modifies, you have to add the
keyword to functions and methods where the implementation is not inlined
in the class.
This commit is contained in:
Kenneth Moreland 2016-10-19 16:42:58 -06:00
parent 8861beda4b
commit fdaccc22db
297 changed files with 3524 additions and 3455 deletions

@ -120,6 +120,6 @@ a tab stop is, so it is better to not use them at all.
+ Use vtkm::Scalar in lieu of float or double to represent data for computation and use vtkm::Id in lieu of int or long for data structure indices. This future-proofs code against changes in precision of the architecture. The indices of vtkm::Tuple are an exception. Using int to reference vtkm::Tuple (and other related classes like vtkm::exec::CellField and vtkm::math::Matrix) indices are acceptable as it is unreasonable to make these vectors longer than the precision of int. + Use vtkm::Scalar in lieu of float or double to represent data for computation and use vtkm::Id in lieu of int or long for data structure indices. This future-proofs code against changes in precision of the architecture. The indices of vtkm::Tuple are an exception. Using int to reference vtkm::Tuple (and other related classes like vtkm::exec::CellField and vtkm::math::Matrix) indices are acceptable as it is unreasonable to make these vectors longer than the precision of int.
+ All functions and methods defined within the VTK-M toolkit should be declared with VTKM_CONT_EXPORT, VTKM_EXEC_EXPORT, or VTKM_EXEC_CONT_EXPORT. + All functions and methods defined within the VTK-M toolkit should be declared with VTKM_CONT, VTKM_EXEC, or VTKM_EXEC_CONT.
We should note that although these conventions impose a strict statute on VTK-M coding, these rules (other than those involving licensing and copyright) are not meant to be dogmatic. Examples can be found in the existing code that break these conventions, particularly when the conventions stand in the way of readability (which is the point in having them in the first place). For example, it is often the case that it is more readable for a complicated typedef to stretch a few characters past 80 even if it pushes past the end of a display. We should note that although these conventions impose a strict statute on VTK-M coding, these rules (other than those involving licensing and copyright) are not meant to be dogmatic. Examples can be found in the existing code that break these conventions, particularly when the conventions stand in the way of readability (which is the point in having them in the first place). For example, it is often the case that it is more readable for a complicated typedef to stretch a few characters past 80 even if it pushes past the end of a display.

@ -36,7 +36,7 @@ struct ExampleFieldWorklet : public vtkm::worklet::WorkletMapField
typedef void ExecutionSignature( _1, _2, _3, _4, _5, _6 ); typedef void ExecutionSignature( _1, _2, _3, _4, _5, _6 );
template<typename T, typename U, typename V> template<typename T, typename U, typename V>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()( const vtkm::Vec< T, 3 > & vec, void operator()( const vtkm::Vec< T, 3 > & vec,
const U & scalar1, const U & scalar1,
const V& scalar2, const V& scalar2,
@ -51,7 +51,7 @@ struct ExampleFieldWorklet : public vtkm::worklet::WorkletMapField
} }
template<typename T, typename U, typename V, typename W, typename X, typename Y> template<typename T, typename U, typename V, typename W, typename X, typename Y>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()( const T &, void operator()( const T &,
const U &, const U &,
const V&, const V&,

@ -141,7 +141,7 @@ struct HelloVTKMInterop
typedef void ControlSignature( FieldIn<>, FieldOut<>, FieldOut<> ); typedef void ControlSignature( FieldIn<>, FieldOut<>, FieldOut<> );
typedef void ExecutionSignature( _1, _2, _3 ); typedef void ExecutionSignature( _1, _2, _3 );
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()( const vtkm::Vec< T, 3 > & input, void operator()( const vtkm::Vec< T, 3 > & input,
vtkm::Vec<T, 3> & output, vtkm::Vec<T, 3> & output,
vtkm::Vec<vtkm::UInt8, 4>& color ) const vtkm::Vec<vtkm::UInt8, 4>& color ) const

@ -69,11 +69,11 @@ public:
const vtkm::Float32 xmin, ymin, zmin, xmax, ymax, zmax; const vtkm::Float32 xmin, ymin, zmin, xmax, ymax, zmax;
const vtkm::Id cellsPerLayer; const vtkm::Id cellsPerLayer;
VTKM_CONT_EXPORT VTKM_CONT
TangleField(const vtkm::Id3 dims, const vtkm::Float32 mins[3], const vtkm::Float32 maxs[3]) : xdim(dims[0]), ydim(dims[1]), zdim(dims[2]), TangleField(const vtkm::Id3 dims, const vtkm::Float32 mins[3], const vtkm::Float32 maxs[3]) : xdim(dims[0]), ydim(dims[1]), zdim(dims[2]),
xmin(mins[0]), ymin(mins[1]), zmin(mins[2]), xmax(maxs[0]), ymax(maxs[1]), zmax(maxs[2]), cellsPerLayer((xdim) * (ydim)) { }; xmin(mins[0]), ymin(mins[1]), zmin(mins[2]), xmax(maxs[0]), ymax(maxs[1]), zmax(maxs[2]), cellsPerLayer((xdim) * (ydim)) { };
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Id &vertexId, vtkm::Float32 &v) const void operator()(const vtkm::Id &vertexId, vtkm::Float32 &v) const
{ {
const vtkm::Id x = vertexId % (xdim); const vtkm::Id x = vertexId % (xdim);

@ -43,7 +43,7 @@ struct GenerateSurfaceWorklet : public vtkm::worklet::WorkletMapField
typedef void ExecutionSignature( _1, _2, _3 ); typedef void ExecutionSignature( _1, _2, _3 );
template<typename T> template<typename T>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()( const vtkm::Vec< T, 3 > & input, void operator()( const vtkm::Vec< T, 3 > & input,
vtkm::Vec<T, 3> & output, vtkm::Vec<T, 3> & output,
vtkm::Vec<vtkm::UInt8, 4>& color ) const vtkm::Vec<vtkm::UInt8, 4>& color ) const

@ -76,7 +76,7 @@ int mouse_state = 1;
struct GetVertexArray struct GetVertexArray
{ {
template <typename ArrayHandleType> template <typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(ArrayHandleType array) const void operator()(ArrayHandleType array) const
{ {
this->GetVertexPortal(array.GetPortalConstControl()); this->GetVertexPortal(array.GetPortalConstControl());
@ -84,7 +84,7 @@ struct GetVertexArray
private: private:
template <typename PortalType> template <typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
void GetVertexPortal(const PortalType &portal) const void GetVertexPortal(const PortalType &portal) const
{ {
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++) for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
@ -212,7 +212,7 @@ void mouseCall(int button, int state, int x, int y)
namespace { namespace {
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> Normalize(vtkm::Vec<T,3> v) vtkm::Vec<T,3> Normalize(vtkm::Vec<T,3> v)
{ {
T magnitude = static_cast<T>(sqrt(vtkm::dot(v, v))); T magnitude = static_cast<T>(sqrt(vtkm::dot(v, v)));

@ -131,7 +131,7 @@ vtkm::cont::DataSet MakeTetrahedralizeExplicitDataSet()
struct GetVertexArray struct GetVertexArray
{ {
template <typename ArrayHandleType> template <typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(ArrayHandleType array) const void operator()(ArrayHandleType array) const
{ {
this->GetVertexPortal(array.GetPortalConstControl()); this->GetVertexPortal(array.GetPortalConstControl());
@ -139,7 +139,7 @@ struct GetVertexArray
private: private:
template <typename PortalType> template <typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
void GetVertexPortal(const PortalType &portal) const void GetVertexPortal(const PortalType &portal) const
{ {
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++) for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)

@ -98,7 +98,7 @@ vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dim)
struct GetVertexArray struct GetVertexArray
{ {
template <typename ArrayHandleType> template <typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(ArrayHandleType array) const void operator()(ArrayHandleType array) const
{ {
this->GetVertexPortal(array.GetPortalConstControl()); this->GetVertexPortal(array.GetPortalConstControl());
@ -106,7 +106,7 @@ struct GetVertexArray
private: private:
template <typename PortalType> template <typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
void GetVertexPortal(const PortalType &portal) const void GetVertexPortal(const PortalType &portal) const
{ {
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++) for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)

@ -133,7 +133,7 @@ vtkm::cont::DataSet MakeTriangulateExplicitDataSet()
struct GetVertexArray struct GetVertexArray
{ {
template <typename ArrayHandleType> template <typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(ArrayHandleType array) const void operator()(ArrayHandleType array) const
{ {
this->GetVertexPortal(array.GetPortalConstControl()); this->GetVertexPortal(array.GetPortalConstControl());
@ -141,7 +141,7 @@ struct GetVertexArray
private: private:
template <typename PortalType> template <typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
void GetVertexPortal(const PortalType &portal) const void GetVertexPortal(const PortalType &portal) const
{ {
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++) for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)

@ -91,7 +91,7 @@ vtkm::cont::DataSet MakeTriangulateTestDataSet(vtkm::Id2 dim)
struct GetVertexArray struct GetVertexArray
{ {
template <typename ArrayHandleType> template <typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(ArrayHandleType array) const void operator()(ArrayHandleType array) const
{ {
this->GetVertexPortal(array.GetPortalConstControl()); this->GetVertexPortal(array.GetPortalConstControl());
@ -99,7 +99,7 @@ struct GetVertexArray
private: private:
template <typename PortalType> template <typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
void GetVertexPortal(const PortalType &portal) const void GetVertexPortal(const PortalType &portal) const
{ {
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++) for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)

@ -41,7 +41,7 @@ namespace vtkm {
struct Sum struct Sum
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x + y; return x + y;
} }
@ -53,7 +53,7 @@ struct Sum
struct Product struct Product
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x * y; return x * y;
} }
@ -71,7 +71,7 @@ struct Product
struct Maximum struct Maximum
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x < y ? y: x; return x < y ? y: x;
} }
@ -84,7 +84,7 @@ struct Maximum
struct Minimum struct Minimum
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x < y ? x: y; return x < y ? x: y;
} }
@ -96,7 +96,7 @@ struct Minimum
struct BitwiseAnd struct BitwiseAnd
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x & y; return x & y;
} }
@ -108,7 +108,7 @@ struct BitwiseAnd
struct BitwiseOr struct BitwiseOr
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x | y; return x | y;
} }
@ -120,7 +120,7 @@ struct BitwiseOr
struct BitwiseXor struct BitwiseXor
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T& x, const T& y) const VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{ {
return x ^ y; return x ^ y;
} }

@ -30,7 +30,7 @@ namespace vtkm {
struct Equal struct Equal
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x, const T& y) const VTKM_EXEC_CONT bool operator()(const T& x, const T& y) const
{ {
return x == y; return x == y;
} }
@ -42,7 +42,7 @@ struct Equal
struct NotEqual struct NotEqual
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x, const T& y) const VTKM_EXEC_CONT bool operator()(const T& x, const T& y) const
{ {
return x != y; return x != y;
} }
@ -54,7 +54,7 @@ struct NotEqual
struct SortLess struct SortLess
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x, const T& y) const VTKM_EXEC_CONT bool operator()(const T& x, const T& y) const
{ {
return x < y; return x < y;
} }
@ -67,7 +67,7 @@ struct SortLess
struct SortGreater struct SortGreater
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x, const T& y) const VTKM_EXEC_CONT bool operator()(const T& x, const T& y) const
{ {
return y < x; return y < x;
} }
@ -80,7 +80,7 @@ struct SortGreater
struct LogicalAnd struct LogicalAnd
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x, const T& y) const VTKM_EXEC_CONT bool operator()(const T& x, const T& y) const
{ {
return x && y; return x && y;
} }
@ -93,7 +93,7 @@ struct LogicalAnd
struct LogicalOr struct LogicalOr
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x, const T& y) const VTKM_EXEC_CONT bool operator()(const T& x, const T& y) const
{ {
return x || y; return x || y;
} }

@ -41,10 +41,10 @@ struct Bounds
vtkm::Range Y; vtkm::Range Y;
vtkm::Range Z; vtkm::Range Z;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Bounds() { } Bounds() { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Bounds(const vtkm::Range &xRange, Bounds(const vtkm::Range &xRange,
const vtkm::Range &yRange, const vtkm::Range &yRange,
const vtkm::Range &zRange) const vtkm::Range &zRange)
@ -56,7 +56,7 @@ struct Bounds
typename T4, typename T4,
typename T5, typename T5,
typename T6> typename T6>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Bounds(const T1 &minX, const T2 &maxX, Bounds(const T1 &minX, const T2 &maxX,
const T3 &minY, const T4 &maxY, const T3 &minY, const T4 &maxY,
const T5 &minZ, const T6 &maxZ) const T5 &minZ, const T6 &maxZ)
@ -69,7 +69,7 @@ struct Bounds
/// ymin, ymax, zmin, zmax. /// ymin, ymax, zmin, zmax.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
explicit Bounds(const T bounds[6]) explicit Bounds(const T bounds[6])
: X(vtkm::Range(bounds[0], bounds[1])), : X(vtkm::Range(bounds[0], bounds[1])),
Y(vtkm::Range(bounds[2], bounds[3])), Y(vtkm::Range(bounds[2], bounds[3])),
@ -80,14 +80,14 @@ struct Bounds
/// point. /// point.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Bounds(const vtkm::Vec<T,3> &minPoint, const vtkm::Vec<T,3> &maxPoint) Bounds(const vtkm::Vec<T,3> &minPoint, const vtkm::Vec<T,3> &maxPoint)
: X(vtkm::Range(minPoint[0], maxPoint[0])), : X(vtkm::Range(minPoint[0], maxPoint[0])),
Y(vtkm::Range(minPoint[1], maxPoint[1])), Y(vtkm::Range(minPoint[1], maxPoint[1])),
Z(vtkm::Range(minPoint[2], maxPoint[2])) Z(vtkm::Range(minPoint[2], maxPoint[2]))
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Bounds &operator=(const vtkm::Bounds &src) const vtkm::Bounds &operator=(const vtkm::Bounds &src)
{ {
this->X = src.X; this->X = src.X;
@ -102,7 +102,7 @@ struct Bounds
/// the bounds are any real region, even if a single point or it expands to /// the bounds are any real region, even if a single point or it expands to
/// infinity, true is returned. /// infinity, true is returned.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool IsNonEmpty() const bool IsNonEmpty() const
{ {
return (this->X.IsNonEmpty() && return (this->X.IsNonEmpty() &&
@ -113,7 +113,7 @@ struct Bounds
/// \b Determines if a point coordinate is within the bounds. /// \b Determines if a point coordinate is within the bounds.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool Contains(const vtkm::Vec<T,3> &point) const bool Contains(const vtkm::Vec<T,3> &point) const
{ {
return (this->X.Contains(point[0]) && return (this->X.Contains(point[0]) &&
@ -126,7 +126,7 @@ struct Bounds
/// \c Center computes the point at the middle of the bounds. If the bounds /// \c Center computes the point at the middle of the bounds. If the bounds
/// are empty, the results are undefined. /// are empty, the results are undefined.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64,3> Center() const vtkm::Vec<vtkm::Float64,3> Center() const
{ {
return vtkm::Vec<vtkm::Float64,3>(this->X.Center(), return vtkm::Vec<vtkm::Float64,3>(this->X.Center(),
@ -141,7 +141,7 @@ struct Bounds
/// nothing is done. /// nothing is done.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Include(const vtkm::Vec<T,3> &point) void Include(const vtkm::Vec<T,3> &point)
{ {
this->X.Include(point[0]); this->X.Include(point[0]);
@ -154,7 +154,7 @@ struct Bounds
/// This version of \c Include expands these bounds just enough to include /// This version of \c Include expands these bounds just enough to include
/// that of another bounds. Esentially it is the union of the two bounds. /// that of another bounds. Esentially it is the union of the two bounds.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Include(const vtkm::Bounds &bounds) void Include(const vtkm::Bounds &bounds)
{ {
this->X.Include(bounds.X); this->X.Include(bounds.X);
@ -166,7 +166,7 @@ struct Bounds
/// ///
/// This is a nondestructive form of \c Include. /// This is a nondestructive form of \c Include.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Bounds Union(const vtkm::Bounds &otherBounds) const vtkm::Bounds Union(const vtkm::Bounds &otherBounds) const
{ {
vtkm::Bounds unionBounds(*this); vtkm::Bounds unionBounds(*this);
@ -176,13 +176,13 @@ struct Bounds
/// \b Operator for union /// \b Operator for union
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Bounds operator+(const vtkm::Bounds &otherBounds) const vtkm::Bounds operator+(const vtkm::Bounds &otherBounds) const
{ {
return this->Union(otherBounds); return this->Union(otherBounds);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator==(const vtkm::Bounds &bounds) const bool operator==(const vtkm::Bounds &bounds) const
{ {
return ((this->X == bounds.X) && return ((this->X == bounds.X) &&
@ -190,7 +190,7 @@ struct Bounds
(this->Z == bounds.Z)); (this->Z == bounds.Z));
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator!=(const vtkm::Bounds &bounds) const bool operator!=(const vtkm::Bounds &bounds) const
{ {
return ((this->X != bounds.X) || return ((this->X != bounds.X) ||
@ -203,7 +203,7 @@ struct Bounds
/// Helper function for printing bounds during testing /// Helper function for printing bounds during testing
/// ///
VTKM_CONT_EXPORT static inline VTKM_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Bounds &bounds) std::ostream &operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
{ {
return stream << "{ X:" << bounds.X return stream << "{ X:" << bounds.X

@ -98,7 +98,7 @@ struct CellShapeIdToTag {
template<> \ template<> \
struct CellShapeTagCheck<vtkm::CellShapeTag ## name> : std::true_type { }; \ struct CellShapeTagCheck<vtkm::CellShapeTag ## name> : std::true_type { }; \
} \ } \
VTKM_EXEC_CONT_EXPORT \ static inline VTKM_EXEC_CONT \
const char *GetCellShapeName(vtkm::CellShapeTag ## name) { \ const char *GetCellShapeName(vtkm::CellShapeTag ## name) { \
return #name; \ return #name; \
} \ } \
@ -134,7 +134,7 @@ VTKM_DEFINE_CELL_TAG(Pyramid, CELL_SHAPE_PYRAMID);
/// \c vtkmGenericCellShapeMacro to specialize on the cell type. /// \c vtkmGenericCellShapeMacro to specialize on the cell type.
/// ///
struct CellShapeTagGeneric { struct CellShapeTagGeneric {
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
CellShapeTagGeneric(vtkm::IdComponent shape) : Id(shape) { } CellShapeTagGeneric(vtkm::IdComponent shape) : Id(shape) { }
vtkm::IdComponent Id; vtkm::IdComponent Id;
@ -163,7 +163,7 @@ struct CellShapeTagGeneric {
/// ///
/// \code{.cpp} /// \code{.cpp}
/// template<typename WorkletType> /// template<typename WorkletType>
/// VTKM_EXEC_EXPORT /// VTKM_EXEC
/// void MyCellOperation(vtkm::CellShapeTagGeneric cellShape, /// void MyCellOperation(vtkm::CellShapeTagGeneric cellShape,
/// const vtkm::exec::FunctorBase &worklet) /// const vtkm::exec::FunctorBase &worklet)
/// { /// {

@ -29,37 +29,37 @@ namespace vtkm {
class Plane class Plane
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
Plane() Plane()
: Origin(FloatDefault(0)), : Origin(FloatDefault(0)),
Normal(FloatDefault(0), FloatDefault(0), FloatDefault(1)) Normal(FloatDefault(0), FloatDefault(0), FloatDefault(1))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
explicit Plane(const vtkm::Vec<FloatDefault, 3> &normal) explicit Plane(const vtkm::Vec<FloatDefault, 3> &normal)
: Origin(FloatDefault(0)), : Origin(FloatDefault(0)),
Normal(normal) Normal(normal)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
Plane(const vtkm::Vec<FloatDefault, 3> &origin, Plane(const vtkm::Vec<FloatDefault, 3> &origin,
const vtkm::Vec<FloatDefault, 3> &normal) const vtkm::Vec<FloatDefault, 3> &normal)
: Origin(origin), Normal(normal) : Origin(origin), Normal(normal)
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Vec<FloatDefault, 3>& GetOrigin() const const vtkm::Vec<FloatDefault, 3>& GetOrigin() const
{ {
return this->Origin; return this->Origin;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Vec<FloatDefault, 3>& GetNormal() const const vtkm::Vec<FloatDefault, 3>& GetNormal() const
{ {
return this->Normal; return this->Normal;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault Value(FloatDefault x, FloatDefault y, FloatDefault z) const FloatDefault Value(FloatDefault x, FloatDefault y, FloatDefault z) const
{ {
return ((x - this->Origin[0]) * this->Normal[0]) + return ((x - this->Origin[0]) * this->Normal[0]) +
@ -67,19 +67,19 @@ public:
((z - this->Origin[2]) * this->Normal[2]); ((z - this->Origin[2]) * this->Normal[2]);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault Value(const vtkm::Vec<FloatDefault, 3> &x) const FloatDefault Value(const vtkm::Vec<FloatDefault, 3> &x) const
{ {
return this->Value(x[0], x[1], x[2]); return this->Value(x[0], x[1], x[2]);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<FloatDefault, 3> Gradient(FloatDefault, FloatDefault, FloatDefault) const vtkm::Vec<FloatDefault, 3> Gradient(FloatDefault, FloatDefault, FloatDefault) const
{ {
return this->Normal; return this->Normal;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<FloatDefault, 3> Gradient(const vtkm::Vec<FloatDefault, 3>&) const vtkm::Vec<FloatDefault, 3> Gradient(const vtkm::Vec<FloatDefault, 3>&) const
{ {
return this->Normal; return this->Normal;
@ -95,32 +95,32 @@ private:
class Sphere class Sphere
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
Sphere() : Radius(FloatDefault(0.2)), Center(FloatDefault(0)) Sphere() : Radius(FloatDefault(0.2)), Center(FloatDefault(0))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
explicit Sphere(FloatDefault radius) : Radius(radius), Center(FloatDefault(0)) explicit Sphere(FloatDefault radius) : Radius(radius), Center(FloatDefault(0))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
Sphere(vtkm::Vec<FloatDefault, 3> center, FloatDefault radius) Sphere(vtkm::Vec<FloatDefault, 3> center, FloatDefault radius)
: Radius(radius), Center(center) : Radius(radius), Center(center)
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault GetRadius() const FloatDefault GetRadius() const
{ {
return this->Radius; return this->Radius;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Vec<FloatDefault, 3>& GetCenter() const const vtkm::Vec<FloatDefault, 3>& GetCenter() const
{ {
return this->Center; return this->Center;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault Value(FloatDefault x, FloatDefault y, FloatDefault z) const FloatDefault Value(FloatDefault x, FloatDefault y, FloatDefault z) const
{ {
return ((x - this->Center[0]) * (x - this->Center[0]) + return ((x - this->Center[0]) * (x - this->Center[0]) +
@ -129,20 +129,20 @@ public:
(this->Radius * this->Radius); (this->Radius * this->Radius);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault Value(const vtkm::Vec<FloatDefault, 3> &x) const FloatDefault Value(const vtkm::Vec<FloatDefault, 3> &x) const
{ {
return this->Value(x[0], x[1], x[2]); return this->Value(x[0], x[1], x[2]);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<FloatDefault, 3> Gradient(FloatDefault x, FloatDefault y, FloatDefault z) vtkm::Vec<FloatDefault, 3> Gradient(FloatDefault x, FloatDefault y, FloatDefault z)
const const
{ {
return this->Gradient(vtkm::Vec<FloatDefault, 3>(x, y, z)); return this->Gradient(vtkm::Vec<FloatDefault, 3>(x, y, z));
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<FloatDefault, 3> Gradient(const vtkm::Vec<FloatDefault, 3> &x) const vtkm::Vec<FloatDefault, 3> Gradient(const vtkm::Vec<FloatDefault, 3> &x) const
{ {
return FloatDefault(2) * (x - this->Center); return FloatDefault(2) * (x - this->Center);
@ -158,23 +158,23 @@ template <typename ImplicitFunction>
class ImplicitFunctionValue class ImplicitFunctionValue
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ImplicitFunctionValue() ImplicitFunctionValue()
: Function() : Function()
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
explicit ImplicitFunctionValue(const ImplicitFunction &func) explicit ImplicitFunctionValue(const ImplicitFunction &func)
: Function(func) : Function(func)
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault operator()(const vtkm::Vec<FloatDefault, 3> x) const FloatDefault operator()(const vtkm::Vec<FloatDefault, 3> x) const
{ {
return this->Function.Value(x); return this->Function.Value(x);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault operator()(FloatDefault x, FloatDefault y, FloatDefault z) const FloatDefault operator()(FloatDefault x, FloatDefault y, FloatDefault z) const
{ {
return this->Function.Value(x, y, z); return this->Function.Value(x, y, z);
@ -190,23 +190,23 @@ template <typename ImplicitFunction>
class ImplicitFunctionGradient class ImplicitFunctionGradient
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ImplicitFunctionGradient() ImplicitFunctionGradient()
: Function() : Function()
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
explicit ImplicitFunctionGradient(const ImplicitFunction &func) explicit ImplicitFunctionGradient(const ImplicitFunction &func)
: Function(func) : Function(func)
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault operator()(const vtkm::Vec<FloatDefault, 3> x) const FloatDefault operator()(const vtkm::Vec<FloatDefault, 3> x) const
{ {
return this->Function.Gradient(x); return this->Function.Gradient(x);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
FloatDefault operator()(FloatDefault x, FloatDefault y, FloatDefault z) const FloatDefault operator()(FloatDefault x, FloatDefault y, FloatDefault z) const
{ {
return this->Function.Gradient(x, y, z); return this->Function.Gradient(x, y, z);

@ -68,7 +68,7 @@ struct ListTagJoin : detail::ListRoot {
/// default instance of that type. /// default instance of that type.
/// ///
template<typename Functor, typename ListTag> template<typename Functor, typename ListTag>
VTKM_CONT_EXPORT VTKM_CONT
void ListForEach(Functor &f, ListTag) void ListForEach(Functor &f, ListTag)
{ {
VTKM_IS_LIST_TAG(ListTag); VTKM_IS_LIST_TAG(ListTag);
@ -79,7 +79,7 @@ void ListForEach(Functor &f, ListTag)
/// default instance of that type. /// default instance of that type.
/// ///
template<typename Functor, typename ListTag> template<typename Functor, typename ListTag>
VTKM_CONT_EXPORT VTKM_CONT
void ListForEach(const Functor &f, ListTag) void ListForEach(const Functor &f, ListTag)
{ {
VTKM_IS_LIST_TAG(ListTag); VTKM_IS_LIST_TAG(ListTag);

File diff suppressed because it is too large Load Diff

@ -62,7 +62,7 @@ $# Ignore the following comment. It is meant for the generated file.
$py( $py(
def unary_function(name, type, returntype, cuda_expression, std_expression): def unary_function(name, type, returntype, cuda_expression, std_expression):
return '''VTKM_EXEC_CONT_EXPORT return '''static inline VTKM_EXEC_CONT
{2} {0}({1} x) {{ {2} {0}({1} x) {{
#ifdef VTKM_CUDA #ifdef VTKM_CUDA
return {3}; return {3};
@ -74,7 +74,7 @@ def unary_function(name, type, returntype, cuda_expression, std_expression):
def unary_Vec_function(vtkmname): def unary_Vec_function(vtkmname):
return '''template<typename T, vtkm::IdComponent N> return '''template<typename T, vtkm::IdComponent N>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Vec<T,N> {0}(const vtkm::Vec<T,N> &x) {{ vtkm::Vec<T,N> {0}(const vtkm::Vec<T,N> &x) {{
vtkm::Vec<T,N> result; vtkm::Vec<T,N> result;
for (vtkm::IdComponent index = 0; index < N; index++) for (vtkm::IdComponent index = 0; index < N; index++)
@ -84,7 +84,7 @@ vtkm::Vec<T,N> {0}(const vtkm::Vec<T,N> &x) {{
return result; return result;
}} }}
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Vec<T,4> {0}(const vtkm::Vec<T,4> &x) {{ vtkm::Vec<T,4> {0}(const vtkm::Vec<T,4> &x) {{
return vtkm::Vec<T,4>(vtkm::{0}(x[0]), return vtkm::Vec<T,4>(vtkm::{0}(x[0]),
vtkm::{0}(x[1]), vtkm::{0}(x[1]),
@ -92,14 +92,14 @@ vtkm::Vec<T,4> {0}(const vtkm::Vec<T,4> &x) {{
vtkm::{0}(x[3])); vtkm::{0}(x[3]));
}} }}
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Vec<T,3> {0}(const vtkm::Vec<T,3> &x) {{ vtkm::Vec<T,3> {0}(const vtkm::Vec<T,3> &x) {{
return vtkm::Vec<T,3>(vtkm::{0}(x[0]), return vtkm::Vec<T,3>(vtkm::{0}(x[0]),
vtkm::{0}(x[1]), vtkm::{0}(x[1]),
vtkm::{0}(x[2])); vtkm::{0}(x[2]));
}} }}
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Vec<T,2> {0}(const vtkm::Vec<T,2> &x) {{ vtkm::Vec<T,2> {0}(const vtkm::Vec<T,2> &x) {{
return vtkm::Vec<T,2>(vtkm::{0}(x[0]), return vtkm::Vec<T,2>(vtkm::{0}(x[0]),
vtkm::{0}(x[1])); vtkm::{0}(x[1]));
@ -126,7 +126,7 @@ def unary_template_function_no_vec(vtkmname,
expression, expression,
returntype = None, returntype = None,
preexpression = ''): preexpression = ''):
return '''VTKM_EXEC_CONT_EXPORT return '''static inline VTKM_EXEC_CONT
{2} {0}(vtkm::Float32 x) {{ {2} {0}(vtkm::Float32 x) {{
{3} return {1}; {3} return {1};
}} }}
@ -134,7 +134,7 @@ def unary_template_function_no_vec(vtkmname,
expression, expression,
'vtkm::Float32' if returntype == None else returntype, 'vtkm::Float32' if returntype == None else returntype,
preexpression) + \ preexpression) + \
'''VTKM_EXEC_CONT_EXPORT '''static inline VTKM_EXEC_CONT
{2} {0}(vtkm::Float64 x) {{ {2} {0}(vtkm::Float64 x) {{
{3} return {1}; {3} return {1};
}} }}
@ -144,7 +144,7 @@ def unary_template_function_no_vec(vtkmname,
preexpression) preexpression)
def binary_function(name, type, cuda_expression, std_expression): def binary_function(name, type, cuda_expression, std_expression):
return '''VTKM_EXEC_CONT_EXPORT return '''static inline VTKM_EXEC_CONT
{1} {0}({1} x, {1} y) {{ {1} {0}({1} x, {1} y) {{
#ifdef VTKM_CUDA #ifdef VTKM_CUDA
return {2}; return {2};
@ -165,11 +165,11 @@ def binary_math_function(vtkmname, sysname):
'std::' + sysname + '(x,y)') 'std::' + sysname + '(x,y)')
def binary_template_function(vtkmname, expression): def binary_template_function(vtkmname, expression):
return '''VTKM_EXEC_CONT_EXPORT return '''static inline VTKM_EXEC_CONT
vtkm::Float32 {0}(vtkm::Float32 x, vtkm::Float32 y) {{ vtkm::Float32 {0}(vtkm::Float32 x, vtkm::Float32 y) {{
return {1}; return {1};
}} }}
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 {0}(vtkm::Float64 x, vtkm::Float64 y) {{ vtkm::Float64 {0}(vtkm::Float64 x, vtkm::Float64 y) {{
return {1}; return {1};
}} }}
@ -187,7 +187,7 @@ namespace vtkm {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/// Returns the constant 2 times Pi. /// Returns the constant 2 times Pi.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 TwoPi() vtkm::Float64 TwoPi()
{ {
return 6.28318530717958647692528676655900576; return 6.28318530717958647692528676655900576;
@ -195,7 +195,7 @@ vtkm::Float64 TwoPi()
/// Returns the constant Pi. /// Returns the constant Pi.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 Pi() vtkm::Float64 Pi()
{ {
return 3.14159265358979323846264338327950288; return 3.14159265358979323846264338327950288;
@ -203,14 +203,14 @@ vtkm::Float64 Pi()
/// Returns the constant Pi halves. /// Returns the constant Pi halves.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 Pi_2() vtkm::Float64 Pi_2()
{ {
return 1.57079632679489661923132169163975144; return 1.57079632679489661923132169163975144;
} }
/// Returns the constant Pi thirds. /// Returns the constant Pi thirds.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 Pi_3() vtkm::Float64 Pi_3()
{ {
return 1.04719755119659774615421446109316762; return 1.04719755119659774615421446109316762;
@ -218,7 +218,7 @@ vtkm::Float64 Pi_3()
/// Returns the constant Pi fourths. /// Returns the constant Pi fourths.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 Pi_4() vtkm::Float64 Pi_4()
{ {
return 0.78539816339744830961566084581987572; return 0.78539816339744830961566084581987572;
@ -298,20 +298,20 @@ $unary_math_function('Sqrt', 'sqrt')\
/// should use this function whenever dividing by the square root. /// should use this function whenever dividing by the square root.
/// ///
#ifdef VTKM_CUDA #ifdef VTKM_CUDA
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 RSqrt(vtkm::Float32 x) { vtkm::Float32 RSqrt(vtkm::Float32 x) {
return rsqrtf(x); return rsqrtf(x);
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 RSqrt(vtkm::Float64 x) { vtkm::Float64 RSqrt(vtkm::Float64 x) {
return rsqrt(x); return rsqrt(x);
} }
#else // !VTKM_CUDA #else // !VTKM_CUDA
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 RSqrt(vtkm::Float32 x) { vtkm::Float32 RSqrt(vtkm::Float32 x) {
return 1/vtkm::Sqrt(x); return 1/vtkm::Sqrt(x);
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 RSqrt(vtkm::Float64 x) { vtkm::Float64 RSqrt(vtkm::Float64 x) {
return 1/vtkm::Sqrt(x); return 1/vtkm::Sqrt(x);
} }
@ -331,20 +331,20 @@ $unary_Vec_function('Cbrt')\
/// should use this function whenever dividing by the cube root. /// should use this function whenever dividing by the cube root.
/// ///
#ifdef VTKM_CUDA #ifdef VTKM_CUDA
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 RCbrt(vtkm::Float32 x) { vtkm::Float32 RCbrt(vtkm::Float32 x) {
return rcbrtf(x); return rcbrtf(x);
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 RCbrt(vtkm::Float64 x) { vtkm::Float64 RCbrt(vtkm::Float64 x) {
return rcbrt(x); return rcbrt(x);
} }
#else // !VTKM_CUDA #else // !VTKM_CUDA
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 RCbrt(vtkm::Float32 x) { vtkm::Float32 RCbrt(vtkm::Float32 x) {
return 1/vtkm::Cbrt(x); return 1/vtkm::Cbrt(x);
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 RCbrt(vtkm::Float64 x) { vtkm::Float64 RCbrt(vtkm::Float64 x) {
return 1/vtkm::Cbrt(x); return 1/vtkm::Cbrt(x);
} }
@ -372,20 +372,20 @@ $unary_Vec_function('ExpM1')\
/// Computes 10**\p x, the base-10 exponential of \p x. /// Computes 10**\p x, the base-10 exponential of \p x.
/// ///
#ifdef VTKM_CUDA #ifdef VTKM_CUDA
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 Exp10(vtkm::Float32 x) { vtkm::Float32 Exp10(vtkm::Float32 x) {
return exp10f(x); return exp10f(x);
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 Exp10(vtkm::Float64 x) { vtkm::Float64 Exp10(vtkm::Float64 x) {
return exp10(x); return exp10(x);
} }
#else // !VTKM_CUDA #else // !VTKM_CUDA
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 Exp10(vtkm::Float32 x) { vtkm::Float32 Exp10(vtkm::Float32 x) {
return vtkm::Pow(10, x);; return vtkm::Pow(10, x);;
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 Exp10(vtkm::Float64 x) { vtkm::Float64 Exp10(vtkm::Float64 x) {
return vtkm::Pow(10, x);; return vtkm::Pow(10, x);;
} }
@ -417,7 +417,7 @@ $unary_Vec_function('Log1P')\
/// Returns \p x or \p y, whichever is larger. /// Returns \p x or \p y, whichever is larger.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Max(const T &x, const T &y); T Max(const T &x, const T &y);
#ifdef VTKM_USE_STL #ifdef VTKM_USE_STL
$binary_template_function('Max', '(std::max)(x, y)')\ $binary_template_function('Max', '(std::max)(x, y)')\
@ -430,7 +430,7 @@ $#
/// Returns \p x or \p y, whichever is smaller. /// Returns \p x or \p y, whichever is smaller.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Min(const T &x, const T &y); T Min(const T &x, const T &y);
#ifdef VTKM_USE_STL #ifdef VTKM_USE_STL
$binary_template_function('Min', '(std::min)(x, y)')\ $binary_template_function('Min', '(std::min)(x, y)')\
@ -443,14 +443,14 @@ $#
namespace detail { namespace detail {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Max(T x, T y, vtkm::TypeTraitsScalarTag) T Max(T x, T y, vtkm::TypeTraitsScalarTag)
{ {
return (x < y) ? y : x; return (x < y) ? y : x;
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Max(const T &x, const T &y, vtkm::TypeTraitsVectorTag) T Max(const T &x, const T &y, vtkm::TypeTraitsVectorTag)
{ {
typedef vtkm::VecTraits<T> Traits; typedef vtkm::VecTraits<T> Traits;
@ -466,14 +466,14 @@ T Max(const T &x, const T &y, vtkm::TypeTraitsVectorTag)
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Min(T x, T y, vtkm::TypeTraitsScalarTag) T Min(T x, T y, vtkm::TypeTraitsScalarTag)
{ {
return (x < y) ? x : y; return (x < y) ? x : y;
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Min(const T &x, const T &y, vtkm::TypeTraitsVectorTag) T Min(const T &x, const T &y, vtkm::TypeTraitsVectorTag)
{ {
typedef vtkm::VecTraits<T> Traits; typedef vtkm::VecTraits<T> Traits;
@ -493,7 +493,7 @@ T Min(const T &x, const T &y, vtkm::TypeTraitsVectorTag)
/// Returns \p x or \p y, whichever is larger. /// Returns \p x or \p y, whichever is larger.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Max(const T &x, const T &y) { T Max(const T &x, const T &y) {
return detail::Max(x, y, typename vtkm::TypeTraits<T>::DimensionalityTag()); return detail::Max(x, y, typename vtkm::TypeTraits<T>::DimensionalityTag());
} }
@ -501,7 +501,7 @@ T Max(const T &x, const T &y) {
/// Returns \p x or \p y, whichever is smaller. /// Returns \p x or \p y, whichever is smaller.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Min(const T &x, const T &y) { T Min(const T &x, const T &y) {
return detail::Min(x, y, typename vtkm::TypeTraits<T>::DimensionalityTag()); return detail::Min(x, y, typename vtkm::TypeTraits<T>::DimensionalityTag());
} }
@ -542,25 +542,25 @@ struct FloatLimits<vtkm::Float32>
{ {
typedef vtkm::detail::IEEE754Bits32 BitsType; typedef vtkm::detail::IEEE754Bits32 BitsType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float32 Nan() { static vtkm::Float32 Nan() {
BitsType nan = {VTKM_NAN_BITS_32}; BitsType nan = {VTKM_NAN_BITS_32};
return nan.scalar; return nan.scalar;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float32 Infinity() { static vtkm::Float32 Infinity() {
BitsType inf = {VTKM_INF_BITS_32}; BitsType inf = {VTKM_INF_BITS_32};
return inf.scalar; return inf.scalar;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float32 NegativeInfinity() { static vtkm::Float32 NegativeInfinity() {
BitsType neginf = {VTKM_NEG_INF_BITS_32}; BitsType neginf = {VTKM_NEG_INF_BITS_32};
return neginf.scalar; return neginf.scalar;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float32 Epsilon() { static vtkm::Float32 Epsilon() {
return VTKM_EPSILON_32; return VTKM_EPSILON_32;
} }
@ -571,25 +571,25 @@ struct FloatLimits< vtkm::Vec<vtkm::Float32,N> >
{ {
typedef vtkm::detail::IEEE754Bits32 BitsType; typedef vtkm::detail::IEEE754Bits32 BitsType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float32,N> Nan() { static vtkm::Vec<vtkm::Float32,N> Nan() {
BitsType nan = {VTKM_NAN_BITS_32}; BitsType nan = {VTKM_NAN_BITS_32};
return vtkm::Vec<vtkm::Float32,N>(nan.scalar); return vtkm::Vec<vtkm::Float32,N>(nan.scalar);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float32,N> Infinity() { static vtkm::Vec<vtkm::Float32,N> Infinity() {
BitsType inf = {VTKM_INF_BITS_32}; BitsType inf = {VTKM_INF_BITS_32};
return vtkm::Vec<vtkm::Float32,N>(inf.scalar); return vtkm::Vec<vtkm::Float32,N>(inf.scalar);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float32,N> NegativeInfinity() { static vtkm::Vec<vtkm::Float32,N> NegativeInfinity() {
BitsType neginf = {VTKM_NEG_INF_BITS_32}; BitsType neginf = {VTKM_NEG_INF_BITS_32};
return vtkm::Vec<vtkm::Float32,N>(neginf.scalar); return vtkm::Vec<vtkm::Float32,N>(neginf.scalar);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float32,N> Epsilon() { static vtkm::Vec<vtkm::Float32,N> Epsilon() {
return vtkm::Vec<vtkm::Float32,N>(VTKM_EPSILON_32); return vtkm::Vec<vtkm::Float32,N>(VTKM_EPSILON_32);
} }
@ -600,25 +600,25 @@ struct FloatLimits<vtkm::Float64>
{ {
typedef vtkm::detail::IEEE754Bits64 BitsType; typedef vtkm::detail::IEEE754Bits64 BitsType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float64 Nan() { static vtkm::Float64 Nan() {
BitsType nan = {VTKM_NAN_BITS_64}; BitsType nan = {VTKM_NAN_BITS_64};
return nan.scalar; return nan.scalar;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float64 Infinity() { static vtkm::Float64 Infinity() {
BitsType inf = {VTKM_INF_BITS_64}; BitsType inf = {VTKM_INF_BITS_64};
return inf.scalar; return inf.scalar;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float64 NegativeInfinity() { static vtkm::Float64 NegativeInfinity() {
BitsType neginf = {VTKM_NEG_INF_BITS_64}; BitsType neginf = {VTKM_NEG_INF_BITS_64};
return neginf.scalar; return neginf.scalar;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Float64 Epsilon() { static vtkm::Float64 Epsilon() {
return VTKM_EPSILON_64; return VTKM_EPSILON_64;
} }
@ -629,25 +629,25 @@ struct FloatLimits< vtkm::Vec<vtkm::Float64,N> >
{ {
typedef vtkm::detail::IEEE754Bits64 BitsType; typedef vtkm::detail::IEEE754Bits64 BitsType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float64,N> Nan() { static vtkm::Vec<vtkm::Float64,N> Nan() {
BitsType nan = {VTKM_NAN_BITS_64}; BitsType nan = {VTKM_NAN_BITS_64};
return vtkm::Vec<vtkm::Float64,N>(nan.scalar); return vtkm::Vec<vtkm::Float64,N>(nan.scalar);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float64,N> Infinity() { static vtkm::Vec<vtkm::Float64,N> Infinity() {
BitsType inf = {VTKM_INF_BITS_64}; BitsType inf = {VTKM_INF_BITS_64};
return vtkm::Vec<vtkm::Float64,N>(inf.scalar); return vtkm::Vec<vtkm::Float64,N>(inf.scalar);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float64,N> NegativeInfinity() { static vtkm::Vec<vtkm::Float64,N> NegativeInfinity() {
BitsType neginf = {VTKM_NEG_INF_BITS_64}; BitsType neginf = {VTKM_NEG_INF_BITS_64};
return vtkm::Vec<vtkm::Float64,N>(neginf.scalar); return vtkm::Vec<vtkm::Float64,N>(neginf.scalar);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<vtkm::Float64,N> Epsilon() { static vtkm::Vec<vtkm::Float64,N> Epsilon() {
return vtkm::Vec<vtkm::Float64,N>(VTKM_EPSILON_64); return vtkm::Vec<vtkm::Float64,N>(VTKM_EPSILON_64);
} }
@ -667,7 +667,7 @@ struct FloatLimits< vtkm::Vec<vtkm::Float64,N> >
/// Returns the representation for not-a-number (NaN). /// Returns the representation for not-a-number (NaN).
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Nan() T Nan()
{ {
return detail::FloatLimits<T>::Nan(); return detail::FloatLimits<T>::Nan();
@ -676,7 +676,7 @@ T Nan()
/// Returns the representation for infinity. /// Returns the representation for infinity.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Infinity() T Infinity()
{ {
return detail::FloatLimits<T>::Infinity(); return detail::FloatLimits<T>::Infinity();
@ -685,7 +685,7 @@ T Infinity()
/// Returns the representation for negative infinity. /// Returns the representation for negative infinity.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T NegativeInfinity() T NegativeInfinity()
{ {
return detail::FloatLimits<T>::NegativeInfinity(); return detail::FloatLimits<T>::NegativeInfinity();
@ -695,7 +695,7 @@ T NegativeInfinity()
/// that is representable. /// that is representable.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Epsilon() T Epsilon()
{ {
return detail::FloatLimits<T>::Epsilon(); return detail::FloatLimits<T>::Epsilon();
@ -706,7 +706,7 @@ T Epsilon()
/// Returns the representation for not-a-number (NaN). /// Returns the representation for not-a-number (NaN).
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Nan() T Nan()
{ {
return std::numeric_limits<T>::quiet_NaN(); return std::numeric_limits<T>::quiet_NaN();
@ -715,7 +715,7 @@ T Nan()
/// Returns the representation for infinity. /// Returns the representation for infinity.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Infinity() T Infinity()
{ {
return std::numeric_limits<T>::infinity(); return std::numeric_limits<T>::infinity();
@ -724,7 +724,7 @@ T Infinity()
/// Returns the representation for negative infinity. /// Returns the representation for negative infinity.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T NegativeInfinity() T NegativeInfinity()
{ {
return -std::numeric_limits<T>::infinity(); return -std::numeric_limits<T>::infinity();
@ -734,7 +734,7 @@ T NegativeInfinity()
/// that is representable. /// that is representable.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Epsilon() T Epsilon()
{ {
return std::numeric_limits<T>::epsilon(); return std::numeric_limits<T>::epsilon();
@ -743,39 +743,39 @@ T Epsilon()
/// Returns the representation for not-a-number (NaN). /// Returns the representation for not-a-number (NaN).
/// ///
VTKM_EXEC_CONT_EXPORT vtkm::Float32 Nan32() { static inline VTKM_EXEC_CONT vtkm::Float32 Nan32() {
return vtkm::Nan<vtkm::Float32>(); return vtkm::Nan<vtkm::Float32>();
} }
VTKM_EXEC_CONT_EXPORT vtkm::Float64 Nan64() { static inline VTKM_EXEC_CONT vtkm::Float64 Nan64() {
return vtkm::Nan<vtkm::Float64>(); return vtkm::Nan<vtkm::Float64>();
} }
/// Returns the representation for infinity. /// Returns the representation for infinity.
/// ///
VTKM_EXEC_CONT_EXPORT vtkm::Float32 Infinity32() { static inline VTKM_EXEC_CONT vtkm::Float32 Infinity32() {
return vtkm::Infinity<vtkm::Float32>(); return vtkm::Infinity<vtkm::Float32>();
} }
VTKM_EXEC_CONT_EXPORT vtkm::Float64 Infinity64() { static inline VTKM_EXEC_CONT vtkm::Float64 Infinity64() {
return vtkm::Infinity<vtkm::Float64>(); return vtkm::Infinity<vtkm::Float64>();
} }
/// Returns the representation for negative infinity. /// Returns the representation for negative infinity.
/// ///
VTKM_EXEC_CONT_EXPORT vtkm::Float32 NegativeInfinity32() { static inline VTKM_EXEC_CONT vtkm::Float32 NegativeInfinity32() {
return vtkm::NegativeInfinity<vtkm::Float32>(); return vtkm::NegativeInfinity<vtkm::Float32>();
} }
VTKM_EXEC_CONT_EXPORT vtkm::Float64 NegativeInfinity64() { static inline VTKM_EXEC_CONT vtkm::Float64 NegativeInfinity64() {
return vtkm::NegativeInfinity<vtkm::Float64>(); return vtkm::NegativeInfinity<vtkm::Float64>();
} }
/// Returns the difference between 1 and the least value greater than 1 /// Returns the difference between 1 and the least value greater than 1
/// that is representable. /// that is representable.
/// ///
VTKM_EXEC_CONT_EXPORT vtkm::Float32 Epsilon32() static inline VTKM_EXEC_CONT vtkm::Float32 Epsilon32()
{ {
return vtkm::Epsilon<vtkm::Float32>(); return vtkm::Epsilon<vtkm::Float32>();
} }
VTKM_EXEC_CONT_EXPORT vtkm::Float64 Epsilon64() static inline VTKM_EXEC_CONT vtkm::Float64 Epsilon64()
{ {
return vtkm::Epsilon<vtkm::Float64>(); return vtkm::Epsilon<vtkm::Float64>();
} }
@ -784,7 +784,7 @@ VTKM_EXEC_CONT_EXPORT vtkm::Float64 Epsilon64()
/// Returns true if \p x is not a number. /// Returns true if \p x is not a number.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
bool IsNan(T x) bool IsNan(T x)
{ {
using std::isnan; using std::isnan;
@ -794,7 +794,7 @@ bool IsNan(T x)
/// Returns true if \p x is positive or negative infinity. /// Returns true if \p x is positive or negative infinity.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
bool IsInf(T x) bool IsInf(T x)
{ {
using std::isinf; using std::isinf;
@ -804,7 +804,7 @@ bool IsInf(T x)
/// Returns true if \p x is a normal number (not NaN or infinite). /// Returns true if \p x is a normal number (not NaN or infinite).
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
bool IsFinite(T x) bool IsFinite(T x)
{ {
using std::isfinite; using std::isfinite;
@ -842,7 +842,7 @@ $binary_math_function('FMod', 'fmod')\
/// ///
#ifdef VTKM_MSVC #ifdef VTKM_MSVC
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
T Remainder(T numerator, T denominator) T Remainder(T numerator, T denominator)
{ {
T quotient = vtkm::Round(numerator/denominator); T quotient = vtkm::Round(numerator/denominator);
@ -858,7 +858,7 @@ $#
/// get that remainder. /// get that remainder.
/// ///
template<typename QType> template<typename QType>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 RemainderQuotient(vtkm::Float32 numerator, vtkm::Float32 RemainderQuotient(vtkm::Float32 numerator,
vtkm::Float32 denominator, vtkm::Float32 denominator,
QType &quotient) QType &quotient)
@ -869,7 +869,7 @@ vtkm::Float32 RemainderQuotient(vtkm::Float32 numerator,
return result; return result;
} }
template<typename QType> template<typename QType>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 RemainderQuotient(vtkm::Float64 numerator, vtkm::Float64 RemainderQuotient(vtkm::Float64 numerator,
vtkm::Float64 denominator, vtkm::Float64 denominator,
QType &quotient) QType &quotient)
@ -883,12 +883,12 @@ vtkm::Float64 RemainderQuotient(vtkm::Float64 numerator,
/// Gets the integral and fractional parts of \c x. The return value is the /// Gets the integral and fractional parts of \c x. The return value is the
/// fractional part and \c integral is set to the integral part. /// fractional part and \c integral is set to the integral part.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float32 ModF(vtkm::Float32 x, vtkm::Float32 &integral) vtkm::Float32 ModF(vtkm::Float32 x, vtkm::Float32 &integral)
{ {
return std::modf(x, &integral); return std::modf(x, &integral);
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Float64 ModF(vtkm::Float64 x, vtkm::Float64 &integral) vtkm::Float64 ModF(vtkm::Float64 x, vtkm::Float64 &integral)
{ {
return std::modf(x, &integral); return std::modf(x, &integral);
@ -898,7 +898,7 @@ vtkm::Float64 ModF(vtkm::Float64 x, vtkm::Float64 &integral)
/// Return the absolute value of \p x. That is, return \p x if it is positive or /// Return the absolute value of \p x. That is, return \p x if it is positive or
/// \p -x if it is negative. /// \p -x if it is negative.
/// ///
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Int32 Abs(vtkm::Int32 x) vtkm::Int32 Abs(vtkm::Int32 x)
{ {
#if VTKM_SIZE_INT == 4 #if VTKM_SIZE_INT == 4
@ -907,7 +907,7 @@ vtkm::Int32 Abs(vtkm::Int32 x)
#error Unknown size of Int32. #error Unknown size of Int32.
#endif #endif
} }
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Int64 Abs(vtkm::Int64 x) vtkm::Int64 Abs(vtkm::Int64 x)
{ {
#if VTKM_SIZE_LONG == 8 #if VTKM_SIZE_LONG == 8
@ -940,7 +940,7 @@ $binary_math_function('CopySign', 'copysign')\
$# $#
template<typename T, vtkm::IdComponent N> template<typename T, vtkm::IdComponent N>
VTKM_EXEC_CONT_EXPORT static inline VTKM_EXEC_CONT
vtkm::Vec<T,N> CopySign(const vtkm::Vec<T,N> &x, const vtkm::Vec<T,N> &y) vtkm::Vec<T,N> CopySign(const vtkm::Vec<T,N> &x, const vtkm::Vec<T,N> &y)
{ {
vtkm::Vec<T,N> result; vtkm::Vec<T,N> result;

@ -47,17 +47,17 @@ public:
static const vtkm::IdComponent NUM_ROWS = NumRow; static const vtkm::IdComponent NUM_ROWS = NumRow;
static const vtkm::IdComponent NUM_COLUMNS = NumCol; static const vtkm::IdComponent NUM_COLUMNS = NumCol;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Matrix() { } Matrix() { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
explicit Matrix(const ComponentType &value) explicit Matrix(const ComponentType &value)
: Components(vtkm::Vec<ComponentType, NUM_COLUMNS>(value)) { } : Components(vtkm::Vec<ComponentType, NUM_COLUMNS>(value)) { }
/// Brackets are used to reference a matrix like a 2D array (i.e. /// Brackets are used to reference a matrix like a 2D array (i.e.
/// matrix[row][column]). /// matrix[row][column]).
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Vec<ComponentType, NUM_COLUMNS> & const vtkm::Vec<ComponentType, NUM_COLUMNS> &
operator[](vtkm::IdComponent rowIndex) const { operator[](vtkm::IdComponent rowIndex) const {
VTKM_ASSERT(rowIndex >= 0); VTKM_ASSERT(rowIndex >= 0);
@ -68,7 +68,7 @@ public:
/// Brackets are used to referens a matrix like a 2D array i.e. /// Brackets are used to referens a matrix like a 2D array i.e.
/// matrix[row][column]. /// matrix[row][column].
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<ComponentType, NUM_COLUMNS> & vtkm::Vec<ComponentType, NUM_COLUMNS> &
operator[](vtkm::IdComponent rowIndex) { operator[](vtkm::IdComponent rowIndex) {
VTKM_ASSERT(rowIndex >= 0); VTKM_ASSERT(rowIndex >= 0);
@ -79,7 +79,7 @@ public:
/// Parentheses are used to reference a matrix using mathematical tuple /// Parentheses are used to reference a matrix using mathematical tuple
/// notation i.e. matrix(row,column). /// notation i.e. matrix(row,column).
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ComponentType & const ComponentType &
operator()(vtkm::IdComponent rowIndex, vtkm::IdComponent colIndex) const { operator()(vtkm::IdComponent rowIndex, vtkm::IdComponent colIndex) const {
VTKM_ASSERT(rowIndex >= 0); VTKM_ASSERT(rowIndex >= 0);
@ -92,7 +92,7 @@ public:
/// Parentheses are used to reference a matrix using mathematical tuple /// Parentheses are used to reference a matrix using mathematical tuple
/// notation i.e. matrix(row,column). /// notation i.e. matrix(row,column).
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType & ComponentType &
operator()(vtkm::IdComponent rowIndex, vtkm::IdComponent colIndex) { operator()(vtkm::IdComponent rowIndex, vtkm::IdComponent colIndex) {
VTKM_ASSERT(rowIndex >= 0); VTKM_ASSERT(rowIndex >= 0);
@ -110,7 +110,7 @@ private:
/// matrix. /// matrix.
/// ///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Vec<T, NumCol> &MatrixGetRow( const vtkm::Vec<T, NumCol> &MatrixGetRow(
const vtkm::Matrix<T,NumRow,NumCol> &matrix, vtkm::IdComponent rowIndex) const vtkm::Matrix<T,NumRow,NumCol> &matrix, vtkm::IdComponent rowIndex)
{ {
@ -121,7 +121,7 @@ const vtkm::Vec<T, NumCol> &MatrixGetRow(
/// matrix. Might not be as efficient as the \c MatrixGetRow function. /// matrix. Might not be as efficient as the \c MatrixGetRow function.
/// ///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, NumRow> MatrixGetColumn( vtkm::Vec<T, NumRow> MatrixGetColumn(
const vtkm::Matrix<T,NumRow,NumCol> &matrix, vtkm::IdComponent columnIndex) const vtkm::Matrix<T,NumRow,NumCol> &matrix, vtkm::IdComponent columnIndex)
{ {
@ -136,7 +136,7 @@ vtkm::Vec<T, NumRow> MatrixGetColumn(
/// Convenience function for setting a row of a matrix. /// Convenience function for setting a row of a matrix.
/// ///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void MatrixSetRow(vtkm::Matrix<T,NumRow,NumCol> &matrix, void MatrixSetRow(vtkm::Matrix<T,NumRow,NumCol> &matrix,
vtkm::IdComponent rowIndex, vtkm::IdComponent rowIndex,
const vtkm::Vec<T,NumCol> &rowValues) const vtkm::Vec<T,NumCol> &rowValues)
@ -147,7 +147,7 @@ void MatrixSetRow(vtkm::Matrix<T,NumRow,NumCol> &matrix,
/// Convenience function for setting a column of a matrix. /// Convenience function for setting a column of a matrix.
/// ///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void MatrixSetColumn(vtkm::Matrix<T,NumRow,NumCol> &matrix, void MatrixSetColumn(vtkm::Matrix<T,NumRow,NumCol> &matrix,
vtkm::IdComponent columnIndex, vtkm::IdComponent columnIndex,
const vtkm::Vec<T,NumRow> &columnValues) const vtkm::Vec<T,NumRow> &columnValues)
@ -164,7 +164,7 @@ template<typename T,
vtkm::IdComponent NumRow, vtkm::IdComponent NumRow,
vtkm::IdComponent NumCol, vtkm::IdComponent NumCol,
vtkm::IdComponent NumInternal> vtkm::IdComponent NumInternal>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,NumRow,NumCol> MatrixMultiply( vtkm::Matrix<T,NumRow,NumCol> MatrixMultiply(
const vtkm::Matrix<T,NumRow,NumInternal> &leftFactor, const vtkm::Matrix<T,NumRow,NumInternal> &leftFactor,
const vtkm::Matrix<T,NumInternal,NumCol> &rightFactor) const vtkm::Matrix<T,NumInternal,NumCol> &rightFactor)
@ -191,7 +191,7 @@ vtkm::Matrix<T,NumRow,NumCol> MatrixMultiply(
/// Standard matrix-vector multiplication. /// Standard matrix-vector multiplication.
/// ///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,NumRow> MatrixMultiply( vtkm::Vec<T,NumRow> MatrixMultiply(
const vtkm::Matrix<T,NumRow,NumCol> &leftFactor, const vtkm::Matrix<T,NumRow,NumCol> &leftFactor,
const vtkm::Vec<T,NumCol> &rightFactor) const vtkm::Vec<T,NumCol> &rightFactor)
@ -208,7 +208,7 @@ vtkm::Vec<T,NumRow> MatrixMultiply(
/// Standard vector-matrix multiplication /// Standard vector-matrix multiplication
/// ///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,NumCol> MatrixMultiply( vtkm::Vec<T,NumCol> MatrixMultiply(
const vtkm::Vec<T,NumRow> &leftFactor, const vtkm::Vec<T,NumRow> &leftFactor,
const vtkm::Matrix<T,NumRow,NumCol> &rightFactor) const vtkm::Matrix<T,NumRow,NumCol> &rightFactor)
@ -226,7 +226,7 @@ vtkm::Vec<T,NumCol> MatrixMultiply(
/// Returns the identity matrix. /// Returns the identity matrix.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,Size,Size> MatrixIdentity() vtkm::Matrix<T,Size,Size> MatrixIdentity()
{ {
vtkm::Matrix<T,Size,Size> result(T(0)); vtkm::Matrix<T,Size,Size> result(T(0));
@ -240,7 +240,7 @@ vtkm::Matrix<T,Size,Size> MatrixIdentity()
/// Fills the given matrix with the identity matrix. /// Fills the given matrix with the identity matrix.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void MatrixIdentity(vtkm::Matrix<T,Size,Size> &matrix) void MatrixIdentity(vtkm::Matrix<T,Size,Size> &matrix)
{ {
matrix = vtkm::MatrixIdentity<T,Size>(); matrix = vtkm::MatrixIdentity<T,Size>();
@ -249,7 +249,7 @@ void MatrixIdentity(vtkm::Matrix<T,Size,Size> &matrix)
/// Returns the transpose of the given matrix. /// Returns the transpose of the given matrix.
/// ///
template<typename T, vtkm::IdComponent NumRows, vtkm::IdComponent NumCols> template<typename T, vtkm::IdComponent NumRows, vtkm::IdComponent NumCols>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,NumCols,NumRows> MatrixTranspose( vtkm::Matrix<T,NumCols,NumRows> MatrixTranspose(
const vtkm::Matrix<T,NumRows,NumCols> &matrix) const vtkm::Matrix<T,NumRows,NumCols> &matrix)
{ {
@ -274,7 +274,7 @@ namespace detail {
// Used with MatrixLUPFactor. // Used with MatrixLUPFactor.
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void MatrixLUPFactorFindPivot(vtkm::Matrix<T,Size,Size> &A, void MatrixLUPFactorFindPivot(vtkm::Matrix<T,Size,Size> &A,
vtkm::Vec<vtkm::IdComponent,Size> &permutation, vtkm::Vec<vtkm::IdComponent,Size> &permutation,
vtkm::IdComponent topCornerIndex, vtkm::IdComponent topCornerIndex,
@ -318,7 +318,7 @@ void MatrixLUPFactorFindPivot(vtkm::Matrix<T,Size,Size> &A,
// Used with MatrixLUPFactor // Used with MatrixLUPFactor
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void MatrixLUPFactorFindUpperTriangleElements(vtkm::Matrix<T,Size,Size> &A, void MatrixLUPFactorFindUpperTriangleElements(vtkm::Matrix<T,Size,Size> &A,
vtkm::IdComponent topCornerIndex) vtkm::IdComponent topCornerIndex)
{ {
@ -376,7 +376,7 @@ void MatrixLUPFactorFindUpperTriangleElements(vtkm::Matrix<T,Size,Size> &A,
/// Otherwise, valid is set to false and the result is indeterminant. /// Otherwise, valid is set to false and the result is indeterminant.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void MatrixLUPFactor(vtkm::Matrix<T,Size,Size> &A, void MatrixLUPFactor(vtkm::Matrix<T,Size,Size> &A,
vtkm::Vec<vtkm::IdComponent,Size> &permutation, vtkm::Vec<vtkm::IdComponent,Size> &permutation,
T &inversionParity, T &inversionParity,
@ -402,7 +402,7 @@ void MatrixLUPFactor(vtkm::Matrix<T,Size,Size> &A,
/// matrices calculated by MatrixLUPFactor from A. The x matrix is returned. /// matrices calculated by MatrixLUPFactor from A. The x matrix is returned.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,Size> vtkm::Vec<T,Size>
MatrixLUPSolve(const vtkm::Matrix<T,Size,Size> &LU, MatrixLUPSolve(const vtkm::Matrix<T,Size,Size> &LU,
const vtkm::Vec<vtkm::IdComponent,Size> &permutation, const vtkm::Vec<vtkm::IdComponent,Size> &permutation,
@ -448,7 +448,7 @@ MatrixLUPSolve(const vtkm::Matrix<T,Size,Size> &LU,
/// is set to true, false otherwise. /// is set to true, false otherwise.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,Size> SolveLinearSystem(const vtkm::Matrix<T,Size,Size> &A, vtkm::Vec<T,Size> SolveLinearSystem(const vtkm::Matrix<T,Size,Size> &A,
const vtkm::Vec<T,Size> &b, const vtkm::Vec<T,Size> &b,
bool &valid) bool &valid)
@ -467,7 +467,7 @@ vtkm::Vec<T,Size> SolveLinearSystem(const vtkm::Matrix<T,Size,Size> &A,
/// the inverse will not be correct and valid will be set to false. /// the inverse will not be correct and valid will be set to false.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,Size,Size> MatrixInverse(const vtkm::Matrix<T,Size,Size> &A, vtkm::Matrix<T,Size,Size> MatrixInverse(const vtkm::Matrix<T,Size,Size> &A,
bool &valid) bool &valid)
{ {
@ -495,7 +495,7 @@ vtkm::Matrix<T,Size,Size> MatrixInverse(const vtkm::Matrix<T,Size,Size> &A,
/// Compute the determinant of a matrix. /// Compute the determinant of a matrix.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,Size,Size> &A) T MatrixDeterminant(const vtkm::Matrix<T,Size,Size> &A)
{ {
// First, we will make an LUP-factorization to help us. // First, we will make an LUP-factorization to help us.
@ -524,21 +524,21 @@ T MatrixDeterminant(const vtkm::Matrix<T,Size,Size> &A)
// Specializations for common small determinants. // Specializations for common small determinants.
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,1,1> &A) T MatrixDeterminant(const vtkm::Matrix<T,1,1> &A)
{ {
return A(0,0); return A(0,0);
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,2,2> &A) T MatrixDeterminant(const vtkm::Matrix<T,2,2> &A)
{ {
return A(0,0)*A(1,1) - A(1,0)*A(0,1); return A(0,0)*A(1,1) - A(1,0)*A(0,1);
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,3,3> &A) T MatrixDeterminant(const vtkm::Matrix<T,3,3> &A)
{ {
return A(0,0) * A(1,1) * A(2,2) + A(1,0) * A(2,1) * A(0,2) + return A(0,0) * A(1,1) * A(2,2) + A(1,0) * A(2,1) * A(0,2) +
@ -572,26 +572,26 @@ public:
typedef vtkm::VecTraitsTagMultipleComponents HasMultipleComponents; typedef vtkm::VecTraitsTagMultipleComponents HasMultipleComponents;
typedef vtkm::VecTraitsTagSizeStatic IsSizeStatic; typedef vtkm::VecTraitsTagSizeStatic IsSizeStatic;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::IdComponent GetNumberOfComponents(const MatrixType &) { static vtkm::IdComponent GetNumberOfComponents(const MatrixType &) {
return NUM_COMPONENTS; return NUM_COMPONENTS;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static const ComponentType &GetComponent(const MatrixType &matrix, static const ComponentType &GetComponent(const MatrixType &matrix,
vtkm::IdComponent component) { vtkm::IdComponent component) {
vtkm::IdComponent colIndex = component % NumCol; vtkm::IdComponent colIndex = component % NumCol;
vtkm::IdComponent rowIndex = component / NumCol; vtkm::IdComponent rowIndex = component / NumCol;
return matrix(rowIndex,colIndex); return matrix(rowIndex,colIndex);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static ComponentType &GetComponent(MatrixType &matrix, static ComponentType &GetComponent(MatrixType &matrix,
vtkm::IdComponent component) { vtkm::IdComponent component) {
vtkm::IdComponent colIndex = component % NumCol; vtkm::IdComponent colIndex = component % NumCol;
vtkm::IdComponent rowIndex = component / NumCol; vtkm::IdComponent rowIndex = component / NumCol;
return matrix(rowIndex,colIndex); return matrix(rowIndex,colIndex);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void SetComponent(MatrixType &matrix, static void SetComponent(MatrixType &matrix,
vtkm::IdComponent component, vtkm::IdComponent component,
T value) T value)
@ -606,7 +606,7 @@ public:
// Basic comparison operators. // Basic comparison operators.
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator==(const vtkm::Matrix<T,NumRow,NumCol> &a, bool operator==(const vtkm::Matrix<T,NumRow,NumCol> &a,
const vtkm::Matrix<T,NumRow,NumCol> &b) const vtkm::Matrix<T,NumRow,NumCol> &b)
{ {
@ -620,7 +620,7 @@ bool operator==(const vtkm::Matrix<T,NumRow,NumCol> &a,
return true; return true;
} }
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol> template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator!=(const vtkm::Matrix<T,NumRow,NumCol> &a, bool operator!=(const vtkm::Matrix<T,NumRow,NumCol> &a,
const vtkm::Matrix<T,NumRow,NumCol> &b) const vtkm::Matrix<T,NumRow,NumCol> &b)
{ {

@ -40,7 +40,7 @@ template<typename ScalarType,
vtkm::IdComponent Size, vtkm::IdComponent Size,
typename JacobianFunctor, typename JacobianFunctor,
typename FunctionFunctor> typename FunctionFunctor>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<ScalarType,Size> vtkm::Vec<ScalarType,Size>
NewtonsMethod(JacobianFunctor jacobianEvaluator, NewtonsMethod(JacobianFunctor jacobianEvaluator,
FunctionFunctor functionEvaluator, FunctionFunctor functionEvaluator,

@ -63,24 +63,24 @@ struct Pair
/// ///
SecondType second; SecondType second;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Pair() : first(), second() { } Pair() : first(), second() { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Pair(const FirstType &firstSrc, const SecondType &secondSrc) Pair(const FirstType &firstSrc, const SecondType &secondSrc)
: first(firstSrc), second(secondSrc) { } : first(firstSrc), second(secondSrc) { }
template <typename U1, typename U2> template <typename U1, typename U2>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Pair(const vtkm::Pair<U1,U2> &src) Pair(const vtkm::Pair<U1,U2> &src)
: first(src.first), second(src.second) { } : first(src.first), second(src.second) { }
template <typename U1, typename U2> template <typename U1, typename U2>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Pair(const std::pair<U1,U2> &src) Pair(const std::pair<U1,U2> &src)
: first(src.first), second(src.second) { } : first(src.first), second(src.second) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Pair<FirstType,SecondType> & vtkm::Pair<FirstType,SecondType> &
operator=(const vtkm::Pair<FirstType,SecondType> &src) { operator=(const vtkm::Pair<FirstType,SecondType> &src) {
this->first = src.first; this->first = src.first;
@ -88,12 +88,12 @@ struct Pair
return *this; return *this;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator==(const vtkm::Pair<FirstType,SecondType> &other) const { bool operator==(const vtkm::Pair<FirstType,SecondType> &other) const {
return ((this->first == other.first) && (this->second == other.second)); return ((this->first == other.first) && (this->second == other.second));
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator!=(const vtkm::Pair<FirstType,SecondType> &other) const { bool operator!=(const vtkm::Pair<FirstType,SecondType> &other) const {
return !(*this == other); return !(*this == other);
} }
@ -101,7 +101,7 @@ struct Pair
/// Tests ordering on the first object, and then on the second object if the /// Tests ordering on the first object, and then on the second object if the
/// first are equal. /// first are equal.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator<(const vtkm::Pair<FirstType,SecondType> &other) const { bool operator<(const vtkm::Pair<FirstType,SecondType> &other) const {
return ((this->first < other.first) return ((this->first < other.first)
|| (!(other.first < this->first) && (this->second < other.second))); || (!(other.first < this->first) && (this->second < other.second)));
@ -110,7 +110,7 @@ struct Pair
/// Tests ordering on the first object, and then on the second object if the /// Tests ordering on the first object, and then on the second object if the
/// first are equal. /// first are equal.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator>(const vtkm::Pair<FirstType,SecondType> &other) const { bool operator>(const vtkm::Pair<FirstType,SecondType> &other) const {
return (other < *this); return (other < *this);
} }
@ -118,7 +118,7 @@ struct Pair
/// Tests ordering on the first object, and then on the second object if the /// Tests ordering on the first object, and then on the second object if the
/// first are equal. /// first are equal.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator<=(const vtkm::Pair<FirstType,SecondType> &other) const { bool operator<=(const vtkm::Pair<FirstType,SecondType> &other) const {
return !(other < *this); return !(other < *this);
} }
@ -126,7 +126,7 @@ struct Pair
/// Tests ordering on the first object, and then on the second object if the /// Tests ordering on the first object, and then on the second object if the
/// first are equal. /// first are equal.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator>=(const vtkm::Pair<FirstType,SecondType> &other) const { bool operator>=(const vtkm::Pair<FirstType,SecondType> &other) const {
return !(*this < other); return !(*this < other);
} }
@ -136,14 +136,14 @@ struct Pair
/// This is done by adding the two objects separately. /// This is done by adding the two objects separately.
/// Useful for Reduce operation on a zipped array /// Useful for Reduce operation on a zipped array
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Pair<T, U> operator+(const vtkm::Pair<T, U>& a, const vtkm::Pair<T, U> &b) vtkm::Pair<T, U> operator+(const vtkm::Pair<T, U>& a, const vtkm::Pair<T, U> &b)
{ {
return vtkm::Pair<T,U>(a.first + b.first, a.second + b.second); return vtkm::Pair<T,U>(a.first + b.first, a.second + b.second);
} }
template <typename T1, typename T2> template <typename T1, typename T2>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Pair<T1,T2> make_Pair(const T1 &firstSrc, const T2 &secondSrc) vtkm::Pair<T1,T2> make_Pair(const T1 &firstSrc, const T2 &secondSrc)
{ {
return vtkm::Pair<T1,T2>(firstSrc, secondSrc); return vtkm::Pair<T1,T2>(firstSrc, secondSrc);

@ -41,16 +41,16 @@ struct Range
vtkm::Float64 Min; vtkm::Float64 Min;
vtkm::Float64 Max; vtkm::Float64 Max;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Range() : Min(vtkm::Infinity64()), Max(vtkm::NegativeInfinity64()) { } Range() : Min(vtkm::Infinity64()), Max(vtkm::NegativeInfinity64()) { }
template<typename T1, typename T2> template<typename T1, typename T2>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Range(const T1 &min, const T2 &max) Range(const T1 &min, const T2 &max)
: Min(static_cast<vtkm::Float64>(min)), Max(static_cast<vtkm::Float64>(max)) : Min(static_cast<vtkm::Float64>(min)), Max(static_cast<vtkm::Float64>(max))
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const vtkm::Range &operator=(const vtkm::Range &src) const vtkm::Range &operator=(const vtkm::Range &src)
{ {
this->Min = src.Min; this->Min = src.Min;
@ -67,7 +67,7 @@ struct Range
/// \c IsNonEmpty assumes \c Min and \c Max are inclusive. That is, if they /// \c IsNonEmpty assumes \c Min and \c Max are inclusive. That is, if they
/// are equal then true is returned. /// are equal then true is returned.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool IsNonEmpty() const bool IsNonEmpty() const
{ {
return (this->Min <= this->Max); return (this->Min <= this->Max);
@ -80,7 +80,7 @@ struct Range
/// the value is exactly the min or max, true is returned. /// the value is exactly the min or max, true is returned.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool Contains(const T &value) const bool Contains(const T &value) const
{ {
return ((this->Min <= static_cast<vtkm::Float64>(value)) && return ((this->Min <= static_cast<vtkm::Float64>(value)) &&
@ -92,7 +92,7 @@ struct Range
/// \c Length computes the distance between the min and max. If the range /// \c Length computes the distance between the min and max. If the range
/// is empty, 0 is returned. /// is empty, 0 is returned.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Float64 Length() const vtkm::Float64 Length() const
{ {
if (this->IsNonEmpty()) if (this->IsNonEmpty())
@ -110,7 +110,7 @@ struct Range
/// \c Center computes the middle value of the range. If the range is empty, /// \c Center computes the middle value of the range. If the range is empty,
/// NaN is returned. /// NaN is returned.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Float64 Center() const vtkm::Float64 Center() const
{ {
if (this->IsNonEmpty()) if (this->IsNonEmpty())
@ -130,7 +130,7 @@ struct Range
/// done. /// done.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Include(const T &value) void Include(const T &value)
{ {
this->Min = vtkm::Min(this->Min, static_cast<vtkm::Float64>(value)); this->Min = vtkm::Min(this->Min, static_cast<vtkm::Float64>(value));
@ -142,7 +142,7 @@ struct Range
/// This version of \c Include expands this range just enough to include that /// This version of \c Include expands this range just enough to include that
/// of another range. Esentially it is the union of the two ranges. /// of another range. Esentially it is the union of the two ranges.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Include(const vtkm::Range &range) void Include(const vtkm::Range &range)
{ {
this->Include(range.Min); this->Include(range.Min);
@ -153,7 +153,7 @@ struct Range
/// ///
/// This is a nondestructive form of \c Include. /// This is a nondestructive form of \c Include.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Range Union(const vtkm::Range &otherRange) const vtkm::Range Union(const vtkm::Range &otherRange) const
{ {
vtkm::Range unionRange(*this); vtkm::Range unionRange(*this);
@ -163,19 +163,19 @@ struct Range
/// \b Operator for union /// \b Operator for union
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Range operator+(const vtkm::Range &otherRange) const vtkm::Range operator+(const vtkm::Range &otherRange) const
{ {
return this->Union(otherRange); return this->Union(otherRange);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator==(const vtkm::Range &otherRange) const bool operator==(const vtkm::Range &otherRange) const
{ {
return ((this->Min == otherRange.Min) && (this->Max == otherRange.Max)); return ((this->Min == otherRange.Min) && (this->Max == otherRange.Max));
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator!=(const vtkm::Range &otherRange) const bool operator!=(const vtkm::Range &otherRange) const
{ {
return ((this->Min != otherRange.Min) || (this->Max != otherRange.Max)); return ((this->Min != otherRange.Min) || (this->Max != otherRange.Max));
@ -186,7 +186,7 @@ struct Range
/// Helper function for printing ranges during testing /// Helper function for printing ranges during testing
/// ///
VTKM_CONT_EXPORT static inline VTKM_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Range &range) std::ostream &operator<<(std::ostream &stream, const vtkm::Range &range)
{ {
return stream << "[" << range.Min << ".." << range.Max << "]"; return stream << "[" << range.Min << ".." << range.Max << "]";

@ -42,7 +42,7 @@ namespace vtkm {
/// transformations. /// transformations.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> Transform3DPoint(const vtkm::Matrix<T,4,4> &matrix, vtkm::Vec<T,3> Transform3DPoint(const vtkm::Matrix<T,4,4> &matrix,
const vtkm::Vec<T,3> &point) const vtkm::Vec<T,3> &point)
{ {
@ -63,7 +63,7 @@ vtkm::Vec<T,3> Transform3DPoint(const vtkm::Matrix<T,4,4> &matrix,
/// transformations, but requires some more computations. /// transformations, but requires some more computations.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> Transform3DPointPerspective(const vtkm::Matrix<T,4,4> &matrix, vtkm::Vec<T,3> Transform3DPointPerspective(const vtkm::Matrix<T,4,4> &matrix,
const vtkm::Vec<T,3> &point) const vtkm::Vec<T,3> &point)
{ {
@ -82,7 +82,7 @@ vtkm::Vec<T,3> Transform3DPointPerspective(const vtkm::Matrix<T,4,4> &matrix,
/// vectors do not get translated. /// vectors do not get translated.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> Transform3DVector(const vtkm::Matrix<T,4,4> &matrix, vtkm::Vec<T,3> Transform3DVector(const vtkm::Matrix<T,4,4> &matrix,
const vtkm::Vec<T,3> &vector) const vtkm::Vec<T,3> &vector)
{ {
@ -100,7 +100,7 @@ vtkm::Vec<T,3> Transform3DVector(const vtkm::Matrix<T,4,4> &matrix,
/// transformation matrix for those scales. /// transformation matrix for those scales.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> vtkm::Matrix<T,4,4>
Transform3DScale(const T &scaleX, const T &scaleY, const T &scaleZ) Transform3DScale(const T &scaleX, const T &scaleY, const T &scaleZ)
{ {
@ -118,7 +118,7 @@ Transform3DScale(const T &scaleX, const T &scaleY, const T &scaleZ)
/// returns a transformation matrix for those scales. /// returns a transformation matrix for those scales.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DScale(const vtkm::Vec<T,3> &scaleVec) vtkm::Matrix<T,4,4> Transform3DScale(const vtkm::Vec<T,3> &scaleVec)
{ {
return vtkm::Transform3DScale(scaleVec[0], scaleVec[1], scaleVec[2]); return vtkm::Transform3DScale(scaleVec[0], scaleVec[1], scaleVec[2]);
@ -130,7 +130,7 @@ vtkm::Matrix<T,4,4> Transform3DScale(const vtkm::Vec<T,3> &scaleVec)
/// scales. /// scales.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DScale(const T &scale) vtkm::Matrix<T,4,4> Transform3DScale(const T &scale)
{ {
return vtkm::Transform3DScale(scale, scale, scale); return vtkm::Transform3DScale(scale, scale, scale);
@ -139,7 +139,7 @@ vtkm::Matrix<T,4,4> Transform3DScale(const T &scale)
/// \brief Returns a translation matrix. /// \brief Returns a translation matrix.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DTranslate(const T &x, const T &y, const T &z) vtkm::Matrix<T,4,4> Transform3DTranslate(const T &x, const T &y, const T &z)
{ {
vtkm::Matrix<T,4,4> translateMatrix; vtkm::Matrix<T,4,4> translateMatrix;
@ -150,7 +150,7 @@ vtkm::Matrix<T,4,4> Transform3DTranslate(const T &x, const T &y, const T &z)
return translateMatrix; return translateMatrix;
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DTranslate(const vtkm::Vec<T,3> &v) vtkm::Matrix<T,4,4> Transform3DTranslate(const vtkm::Vec<T,3> &v)
{ {
return vtkm::Transform3DTranslate(v[0], v[1], v[2]); return vtkm::Transform3DTranslate(v[0], v[1], v[2]);
@ -164,7 +164,7 @@ vtkm::Matrix<T,4,4> Transform3DTranslate(const vtkm::Vec<T,3> &v)
/// rotation will be counterclockwise. /// rotation will be counterclockwise.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees, vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees,
const vtkm::Vec<T,3> &axisOfRotation) const vtkm::Vec<T,3> &axisOfRotation)
{ {
@ -198,7 +198,7 @@ vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees,
return matrix; return matrix;
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees, T x, T y, T z) vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees, T x, T y, T z)
{ {
return vtkm::Transform3DRotate(angleDegrees, vtkm::Vec<T,3>(x,y,z)); return vtkm::Transform3DRotate(angleDegrees, vtkm::Vec<T,3>(x,y,z));
@ -209,7 +209,7 @@ vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees, T x, T y, T z)
/// Returns a transformation matrix that rotates around the x axis. /// Returns a transformation matrix that rotates around the x axis.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotateX(T angleDegrees) vtkm::Matrix<T,4,4> Transform3DRotateX(T angleDegrees)
{ {
return vtkm::Transform3DRotate(angleDegrees, T(1), T(0), T(0)); return vtkm::Transform3DRotate(angleDegrees, T(1), T(0), T(0));
@ -220,7 +220,7 @@ vtkm::Matrix<T,4,4> Transform3DRotateX(T angleDegrees)
/// Returns a transformation matrix that rotates around the y axis. /// Returns a transformation matrix that rotates around the y axis.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotateY(T angleDegrees) vtkm::Matrix<T,4,4> Transform3DRotateY(T angleDegrees)
{ {
return vtkm::Transform3DRotate(angleDegrees, T(0), T(1), T(0)); return vtkm::Transform3DRotate(angleDegrees, T(0), T(1), T(0));
@ -231,7 +231,7 @@ vtkm::Matrix<T,4,4> Transform3DRotateY(T angleDegrees)
/// Returns a transformation matrix that rotates around the z axis. /// Returns a transformation matrix that rotates around the z axis.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotateZ(T angleDegrees) vtkm::Matrix<T,4,4> Transform3DRotateZ(T angleDegrees)
{ {
return vtkm::Transform3DRotate(angleDegrees, T(0), T(0), T(1)); return vtkm::Transform3DRotate(angleDegrees, T(0), T(0), T(1));

@ -72,7 +72,7 @@ public:
/// also be treated as vectors. /// also be treated as vectors.
typedef TypeTraitsUnknownTag DimensionalityTag; typedef TypeTraitsUnknownTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT static T ZeroInitialization() { return T(); } VTKM_EXEC_CONT static T ZeroInitialization() { return T(); }
}; };
// Const types should have the same traits as their non-const counterparts. // Const types should have the same traits as their non-const counterparts.
@ -85,14 +85,14 @@ struct TypeTraits<const T> : TypeTraits<T>
template<> struct TypeTraits<T> { \ template<> struct TypeTraits<T> { \
typedef TypeTraitsRealTag NumericTag; \ typedef TypeTraitsRealTag NumericTag; \
typedef TypeTraitsScalarTag DimensionalityTag; \ typedef TypeTraitsScalarTag DimensionalityTag; \
VTKM_EXEC_CONT_EXPORT static T ZeroInitialization() { return T(); } \ VTKM_EXEC_CONT static T ZeroInitialization() { return T(); } \
}; };
#define VTKM_BASIC_INTEGER_TYPE(T) \ #define VTKM_BASIC_INTEGER_TYPE(T) \
template<> struct TypeTraits< T > { \ template<> struct TypeTraits< T > { \
typedef TypeTraitsIntegerTag NumericTag; \ typedef TypeTraitsIntegerTag NumericTag; \
typedef TypeTraitsScalarTag DimensionalityTag; \ typedef TypeTraitsScalarTag DimensionalityTag; \
VTKM_EXEC_CONT_EXPORT static T ZeroInitialization() \ VTKM_EXEC_CONT static T ZeroInitialization() \
{ \ { \
typedef T ReturnType; \ typedef T ReturnType; \
return ReturnType(); \ return ReturnType(); \
@ -129,7 +129,7 @@ struct TypeTraits<vtkm::Vec<T,Size> >
typedef typename vtkm::TypeTraits<T>::NumericTag NumericTag; typedef typename vtkm::TypeTraits<T>::NumericTag NumericTag;
typedef TypeTraitsVectorTag DimensionalityTag; typedef TypeTraitsVectorTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Vec<T,Size> ZeroInitialization() static vtkm::Vec<T,Size> ZeroInitialization()
{ return vtkm::Vec<T,Size>( (T()) ); } { return vtkm::Vec<T,Size>( (T()) ); }
}; };
@ -142,7 +142,7 @@ struct TypeTraits<vtkm::Pair<T,U> >
typedef TypeTraitsUnknownTag NumericTag; typedef TypeTraitsUnknownTag NumericTag;
typedef TypeTraitsScalarTag DimensionalityTag; typedef TypeTraitsScalarTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::Pair<T,U> ZeroInitialization() static vtkm::Pair<T,U> ZeroInitialization()
{ {
return vtkm::Pair<T,U>(TypeTraits<T>::ZeroInitialization(), return vtkm::Pair<T,U>(TypeTraits<T>::ZeroInitialization(),

@ -182,7 +182,7 @@ template <vtkm::IdComponent Size>
struct VecComponentWiseUnaryOperation struct VecComponentWiseUnaryOperation
{ {
template<typename T, typename UnaryOpType> template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const T operator()(const T &v, const UnaryOpType &unaryOp) const
{ {
T result; T result;
@ -198,7 +198,7 @@ template<>
struct VecComponentWiseUnaryOperation<1> struct VecComponentWiseUnaryOperation<1>
{ {
template<typename T, typename UnaryOpType> template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const T operator()(const T &v, const UnaryOpType &unaryOp) const
{ {
return T(unaryOp(v[0])); return T(unaryOp(v[0]));
@ -209,7 +209,7 @@ template<>
struct VecComponentWiseUnaryOperation<2> struct VecComponentWiseUnaryOperation<2>
{ {
template<typename T, typename UnaryOpType> template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const T operator()(const T &v, const UnaryOpType &unaryOp) const
{ {
return T(unaryOp(v[0]), unaryOp(v[1])); return T(unaryOp(v[0]), unaryOp(v[1]));
@ -220,7 +220,7 @@ template<>
struct VecComponentWiseUnaryOperation<3> struct VecComponentWiseUnaryOperation<3>
{ {
template<typename T, typename UnaryOpType> template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const T operator()(const T &v, const UnaryOpType &unaryOp) const
{ {
return T(unaryOp(v[0]), unaryOp(v[1]), unaryOp(v[2])); return T(unaryOp(v[0]), unaryOp(v[1]), unaryOp(v[2]));
@ -231,7 +231,7 @@ template<>
struct VecComponentWiseUnaryOperation<4> struct VecComponentWiseUnaryOperation<4>
{ {
template<typename T, typename UnaryOpType> template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const T operator()(const T &v, const UnaryOpType &unaryOp) const
{ {
return T(unaryOp(v[0]), unaryOp(v[1]), unaryOp(v[2]), unaryOp(v[3])); return T(unaryOp(v[0]), unaryOp(v[1]), unaryOp(v[2]), unaryOp(v[3]));
@ -244,12 +244,12 @@ struct BindLeftBinaryOp
// Warning: a reference. // Warning: a reference.
const T& LeftValue; const T& LeftValue;
const BinaryOpType BinaryOp; const BinaryOpType BinaryOp;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
BindLeftBinaryOp(const T &leftValue, BinaryOpType binaryOp = BinaryOpType()) BindLeftBinaryOp(const T &leftValue, BinaryOpType binaryOp = BinaryOpType())
: LeftValue(leftValue), BinaryOp(binaryOp) { } : LeftValue(leftValue), BinaryOp(binaryOp) { }
template<typename RightT> template<typename RightT>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ReturnT operator()(const RightT &rightValue) const ReturnT operator()(const RightT &rightValue) const
{ {
return static_cast<ReturnT>(this->BinaryOp(this->LeftValue, return static_cast<ReturnT>(this->BinaryOp(this->LeftValue,
@ -263,12 +263,12 @@ struct BindRightBinaryOp
// Warning: a reference. // Warning: a reference.
const T& RightValue; const T& RightValue;
const BinaryOpType BinaryOp; const BinaryOpType BinaryOp;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
BindRightBinaryOp(const T &rightValue, BinaryOpType binaryOp = BinaryOpType()) BindRightBinaryOp(const T &rightValue, BinaryOpType binaryOp = BinaryOpType())
: RightValue(rightValue), BinaryOp(binaryOp) { } : RightValue(rightValue), BinaryOp(binaryOp) { }
template<typename LeftT> template<typename LeftT>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ReturnT operator()(const LeftT &leftValue) const ReturnT operator()(const LeftT &leftValue) const
{ {
return static_cast<ReturnT>(this->BinaryOp(static_cast<T>(leftValue), return static_cast<ReturnT>(this->BinaryOp(static_cast<T>(leftValue),
@ -291,7 +291,7 @@ struct BindRightBinaryOp
struct Add struct Add
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T &a, const T &b) const VTKM_EXEC_CONT T operator()(const T &a, const T &b) const
{ {
return T(a + b); return T(a + b);
} }
@ -300,7 +300,7 @@ struct Add
struct Subtract struct Subtract
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T &a, const T &b) const VTKM_EXEC_CONT T operator()(const T &a, const T &b) const
{ {
return T(a - b); return T(a - b);
} }
@ -309,7 +309,7 @@ struct Subtract
struct Multiply struct Multiply
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T &a, const T &b) const VTKM_EXEC_CONT T operator()(const T &a, const T &b) const
{ {
return T(a * b); return T(a * b);
} }
@ -318,7 +318,7 @@ struct Multiply
struct Divide struct Divide
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T &a, const T &b) const VTKM_EXEC_CONT T operator()(const T &a, const T &b) const
{ {
return T(a / b); return T(a / b);
} }
@ -327,7 +327,7 @@ struct Divide
struct Negate struct Negate
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT T operator()(const T &x) const VTKM_EXEC_CONT T operator()(const T &x) const
{ {
return T(-x); return T(-x);
} }
@ -355,12 +355,12 @@ public:
static const vtkm::IdComponent NUM_COMPONENTS = Size; static const vtkm::IdComponent NUM_COMPONENTS = Size;
protected: protected:
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
VecBase() VecBase()
{ {
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
explicit VecBase(const ComponentType& value) explicit VecBase(const ComponentType& value)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -370,8 +370,8 @@ protected:
} }
template <typename OtherValueType, typename OtherDerivedType> template <typename OtherValueType, typename OtherDerivedType>
VTKM_EXEC_CONT_EXPORT VecBase( VTKM_EXEC_CONT
const VecBase<OtherValueType, Size, OtherDerivedType>& src) VecBase(const VecBase<OtherValueType, Size, OtherDerivedType>& src)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
{ {
@ -380,14 +380,14 @@ protected:
} }
public: public:
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::IdComponent GetNumberOfComponents() const vtkm::IdComponent GetNumberOfComponents() const
{ {
return NUM_COMPONENTS; return NUM_COMPONENTS;
} }
template <vtkm::IdComponent OtherSize> template <vtkm::IdComponent OtherSize>
VTKM_EXEC_CONT_EXPORT void CopyInto( VTKM_EXEC_CONT void CopyInto(
vtkm::Vec<ComponentType, OtherSize>& dest) const vtkm::Vec<ComponentType, OtherSize>& dest) const
{ {
for (vtkm::IdComponent index = 0; for (vtkm::IdComponent index = 0;
@ -397,7 +397,7 @@ public:
} }
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass& operator=(const DerivedClass& src) DerivedClass& operator=(const DerivedClass& src)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -407,14 +407,14 @@ public:
return *static_cast<DerivedClass*>(this); return *static_cast<DerivedClass*>(this);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ComponentType& operator[](vtkm::IdComponent idx) const const ComponentType& operator[](vtkm::IdComponent idx) const
{ {
VTKM_ASSERT(idx >= 0); VTKM_ASSERT(idx >= 0);
VTKM_ASSERT(idx < this->NUM_COMPONENTS); VTKM_ASSERT(idx < this->NUM_COMPONENTS);
return this->Components[idx]; return this->Components[idx];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType& operator[](vtkm::IdComponent idx) ComponentType& operator[](vtkm::IdComponent idx)
{ {
VTKM_ASSERT(idx >= 0); VTKM_ASSERT(idx >= 0);
@ -422,7 +422,7 @@ public:
return this->Components[idx]; return this->Components[idx];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator==(const DerivedClass& other) const bool operator==(const DerivedClass& other) const
{ {
bool equal=true; bool equal=true;
@ -433,7 +433,7 @@ public:
return equal; return equal;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator<(const DerivedClass& other) const bool operator<(const DerivedClass& other) const
{ {
for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i) for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i)
@ -452,13 +452,13 @@ public:
return false; return false;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator!=(const DerivedClass& other) const bool operator!=(const DerivedClass& other) const
{ {
return !(this->operator==(other)); return !(this->operator==(other));
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType Dot(const DerivedClass& other) const ComponentType Dot(const DerivedClass& other) const
{ {
ComponentType result = this->Components[0] * other[0]; ComponentType result = this->Components[0] * other[0];
@ -480,7 +480,7 @@ public:
#pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wconversion"
#endif // gcc || clang #endif // gcc || clang
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass operator+(const DerivedClass& other) const DerivedClass operator+(const DerivedClass& other) const
{ {
DerivedClass result; DerivedClass result;
@ -491,7 +491,7 @@ public:
return result; return result;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass& operator+=(const DerivedClass& other) DerivedClass& operator+=(const DerivedClass& other)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -501,7 +501,7 @@ public:
return *static_cast<DerivedClass*>(this); return *static_cast<DerivedClass*>(this);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass operator-(const DerivedClass& other) const DerivedClass operator-(const DerivedClass& other) const
{ {
DerivedClass result; DerivedClass result;
@ -512,7 +512,7 @@ public:
return result; return result;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass& operator-=(const DerivedClass& other) DerivedClass& operator-=(const DerivedClass& other)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -522,7 +522,7 @@ public:
return *static_cast<DerivedClass*>(this); return *static_cast<DerivedClass*>(this);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass operator*(const DerivedClass& other) const DerivedClass operator*(const DerivedClass& other) const
{ {
DerivedClass result; DerivedClass result;
@ -533,7 +533,7 @@ public:
return result; return result;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass& operator*=(const DerivedClass& other) DerivedClass& operator*=(const DerivedClass& other)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -543,7 +543,7 @@ public:
return *static_cast<DerivedClass*>(this); return *static_cast<DerivedClass*>(this);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass operator/(const DerivedClass& other) const DerivedClass operator/(const DerivedClass& other) const
{ {
DerivedClass result; DerivedClass result;
@ -554,7 +554,7 @@ public:
return result; return result;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
DerivedClass& operator/=(const DerivedClass& other) DerivedClass& operator/=(const DerivedClass& other)
{ {
for (vtkm::IdComponent i = 0; i < Size; ++i) for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -569,13 +569,13 @@ public:
#endif // gcc || clang #endif // gcc || clang
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType* GetPointer() ComponentType* GetPointer()
{ {
return this->Components; return this->Components;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ComponentType* GetPointer() const const ComponentType* GetPointer() const
{ {
return this->Components; return this->Components;
@ -614,12 +614,12 @@ public:
static const vtkm::IdComponent NUM_COMPONENTS = Size; static const vtkm::IdComponent NUM_COMPONENTS = Size;
#endif #endif
VTKM_EXEC_CONT_EXPORT Vec() {} VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { } VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
// VTKM_EXEC_CONT_EXPORT explicit Vec(const T* values) : Superclass(values) { } // VTKM_EXEC_CONT explicit Vec(const T* values) : Superclass(values) { }
template<typename OtherType> template<typename OtherType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Vec(const Vec<OtherType, Size> &src) : Superclass(src) { } Vec(const Vec<OtherType, Size> &src) : Superclass(src) { }
}; };
@ -636,31 +636,31 @@ public:
typedef T ComponentType; typedef T ComponentType;
static const vtkm::IdComponent NUM_COMPONENTS = 0; static const vtkm::IdComponent NUM_COMPONENTS = 0;
VTKM_EXEC_CONT_EXPORT Vec() {} VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const ComponentType&) { } VTKM_EXEC_CONT explicit Vec(const ComponentType&) { }
template<typename OtherType> template<typename OtherType>
VTKM_EXEC_CONT_EXPORT Vec(const Vec<OtherType, NUM_COMPONENTS> &) { } VTKM_EXEC_CONT Vec(const Vec<OtherType, NUM_COMPONENTS> &) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Vec<ComponentType, NUM_COMPONENTS> & Vec<ComponentType, NUM_COMPONENTS> &
operator=(const Vec<ComponentType, NUM_COMPONENTS> &) operator=(const Vec<ComponentType, NUM_COMPONENTS> &)
{ {
return *this; return *this;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType operator[](vtkm::IdComponent vtkmNotUsed(idx)) const ComponentType operator[](vtkm::IdComponent vtkmNotUsed(idx)) const
{ {
return ComponentType(); return ComponentType();
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator==(const Vec<T, NUM_COMPONENTS> &vtkmNotUsed(other)) const bool operator==(const Vec<T, NUM_COMPONENTS> &vtkmNotUsed(other)) const
{ {
return true; return true;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
bool operator!=(const Vec<T, NUM_COMPONENTS> &vtkmNotUsed(other)) const bool operator!=(const Vec<T, NUM_COMPONENTS> &vtkmNotUsed(other)) const
{ {
return false; return false;
@ -675,15 +675,15 @@ class Vec<T,1> : public detail::VecBase<T, 1, Vec<T,1> >
typedef detail::VecBase<T, 1, Vec<T,1> > Superclass; typedef detail::VecBase<T, 1, Vec<T,1> > Superclass;
public: public:
VTKM_EXEC_CONT_EXPORT Vec() {} VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { } VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
template<typename OtherType> template<typename OtherType>
VTKM_EXEC_CONT_EXPORT Vec(const Vec<OtherType, 1> &src) : Superclass(src) { } VTKM_EXEC_CONT Vec(const Vec<OtherType, 1> &src) : Superclass(src) { }
// This convenience operator removed because it was causing ambiguous // This convenience operator removed because it was causing ambiguous
// overload errors // overload errors
// VTKM_EXEC_CONT_EXPORT // VTKM_EXEC_CONT
// operator T() const // operator T() const
// { // {
// return this->Components[0]; // return this->Components[0];
@ -699,13 +699,13 @@ class Vec<T,2> : public detail::VecBase<T, 2, Vec<T,2> >
typedef detail::VecBase<T, 2, Vec<T,2> > Superclass; typedef detail::VecBase<T, 2, Vec<T,2> > Superclass;
public: public:
VTKM_EXEC_CONT_EXPORT Vec() {} VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { } VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
template<typename OtherType> template<typename OtherType>
VTKM_EXEC_CONT_EXPORT Vec(const Vec<OtherType, 2> &src) : Superclass(src) { } VTKM_EXEC_CONT Vec(const Vec<OtherType, 2> &src) : Superclass(src) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Vec(const T &x, const T &y) Vec(const T &x, const T &y)
{ {
this->Components[0] = x; this->Components[0] = x;
@ -722,13 +722,13 @@ class Vec<T,3> : public detail::VecBase<T, 3, Vec<T,3> >
{ {
typedef detail::VecBase<T, 3, Vec<T,3> > Superclass; typedef detail::VecBase<T, 3, Vec<T,3> > Superclass;
public: public:
VTKM_EXEC_CONT_EXPORT Vec() {} VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { } VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
template<typename OtherType> template<typename OtherType>
VTKM_EXEC_CONT_EXPORT Vec(const Vec<OtherType, 3> &src) : Superclass(src) { } VTKM_EXEC_CONT Vec(const Vec<OtherType, 3> &src) : Superclass(src) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Vec(const T &x, const T &y, const T &z) Vec(const T &x, const T &y, const T &z)
{ {
this->Components[0] = x; this->Components[0] = x;
@ -747,13 +747,13 @@ class Vec<T,4> : public detail::VecBase<T, 4, Vec<T,4> >
{ {
typedef detail::VecBase<T, 4, Vec<T,4> > Superclass; typedef detail::VecBase<T, 4, Vec<T,4> > Superclass;
public: public:
VTKM_EXEC_CONT_EXPORT Vec() {} VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { } VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
template<typename OtherType> template<typename OtherType>
VTKM_EXEC_CONT_EXPORT Vec(const Vec<OtherType, 4> &src) : Superclass(src) { } VTKM_EXEC_CONT Vec(const Vec<OtherType, 4> &src) : Superclass(src) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
Vec(const T &x, const T &y, const T &z, const T &w) Vec(const T &x, const T &y, const T &z, const T &w)
{ {
this->Components[0] = x; this->Components[0] = x;
@ -781,7 +781,7 @@ struct VecOrScalar<ComponentType, 1>
/// Initializes and returns a Vec of length 2. /// Initializes and returns a Vec of length 2.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,2> make_Vec(const T &x, const T &y) vtkm::Vec<T,2> make_Vec(const T &x, const T &y)
{ {
return vtkm::Vec<T,2>(x, y); return vtkm::Vec<T,2>(x, y);
@ -790,7 +790,7 @@ vtkm::Vec<T,2> make_Vec(const T &x, const T &y)
/// Initializes and returns a Vec of length 3. /// Initializes and returns a Vec of length 3.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> make_Vec(const T &x, const T &y, const T &z) vtkm::Vec<T,3> make_Vec(const T &x, const T &y, const T &z)
{ {
return vtkm::Vec<T,3>(x, y, z); return vtkm::Vec<T,3>(x, y, z);
@ -799,7 +799,7 @@ vtkm::Vec<T,3> make_Vec(const T &x, const T &y, const T &z)
/// Initializes and returns a Vec of length 4. /// Initializes and returns a Vec of length 4.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,4> make_Vec(const T &x, const T &y, const T &z, const T &w) vtkm::Vec<T,4> make_Vec(const T &x, const T &y, const T &z, const T &w)
{ {
return vtkm::Vec<T,4>(x, y, z, w); return vtkm::Vec<T,4>(x, y, z, w);
@ -811,7 +811,8 @@ template<typename U, typename V>
struct Pair; struct Pair;
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT static inline
VTKM_EXEC_CONT
T dot(const vtkm::Vec<T,Size> &a, const vtkm::Vec<T,Size> &b) T dot(const vtkm::Vec<T,Size> &a, const vtkm::Vec<T,Size> &b)
{ {
T result = T(a[0] * b[0]); T result = T(a[0] * b[0]);
@ -823,28 +824,31 @@ T dot(const vtkm::Vec<T,Size> &a, const vtkm::Vec<T,Size> &b)
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline
VTKM_EXEC_CONT
T dot(const vtkm::Vec<T,2> &a, const vtkm::Vec<T,2> &b) T dot(const vtkm::Vec<T,2> &a, const vtkm::Vec<T,2> &b)
{ {
return T((a[0]*b[0]) + (a[1]*b[1])); return T((a[0]*b[0]) + (a[1]*b[1]));
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT static inline
VTKM_EXEC_CONT
T dot(const vtkm::Vec<T,3> &a, const vtkm::Vec<T,3> &b) T dot(const vtkm::Vec<T,3> &a, const vtkm::Vec<T,3> &b)
{ {
return T((a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2])); return T((a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]));
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T static inline
VTKM_EXEC_CONT T
dot(const vtkm::Vec<T, 4>& a, const vtkm::Vec<T, 4>& b) dot(const vtkm::Vec<T, 4>& a, const vtkm::Vec<T, 4>& b)
{ {
return T((a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3])); return T((a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]));
} }
template <typename T, vtkm::IdComponent Size> template <typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, Size>& a) ReduceSum(const vtkm::Vec<T, Size>& a)
{ {
T result = a[0]; T result = a[0];
@ -856,28 +860,28 @@ ReduceSum(const vtkm::Vec<T, Size>& a)
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, 2>& a) ReduceSum(const vtkm::Vec<T, 2>& a)
{ {
return a[0] + a[1]; return a[0] + a[1];
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, 3>& a) ReduceSum(const vtkm::Vec<T, 3>& a)
{ {
return a[0] + a[1] + a[2]; return a[0] + a[1] + a[2];
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, 4>& a) ReduceSum(const vtkm::Vec<T, 4>& a)
{ {
return a[0] + a[1] + a[2] + a[3]; return a[0] + a[1] + a[2] + a[3];
} }
template <typename T, vtkm::IdComponent Size> template <typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, Size>& a) ReduceProduct(const vtkm::Vec<T, Size>& a)
{ {
T result = a[0]; T result = a[0];
@ -889,21 +893,21 @@ ReduceProduct(const vtkm::Vec<T, Size>& a)
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, 2>& a) ReduceProduct(const vtkm::Vec<T, 2>& a)
{ {
return a[0] * a[1]; return a[0] * a[1];
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, 3>& a) ReduceProduct(const vtkm::Vec<T, 3>& a)
{ {
return a[0] * a[1] * a[2]; return a[0] * a[1] * a[2];
} }
template <typename T> template <typename T>
VTKM_EXEC_CONT_EXPORT T VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, 4>& a) ReduceProduct(const vtkm::Vec<T, 4>& a)
{ {
return a[0] * a[1] * a[2] * a[3]; return a[0] * a[1] * a[2] * a[3];
@ -912,7 +916,8 @@ ReduceProduct(const vtkm::Vec<T, 4>& a)
// Integer types of a width less than an integer get implicitly casted to // Integer types of a width less than an integer get implicitly casted to
// an integer when doing a multiplication. // an integer when doing a multiplication.
#define VTK_M_INTEGER_PROMOTION_SCALAR_DOT(type) \ #define VTK_M_INTEGER_PROMOTION_SCALAR_DOT(type) \
VTKM_EXEC_CONT_EXPORT type dot(type a, type b) \ static inline \
VTKM_EXEC_CONT type dot(type a, type b) \
{ \ { \
return static_cast<type>(a * b); \ return static_cast<type>(a * b); \
} }
@ -921,7 +926,8 @@ VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::UInt8)
VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::Int16) VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::Int16)
VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::UInt16) VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::UInt16)
#define VTK_M_SCALAR_DOT(type) \ #define VTK_M_SCALAR_DOT(type) \
VTKM_EXEC_CONT_EXPORT type dot(type a, type b) \ static inline \
VTKM_EXEC_CONT type dot(type a, type b) \
{ \ { \
return a * b; \ return a * b; \
} }
@ -937,7 +943,7 @@ VTK_M_SCALAR_DOT(vtkm::Float64)
// Declared outside of vtkm namespace so that the operator works with all code. // Declared outside of vtkm namespace so that the operator works with all code.
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, Size> operator*(T scalar, const vtkm::Vec<T, Size> &vec) vtkm::Vec<T, Size> operator*(T scalar, const vtkm::Vec<T, Size> &vec)
{ {
return vtkm::internal::VecComponentWiseUnaryOperation<Size>()( return vtkm::internal::VecComponentWiseUnaryOperation<Size>()(
@ -946,7 +952,7 @@ vtkm::Vec<T, Size> operator*(T scalar, const vtkm::Vec<T, Size> &vec)
} }
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, Size> operator*(const vtkm::Vec<T, Size> &vec, T scalar) vtkm::Vec<T, Size> operator*(const vtkm::Vec<T, Size> &vec, T scalar)
{ {
return vtkm::internal::VecComponentWiseUnaryOperation<Size>()( return vtkm::internal::VecComponentWiseUnaryOperation<Size>()(
@ -955,7 +961,7 @@ vtkm::Vec<T, Size> operator*(const vtkm::Vec<T, Size> &vec, T scalar)
} }
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, Size> vtkm::Vec<T, Size>
operator*(vtkm::Float64 scalar, const vtkm::Vec<T, Size> &vec) operator*(vtkm::Float64 scalar, const vtkm::Vec<T, Size> &vec)
{ {
@ -967,7 +973,7 @@ operator*(vtkm::Float64 scalar, const vtkm::Vec<T, Size> &vec)
} }
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, Size> vtkm::Vec<T, Size>
operator*(const vtkm::Vec<T, Size> &vec, vtkm::Float64 scalar) operator*(const vtkm::Vec<T, Size> &vec, vtkm::Float64 scalar)
{ {
@ -979,7 +985,7 @@ operator*(const vtkm::Vec<T, Size> &vec, vtkm::Float64 scalar)
} }
template<vtkm::IdComponent Size> template<vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64, Size> vtkm::Vec<vtkm::Float64, Size>
operator*(vtkm::Float64 scalar, const vtkm::Vec<vtkm::Float64, Size> &vec) operator*(vtkm::Float64 scalar, const vtkm::Vec<vtkm::Float64, Size> &vec)
{ {
@ -990,7 +996,7 @@ operator*(vtkm::Float64 scalar, const vtkm::Vec<vtkm::Float64, Size> &vec)
} }
template<vtkm::IdComponent Size> template<vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64, Size> vtkm::Vec<vtkm::Float64, Size>
operator*(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar) operator*(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar)
{ {
@ -1001,7 +1007,7 @@ operator*(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar)
} }
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, Size> operator/(const vtkm::Vec<T, Size> &vec, T scalar) vtkm::Vec<T, Size> operator/(const vtkm::Vec<T, Size> &vec, T scalar)
{ {
return vtkm::internal::VecComponentWiseUnaryOperation<Size>()( return vtkm::internal::VecComponentWiseUnaryOperation<Size>()(
@ -1010,7 +1016,7 @@ vtkm::Vec<T, Size> operator/(const vtkm::Vec<T, Size> &vec, T scalar)
} }
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T, Size> vtkm::Vec<T, Size>
operator/(const vtkm::Vec<T, Size> &vec, vtkm::Float64 scalar) operator/(const vtkm::Vec<T, Size> &vec, vtkm::Float64 scalar)
{ {
@ -1022,7 +1028,7 @@ operator/(const vtkm::Vec<T, Size> &vec, vtkm::Float64 scalar)
} }
template<vtkm::IdComponent Size> template<vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64, Size> vtkm::Vec<vtkm::Float64, Size>
operator/(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar) operator/(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar)
{ {
@ -1037,7 +1043,7 @@ operator/(const vtkm::Vec<vtkm::Float64, Size> &vec, vtkm::Float64 scalar)
// also allow other types like Vec<Vec<unsigned> >. If necessary, we could // also allow other types like Vec<Vec<unsigned> >. If necessary, we could
// change this implementation to be more inclusive. // change this implementation to be more inclusive.
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename std::enable_if< typename std::enable_if<
(std::is_floating_point<T>::value || std::is_signed<T>::value), (std::is_floating_point<T>::value || std::is_signed<T>::value),
vtkm::Vec<T,Size> vtkm::Vec<T,Size>
@ -1051,7 +1057,7 @@ operator-(const vtkm::Vec<T,Size> &x)
/// Helper function for printing out vectors during testing. /// Helper function for printing out vectors during testing.
/// ///
template<typename T, vtkm::IdComponent Size> template<typename T, vtkm::IdComponent Size>
VTKM_CONT_EXPORT VTKM_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Vec<T,Size> &vec) std::ostream &operator<<(std::ostream &stream, const vtkm::Vec<T,Size> &vec)
{ {
stream << "["; stream << "[";
@ -1065,7 +1071,7 @@ std::ostream &operator<<(std::ostream &stream, const vtkm::Vec<T,Size> &vec)
/// Helper function for printing out pairs during testing. /// Helper function for printing out pairs during testing.
/// ///
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Pair<T,U> &vec) std::ostream &operator<<(std::ostream &stream, const vtkm::Pair<T,U> &vec)
{ {
return stream << "[" << vec.first << "," << vec.second << "]"; return stream << "[" << vec.first << "," << vec.second << "]";

@ -30,7 +30,7 @@ namespace vtkm {
struct IsZeroInitialized struct IsZeroInitialized
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T &x) const VTKM_EXEC_CONT bool operator()(const T &x) const
{ {
return (x == vtkm::TypeTraits<T>::ZeroInitialization() ); return (x == vtkm::TypeTraits<T>::ZeroInitialization() );
} }
@ -41,7 +41,7 @@ struct IsZeroInitialized
struct NotZeroInitialized struct NotZeroInitialized
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T &x) const VTKM_EXEC_CONT bool operator()(const T &x) const
{ {
return (x != vtkm::TypeTraits<T>::ZeroInitialization() ); return (x != vtkm::TypeTraits<T>::ZeroInitialization() );
} }
@ -54,7 +54,7 @@ struct NotZeroInitialized
struct LogicalNot struct LogicalNot
{ {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT bool operator()(const T& x) const VTKM_EXEC_CONT bool operator()(const T& x) const
{ {
return !x; return !x;
} }

@ -53,7 +53,7 @@ struct VecRectilinearPointCoordinatesNumComponents<3>
static const vtkm::IdComponent NUM_COMPONENTS = 8; static const vtkm::IdComponent NUM_COMPONENTS = 8;
}; };
VTKM_EXEC_CONSTANT_EXPORT VTKM_EXEC_CONSTANT
const vtkm::FloatDefault VecRectilinearPointCoordinatesOffsetTable[8][3] = { const vtkm::FloatDefault VecRectilinearPointCoordinatesOffsetTable[8][3] = {
{ 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f },
{ 1.0f, 0.0f, 0.0f }, { 1.0f, 0.0f, 0.0f },
@ -83,16 +83,16 @@ public:
static const vtkm::IdComponent NUM_COMPONENTS = static const vtkm::IdComponent NUM_COMPONENTS =
detail::VecRectilinearPointCoordinatesNumComponents<NumDimensions>::NUM_COMPONENTS; detail::VecRectilinearPointCoordinatesNumComponents<NumDimensions>::NUM_COMPONENTS;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
VecRectilinearPointCoordinates(ComponentType origin = ComponentType(0,0,0), VecRectilinearPointCoordinates(ComponentType origin = ComponentType(0,0,0),
ComponentType spacing = ComponentType(1,1,1)) ComponentType spacing = ComponentType(1,1,1))
: Origin(origin), Spacing(spacing) { } : Origin(origin), Spacing(spacing) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::IdComponent GetNumberOfComponents() const { return NUM_COMPONENTS; } vtkm::IdComponent GetNumberOfComponents() const { return NUM_COMPONENTS; }
template<vtkm::IdComponent DestSize> template<vtkm::IdComponent DestSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void CopyInto(vtkm::Vec<ComponentType,DestSize> &dest) const void CopyInto(vtkm::Vec<ComponentType,DestSize> &dest) const
{ {
vtkm::IdComponent numComponents = vtkm::IdComponent numComponents =
@ -103,7 +103,7 @@ public:
} }
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType operator[](vtkm::IdComponent index) const ComponentType operator[](vtkm::IdComponent index) const
{ {
const vtkm::FloatDefault *offset = const vtkm::FloatDefault *offset =
@ -113,10 +113,10 @@ public:
this->Origin[2] + offset[2]*this->Spacing[2]); this->Origin[2] + offset[2]*this->Spacing[2]);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ComponentType &GetOrigin() const { return this->Origin; } const ComponentType &GetOrigin() const { return this->Origin; }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ComponentType &GetSpacing() const { return this->Spacing; } const ComponentType &GetSpacing() const { return this->Spacing; }
private: private:
@ -133,7 +133,7 @@ struct TypeTraits<vtkm::VecRectilinearPointCoordinates<NumDimensions> >
typedef vtkm::TypeTraitsRealTag NumericTag; typedef vtkm::TypeTraitsRealTag NumericTag;
typedef TypeTraitsVectorTag DimensionalityTag; typedef TypeTraitsVectorTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::VecRectilinearPointCoordinates<NumDimensions> static vtkm::VecRectilinearPointCoordinates<NumDimensions>
ZeroInitialization() ZeroInitialization()
{ {
@ -154,12 +154,12 @@ struct VecTraits<vtkm::VecRectilinearPointCoordinates<NumDimensions> >
static const vtkm::IdComponent NUM_COMPONENTS = VecType::NUM_COMPONENTS; static const vtkm::IdComponent NUM_COMPONENTS = VecType::NUM_COMPONENTS;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::IdComponent GetNumberOfComponents(const VecType &) { static vtkm::IdComponent GetNumberOfComponents(const VecType &) {
return NUM_COMPONENTS; return NUM_COMPONENTS;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static ComponentType GetComponent(const VecType &vector, static ComponentType GetComponent(const VecType &vector,
vtkm::IdComponent componentIndex) vtkm::IdComponent componentIndex)
{ {
@ -167,7 +167,7 @@ struct VecTraits<vtkm::VecRectilinearPointCoordinates<NumDimensions> >
} }
template<vtkm::IdComponent destSize> template<vtkm::IdComponent destSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void CopyInto(const VecType &src, static void CopyInto(const VecType &src,
vtkm::Vec<ComponentType,destSize> &dest) vtkm::Vec<ComponentType,destSize> &dest)
{ {

@ -98,23 +98,23 @@ struct VecTraits
/// Returns the value in a given component of the vector. /// Returns the value in a given component of the vector.
/// ///
VTKM_EXEC_CONT_EXPORT static const ComponentType &GetComponent( VTKM_EXEC_CONT static const ComponentType &GetComponent(
const typename std::remove_const<VecType>::type &vector, const typename std::remove_const<VecType>::type &vector,
vtkm::IdComponent component); vtkm::IdComponent component);
VTKM_EXEC_CONT_EXPORT static ComponentType &GetComponent( VTKM_EXEC_CONT static ComponentType &GetComponent(
typename std::remove_const<VecType>::type &vector, typename std::remove_const<VecType>::type &vector,
vtkm::IdComponent component); vtkm::IdComponent component);
/// Changes the value in a given component of the vector. /// Changes the value in a given component of the vector.
/// ///
VTKM_EXEC_CONT_EXPORT static void SetComponent(VecType &vector, VTKM_EXEC_CONT static void SetComponent(VecType &vector,
vtkm::IdComponent component, vtkm::IdComponent component,
ComponentType value); ComponentType value);
/// Copies the components in the given vector into a given Vec object. /// Copies the components in the given vector into a given Vec object.
/// ///
template<vktm::IdComponent destSize> template<vktm::IdComponent destSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void static void
CopyInto(const VecType &src, vtkm::Vec<ComponentType,destSize> &dest); CopyInto(const VecType &src, vtkm::Vec<ComponentType,destSize> &dest);
}; };
@ -144,7 +144,7 @@ struct VecTraits<vtkm::Vec<T,Size> >
/// Number of components in the given vector. /// Number of components in the given vector.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::IdComponent GetNumberOfComponents(const VecType &) { static vtkm::IdComponent GetNumberOfComponents(const VecType &) {
return NUM_COMPONENTS; return NUM_COMPONENTS;
} }
@ -166,20 +166,20 @@ struct VecTraits<vtkm::Vec<T,Size> >
/// Returns the value in a given component of the vector. /// Returns the value in a given component of the vector.
/// ///
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static const ComponentType &GetComponent(const VecType &vector, static const ComponentType &GetComponent(const VecType &vector,
vtkm::IdComponent component) vtkm::IdComponent component)
{ {
return vector[component]; return vector[component];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static ComponentType &GetComponent(VecType &vector, vtkm::IdComponent component) { static ComponentType &GetComponent(VecType &vector, vtkm::IdComponent component) {
return vector[component]; return vector[component];
} }
/// Changes the value in a given component of the vector. /// Changes the value in a given component of the vector.
/// ///
VTKM_EXEC_CONT_EXPORT static void SetComponent(VecType &vector, VTKM_EXEC_CONT static void SetComponent(VecType &vector,
vtkm::IdComponent component, vtkm::IdComponent component,
ComponentType value) { ComponentType value) {
vector[component] = value; vector[component] = value;
@ -188,7 +188,7 @@ struct VecTraits<vtkm::Vec<T,Size> >
/// Converts whatever type this vector is into the standard VTKm Tuple. /// Converts whatever type this vector is into the standard VTKm Tuple.
/// ///
template<vtkm::IdComponent destSize> template<vtkm::IdComponent destSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void static void
CopyInto(const VecType &src, vtkm::Vec<ComponentType,destSize> &dest) CopyInto(const VecType &src, vtkm::Vec<ComponentType,destSize> &dest)
{ {
@ -206,30 +206,30 @@ struct VecTraitsBasic {
typedef VecTraitsTagSingleComponent HasMultipleComponents; typedef VecTraitsTagSingleComponent HasMultipleComponents;
typedef vtkm::VecTraitsTagSizeStatic IsSizeStatic; typedef vtkm::VecTraitsTagSizeStatic IsSizeStatic;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::IdComponent GetNumberOfComponents(const ScalarType &) { static vtkm::IdComponent GetNumberOfComponents(const ScalarType &) {
return 1; return 1;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static const ComponentType &GetComponent( static const ComponentType &GetComponent(
const ScalarType &vector, const ScalarType &vector,
vtkm::IdComponent) { vtkm::IdComponent) {
return vector; return vector;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static ComponentType &GetComponent(ScalarType &vector, vtkm::IdComponent) { static ComponentType &GetComponent(ScalarType &vector, vtkm::IdComponent) {
return vector; return vector;
} }
VTKM_EXEC_CONT_EXPORT static void SetComponent(ScalarType &vector, VTKM_EXEC_CONT static void SetComponent(ScalarType &vector,
vtkm::IdComponent, vtkm::IdComponent,
ComponentType value) { ComponentType value) {
vector = value; vector = value;
} }
template<vtkm::IdComponent destSize> template<vtkm::IdComponent destSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void CopyInto(const ScalarType &src, static void CopyInto(const ScalarType &src,
vtkm::Vec<ScalarType,destSize> &dest) vtkm::Vec<ScalarType,destSize> &dest)
{ {

@ -41,11 +41,11 @@ class VecVariable
public: public:
typedef T ComponentType; typedef T ComponentType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
VecVariable() : NumComponents(0) { } VecVariable() : NumComponents(0) { }
template<vtkm::IdComponent SrcSize> template<vtkm::IdComponent SrcSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
VecVariable(const vtkm::VecVariable<ComponentType,SrcSize> &src) VecVariable(const vtkm::VecVariable<ComponentType,SrcSize> &src)
: NumComponents(src.GetNumberOfComponents()) : NumComponents(src.GetNumberOfComponents())
{ {
@ -57,7 +57,7 @@ public:
} }
template<vtkm::IdComponent SrcSize> template<vtkm::IdComponent SrcSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
VecVariable(const vtkm::Vec<ComponentType,SrcSize> &src) VecVariable(const vtkm::Vec<ComponentType,SrcSize> &src)
: NumComponents(SrcSize) : NumComponents(SrcSize)
{ {
@ -68,13 +68,13 @@ public:
} }
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::IdComponent GetNumberOfComponents() const { vtkm::IdComponent GetNumberOfComponents() const {
return this->NumComponents; return this->NumComponents;
} }
template<vtkm::IdComponent DestSize> template<vtkm::IdComponent DestSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void CopyInto(vtkm::Vec<ComponentType,DestSize> &dest) const void CopyInto(vtkm::Vec<ComponentType,DestSize> &dest) const
{ {
vtkm::IdComponent numComponents = vtkm::Min(DestSize, this->NumComponents); vtkm::IdComponent numComponents = vtkm::Min(DestSize, this->NumComponents);
@ -84,19 +84,19 @@ public:
} }
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ComponentType &operator[](vtkm::IdComponent index) const const ComponentType &operator[](vtkm::IdComponent index) const
{ {
return this->Data[index]; return this->Data[index];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ComponentType &operator[](vtkm::IdComponent index) ComponentType &operator[](vtkm::IdComponent index)
{ {
return this->Data[index]; return this->Data[index];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Append(ComponentType value) void Append(ComponentType value)
{ {
VTKM_ASSERT(this->NumComponents < MaxSize); VTKM_ASSERT(this->NumComponents < MaxSize);
@ -115,7 +115,7 @@ struct TypeTraits<vtkm::VecVariable<T,MaxSize> >
typedef typename vtkm::TypeTraits<T>::NumericTag NumericTag; typedef typename vtkm::TypeTraits<T>::NumericTag NumericTag;
typedef TypeTraitsVectorTag DimensionalityTag; typedef TypeTraitsVectorTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::VecVariable<T,MaxSize> ZeroInitialization() static vtkm::VecVariable<T,MaxSize> ZeroInitialization()
{ {
return vtkm::VecVariable<T,MaxSize>(); return vtkm::VecVariable<T,MaxSize>();
@ -131,25 +131,25 @@ struct VecTraits<vtkm::VecVariable<T,MaxSize> >
typedef vtkm::VecTraitsTagMultipleComponents HasMultipleComponents; typedef vtkm::VecTraitsTagMultipleComponents HasMultipleComponents;
typedef vtkm::VecTraitsTagSizeVariable IsSizeStatic; typedef vtkm::VecTraitsTagSizeVariable IsSizeStatic;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static vtkm::IdComponent GetNumberOfComponents(const VecType &vector) { static vtkm::IdComponent GetNumberOfComponents(const VecType &vector) {
return vector.GetNumberOfComponents(); return vector.GetNumberOfComponents();
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static const ComponentType &GetComponent(const VecType &vector, static const ComponentType &GetComponent(const VecType &vector,
vtkm::IdComponent componentIndex) vtkm::IdComponent componentIndex)
{ {
return vector[componentIndex]; return vector[componentIndex];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static ComponentType &GetComponent(VecType &vector, static ComponentType &GetComponent(VecType &vector,
vtkm::IdComponent componentIndex) vtkm::IdComponent componentIndex)
{ {
return vector[componentIndex]; return vector[componentIndex];
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void SetComponent(VecType &vector, static void SetComponent(VecType &vector,
vtkm::IdComponent componentIndex, vtkm::IdComponent componentIndex,
const ComponentType &value) const ComponentType &value)
@ -158,7 +158,7 @@ struct VecTraits<vtkm::VecVariable<T,MaxSize> >
} }
template<vtkm::IdComponent destSize> template<vtkm::IdComponent destSize>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
static void CopyInto(const VecType &src, static void CopyInto(const VecType &src,
vtkm::Vec<ComponentType,destSize> &dest) vtkm::Vec<ComponentType,destSize> &dest)
{ {

@ -41,7 +41,7 @@ namespace vtkm {
/// extrapolates. If w=0 => v0 is returned if w=1 => v1 is returned. /// extrapolates. If w=0 => v0 is returned if w=1 => v1 is returned.
/// ///
template<typename ValueType, typename WeightType> template<typename ValueType, typename WeightType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Lerp(const ValueType &value0, ValueType Lerp(const ValueType &value0,
const ValueType &value1, const ValueType &value1,
const WeightType &weight) const WeightType &weight)
@ -49,7 +49,7 @@ ValueType Lerp(const ValueType &value0,
return static_cast<ValueType>((WeightType(1)-weight)*value0+weight*value1); return static_cast<ValueType>((WeightType(1)-weight)*value0+weight*value1);
} }
template<typename ValueType, vtkm::IdComponent N, typename WeightType> template<typename ValueType, vtkm::IdComponent N, typename WeightType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<ValueType,N> Lerp(const vtkm::Vec<ValueType,N> &value0, vtkm::Vec<ValueType,N> Lerp(const vtkm::Vec<ValueType,N> &value0,
const vtkm::Vec<ValueType,N> &value1, const vtkm::Vec<ValueType,N> &value1,
const WeightType &weight) const WeightType &weight)
@ -57,7 +57,7 @@ vtkm::Vec<ValueType,N> Lerp(const vtkm::Vec<ValueType,N> &value0,
return (WeightType(1)-weight)*value0+weight*value1; return (WeightType(1)-weight)*value0+weight*value1;
} }
template<typename ValueType, vtkm::IdComponent N> template<typename ValueType, vtkm::IdComponent N>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<ValueType,N> Lerp(const vtkm::Vec<ValueType,N> &value0, vtkm::Vec<ValueType,N> Lerp(const vtkm::Vec<ValueType,N> &value0,
const vtkm::Vec<ValueType,N> &value1, const vtkm::Vec<ValueType,N> &value1,
const vtkm::Vec<ValueType,N> &weight) const vtkm::Vec<ValueType,N> &weight)
@ -74,7 +74,7 @@ vtkm::Vec<ValueType,N> Lerp(const vtkm::Vec<ValueType,N> &value0,
/// when possible. /// when possible.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::VecTraits<T>::ComponentType typename vtkm::VecTraits<T>::ComponentType
MagnitudeSquared(const T &x) MagnitudeSquared(const T &x)
{ {
@ -84,14 +84,14 @@ MagnitudeSquared(const T &x)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
namespace detail { namespace detail {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T MagnitudeTemplate(T x, vtkm::TypeTraitsScalarTag) T MagnitudeTemplate(T x, vtkm::TypeTraitsScalarTag)
{ {
return vtkm::Abs(x); return vtkm::Abs(x);
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::VecTraits<T>::ComponentType typename vtkm::VecTraits<T>::ComponentType
MagnitudeTemplate(const T &x, vtkm::TypeTraitsVectorTag) MagnitudeTemplate(const T &x, vtkm::TypeTraitsVectorTag)
{ {
@ -108,7 +108,7 @@ MagnitudeTemplate(const T &x, vtkm::TypeTraitsVectorTag)
/// actually plan to divide by the magnitude. /// actually plan to divide by the magnitude.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::VecTraits<T>::ComponentType typename vtkm::VecTraits<T>::ComponentType
Magnitude(const T &x) Magnitude(const T &x)
{ {
@ -119,14 +119,14 @@ Magnitude(const T &x)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
namespace detail { namespace detail {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T RMagnitudeTemplate(T x, vtkm::TypeTraitsScalarTag) T RMagnitudeTemplate(T x, vtkm::TypeTraitsScalarTag)
{ {
return T(1)/vtkm::Abs(x); return T(1)/vtkm::Abs(x);
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::VecTraits<T>::ComponentType typename vtkm::VecTraits<T>::ComponentType
RMagnitudeTemplate(const T &x, vtkm::TypeTraitsVectorTag) RMagnitudeTemplate(const T &x, vtkm::TypeTraitsVectorTag)
{ {
@ -140,7 +140,7 @@ RMagnitudeTemplate(const T &x, vtkm::TypeTraitsVectorTag)
/// as fast as MagnitudeSquared. /// as fast as MagnitudeSquared.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::VecTraits<T>::ComponentType typename vtkm::VecTraits<T>::ComponentType
RMagnitude(const T &x) RMagnitude(const T &x)
{ {
@ -151,14 +151,14 @@ RMagnitude(const T &x)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
namespace detail { namespace detail {
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T NormalTemplate(T x, vtkm::TypeTraitsScalarTag) T NormalTemplate(T x, vtkm::TypeTraitsScalarTag)
{ {
return vtkm::CopySign(T(1), x); return vtkm::CopySign(T(1), x);
} }
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T NormalTemplate(const T &x, vtkm::TypeTraitsVectorTag) T NormalTemplate(const T &x, vtkm::TypeTraitsVectorTag)
{ {
return vtkm::RMagnitude(x)*x; return vtkm::RMagnitude(x)*x;
@ -170,7 +170,7 @@ T NormalTemplate(const T &x, vtkm::TypeTraitsVectorTag)
/// The resulting vector points in the same direction but has unit length. /// The resulting vector points in the same direction but has unit length.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
T Normal(const T &x) T Normal(const T &x)
{ {
return detail::NormalTemplate( return detail::NormalTemplate(
@ -183,7 +183,7 @@ T Normal(const T &x)
/// The given vector is scaled to be unit length. /// The given vector is scaled to be unit length.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Normalize(T &x) void Normalize(T &x)
{ {
x = vtkm::Normal(x); x = vtkm::Normal(x);
@ -193,7 +193,7 @@ void Normalize(T &x)
/// \brief Find the cross product of two vectors. /// \brief Find the cross product of two vectors.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> Cross(const vtkm::Vec<T,3> &x, const vtkm::Vec<T,3> &y) vtkm::Vec<T,3> Cross(const vtkm::Vec<T,3> &x, const vtkm::Vec<T,3> &y)
{ {
return vtkm::Vec<T,3>(x[1]*y[2] - x[2]*y[1], return vtkm::Vec<T,3>(x[1]*y[2] - x[2]*y[1],
@ -209,7 +209,7 @@ vtkm::Vec<T,3> Cross(const vtkm::Vec<T,3> &x, const vtkm::Vec<T,3> &y)
/// to that triangle/plane. /// to that triangle/plane.
/// ///
template<typename T> template<typename T>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Vec<T,3> TriangleNormal(const vtkm::Vec<T,3> &a, vtkm::Vec<T,3> TriangleNormal(const vtkm::Vec<T,3> &a,
const vtkm::Vec<T,3> &b, const vtkm::Vec<T,3> &b,
const vtkm::Vec<T,3> &c) const vtkm::Vec<T,3> &c)

@ -96,10 +96,10 @@ public:
PortalType Output; PortalType Output;
VTKM_CONT_EXPORT VTKM_CONT
FillTestValueKernel(PortalType out) : Output(out){} FillTestValueKernel(PortalType out) : Output(out){}
VTKM_EXEC_EXPORT void operator()(vtkm::Id i) const { VTKM_EXEC void operator()(vtkm::Id i) const {
Output.Set(i, TestValue(i, Value())); Output.Set(i, TestValue(i, Value()));
} }
}; };
@ -113,10 +113,10 @@ public:
PortalType Output; PortalType Output;
const vtkm::Id IdScale; const vtkm::Id IdScale;
VTKM_CONT_EXPORT VTKM_CONT
FillScaledTestValueKernel(vtkm::Id id_scale, PortalType out) : Output(out), IdScale(id_scale) {} FillScaledTestValueKernel(vtkm::Id id_scale, PortalType out) : Output(out), IdScale(id_scale) {}
VTKM_EXEC_EXPORT void operator()(vtkm::Id i) const { VTKM_EXEC void operator()(vtkm::Id i) const {
Output.Set(i, TestValue(i * IdScale, Value())); Output.Set(i, TestValue(i * IdScale, Value()));
} }
}; };
@ -130,10 +130,10 @@ public:
PortalType Output; PortalType Output;
const vtkm::Id Modulus; const vtkm::Id Modulus;
VTKM_CONT_EXPORT VTKM_CONT
FillModuloTestValueKernel(vtkm::Id modulus, PortalType out) : Output(out), Modulus(modulus) {} FillModuloTestValueKernel(vtkm::Id modulus, PortalType out) : Output(out), Modulus(modulus) {}
VTKM_EXEC_EXPORT void operator()(vtkm::Id i) const { VTKM_EXEC void operator()(vtkm::Id i) const {
Output.Set(i, TestValue(i % Modulus, Value())); Output.Set(i, TestValue(i % Modulus, Value()));
} }
}; };
@ -147,10 +147,10 @@ public:
PortalType Output; PortalType Output;
const vtkm::Id Modulus; const vtkm::Id Modulus;
VTKM_CONT_EXPORT VTKM_CONT
FillBinaryTestValueKernel(vtkm::Id modulus, PortalType out) : Output(out), Modulus(modulus) {} FillBinaryTestValueKernel(vtkm::Id modulus, PortalType out) : Output(out), Modulus(modulus) {}
VTKM_EXEC_EXPORT void operator()(vtkm::Id i) const { VTKM_EXEC void operator()(vtkm::Id i) const {
Output.Set(i, i % Modulus == 0 ? TestValue(vtkm::Id(1), Value()) : Value()); Output.Set(i, i % Modulus == 0 ? TestValue(vtkm::Id(1), Value()) : Value());
} }
}; };
@ -164,13 +164,13 @@ private:
ValueArrayHandle ValueHandle_dst; ValueArrayHandle ValueHandle_dst;
std::mt19937 Rng; std::mt19937 Rng;
VTKM_CONT_EXPORT VTKM_CONT
BenchCopy(){ BenchCopy(){
ValueHandle_src.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag()); ValueHandle_src.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag());
ValueHandle_dst.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag()); ValueHandle_dst.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
for (vtkm::Id i = 0; i < ValueHandle_src.GetNumberOfValues(); ++i){ for (vtkm::Id i = 0; i < ValueHandle_src.GetNumberOfValues(); ++i){
ValueHandle_src.GetPortalControl().Set(vtkm::Id(i), TestValue(vtkm::Id(Rng()), Value())); ValueHandle_src.GetPortalControl().Set(vtkm::Id(i), TestValue(vtkm::Id(Rng()), Value()));
@ -180,7 +180,7 @@ private:
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "Copy " << ARRAY_SIZE << " values"; description << "Copy " << ARRAY_SIZE << " values";
@ -197,7 +197,7 @@ private:
ValueArrayHandle InputHandle, ValueHandle; ValueArrayHandle InputHandle, ValueHandle;
IdArrayHandle OutHandle; IdArrayHandle OutHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchLowerBounds(vtkm::Id value_percent) : N_VALS((ARRAY_SIZE * value_percent) / 100) BenchLowerBounds(vtkm::Id value_percent) : N_VALS((ARRAY_SIZE * value_percent) / 100)
{ {
Algorithm::Schedule(FillTestValueKernel<Value>( Algorithm::Schedule(FillTestValueKernel<Value>(
@ -206,14 +206,14 @@ private:
ValueHandle.PrepareForOutput(N_VALS, DeviceAdapterTag())), N_VALS); ValueHandle.PrepareForOutput(N_VALS, DeviceAdapterTag())), N_VALS);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Timer timer; Timer timer;
Algorithm::LowerBounds(InputHandle, ValueHandle, OutHandle); Algorithm::LowerBounds(InputHandle, ValueHandle, OutHandle);
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "LowerBounds on " << ARRAY_SIZE << " input and " description << "LowerBounds on " << ARRAY_SIZE << " input and "
@ -234,20 +234,20 @@ private:
ValueArrayHandle InputHandle; ValueArrayHandle InputHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchReduce(){ BenchReduce(){
Algorithm::Schedule(FillTestValueKernel<Value>( Algorithm::Schedule(FillTestValueKernel<Value>(
InputHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE); InputHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Timer timer; Timer timer;
Algorithm::Reduce(InputHandle, Value()); Algorithm::Reduce(InputHandle, Value());
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "Reduce on " << ARRAY_SIZE << " values"; description << "Reduce on " << ARRAY_SIZE << " values";
@ -264,7 +264,7 @@ private:
ValueArrayHandle ValueHandle, ValuesOut; ValueArrayHandle ValueHandle, ValuesOut;
IdArrayHandle KeyHandle, KeysOut; IdArrayHandle KeyHandle, KeysOut;
VTKM_CONT_EXPORT VTKM_CONT
BenchReduceByKey(vtkm::Id key_percent) : N_KEYS((ARRAY_SIZE * key_percent) / 100) BenchReduceByKey(vtkm::Id key_percent) : N_KEYS((ARRAY_SIZE * key_percent) / 100)
{ {
Algorithm::Schedule(FillTestValueKernel<Value>( Algorithm::Schedule(FillTestValueKernel<Value>(
@ -274,7 +274,7 @@ private:
Algorithm::SortByKey(KeyHandle, ValueHandle); Algorithm::SortByKey(KeyHandle, ValueHandle);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Timer timer; Timer timer;
Algorithm::ReduceByKey(KeyHandle, ValueHandle, KeysOut, ValuesOut, Algorithm::ReduceByKey(KeyHandle, ValueHandle, KeysOut, ValuesOut,
@ -282,7 +282,7 @@ private:
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "ReduceByKey on " << ARRAY_SIZE description << "ReduceByKey on " << ARRAY_SIZE
@ -302,20 +302,20 @@ private:
typedef vtkm::cont::ArrayHandle<Value, StorageTag> ValueArrayHandle; typedef vtkm::cont::ArrayHandle<Value, StorageTag> ValueArrayHandle;
ValueArrayHandle ValueHandle, OutHandle; ValueArrayHandle ValueHandle, OutHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchScanInclusive(){ BenchScanInclusive(){
Algorithm::Schedule(FillTestValueKernel<Value>( Algorithm::Schedule(FillTestValueKernel<Value>(
ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE); ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Timer timer; Timer timer;
Algorithm::ScanInclusive(ValueHandle, OutHandle); Algorithm::ScanInclusive(ValueHandle, OutHandle);
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "ScanInclusive on " << ARRAY_SIZE << " values"; description << "ScanInclusive on " << ARRAY_SIZE << " values";
@ -330,20 +330,20 @@ private:
ValueArrayHandle ValueHandle, OutHandle; ValueArrayHandle ValueHandle, OutHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchScanExclusive(){ BenchScanExclusive(){
Algorithm::Schedule(FillTestValueKernel<Value>( Algorithm::Schedule(FillTestValueKernel<Value>(
ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE); ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Timer timer; Timer timer;
Algorithm::ScanExclusive(ValueHandle, OutHandle); Algorithm::ScanExclusive(ValueHandle, OutHandle);
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "ScanExclusive on " << ARRAY_SIZE << " values"; description << "ScanExclusive on " << ARRAY_SIZE << " values";
@ -359,12 +359,12 @@ private:
ValueArrayHandle ValueHandle; ValueArrayHandle ValueHandle;
std::mt19937 Rng; std::mt19937 Rng;
VTKM_CONT_EXPORT VTKM_CONT
BenchSort(){ BenchSort(){
ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag()); ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
for (vtkm::Id i = 0; i < ValueHandle.GetNumberOfValues(); ++i){ for (vtkm::Id i = 0; i < ValueHandle.GetNumberOfValues(); ++i){
ValueHandle.GetPortalControl().Set(vtkm::Id(i), TestValue(vtkm::Id(Rng()), Value())); ValueHandle.GetPortalControl().Set(vtkm::Id(i), TestValue(vtkm::Id(Rng()), Value()));
@ -374,7 +374,7 @@ private:
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "Sort on " << ARRAY_SIZE << " random values"; description << "Sort on " << ARRAY_SIZE << " random values";
@ -392,12 +392,12 @@ private:
ValueArrayHandle ValueHandle; ValueArrayHandle ValueHandle;
IdArrayHandle KeyHandle; IdArrayHandle KeyHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchSortByKey(vtkm::Id percent_key) : N_KEYS((ARRAY_SIZE * percent_key) / 100){ BenchSortByKey(vtkm::Id percent_key) : N_KEYS((ARRAY_SIZE * percent_key) / 100){
ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag()); ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
for (vtkm::Id i = 0; i < ValueHandle.GetNumberOfValues(); ++i){ for (vtkm::Id i = 0; i < ValueHandle.GetNumberOfValues(); ++i){
ValueHandle.GetPortalControl().Set(vtkm::Id(i), TestValue(vtkm::Id(Rng()), Value())); ValueHandle.GetPortalControl().Set(vtkm::Id(i), TestValue(vtkm::Id(Rng()), Value()));
@ -409,7 +409,7 @@ private:
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "SortByKey on " << ARRAY_SIZE description << "SortByKey on " << ARRAY_SIZE
@ -432,7 +432,7 @@ private:
ValueArrayHandle ValueHandle; ValueArrayHandle ValueHandle;
IdArrayHandle OutHandle; IdArrayHandle OutHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchStreamCompact(vtkm::Id percent_valid) : N_VALID((ARRAY_SIZE * percent_valid) / 100) BenchStreamCompact(vtkm::Id percent_valid) : N_VALID((ARRAY_SIZE * percent_valid) / 100)
{ {
vtkm::Id modulo = ARRAY_SIZE / N_VALID; vtkm::Id modulo = ARRAY_SIZE / N_VALID;
@ -440,14 +440,14 @@ private:
ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE); ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() { vtkm::Float64 operator()() {
Timer timer; Timer timer;
Algorithm::StreamCompact(ValueHandle, OutHandle); Algorithm::StreamCompact(ValueHandle, OutHandle);
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "StreamCompact on " << ARRAY_SIZE << " " description << "StreamCompact on " << ARRAY_SIZE << " "
@ -471,7 +471,7 @@ private:
ValueArrayHandle ValueHandle; ValueArrayHandle ValueHandle;
IdArrayHandle StencilHandle, OutHandle; IdArrayHandle StencilHandle, OutHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchStreamCompactStencil(vtkm::Id percent_valid) : N_VALID((ARRAY_SIZE * percent_valid) / 100) BenchStreamCompactStencil(vtkm::Id percent_valid) : N_VALID((ARRAY_SIZE * percent_valid) / 100)
{ {
vtkm::Id modulo = ARRAY_SIZE / N_VALID; vtkm::Id modulo = ARRAY_SIZE / N_VALID;
@ -481,14 +481,14 @@ private:
StencilHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE); StencilHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() { vtkm::Float64 operator()() {
Timer timer; Timer timer;
Algorithm::StreamCompact(ValueHandle, StencilHandle, OutHandle); Algorithm::StreamCompact(ValueHandle, StencilHandle, OutHandle);
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "StreamCompactStencil on " << ARRAY_SIZE << " " description << "StreamCompactStencil on " << ARRAY_SIZE << " "
@ -511,11 +511,11 @@ private:
const vtkm::Id N_VALID; const vtkm::Id N_VALID;
ValueArrayHandle ValueHandle; ValueArrayHandle ValueHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchUnique(vtkm::Id percent_valid) : N_VALID((ARRAY_SIZE * percent_valid) / 100) BenchUnique(vtkm::Id percent_valid) : N_VALID((ARRAY_SIZE * percent_valid) / 100)
{} {}
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Algorithm::Schedule(FillModuloTestValueKernel<Value>(N_VALID, Algorithm::Schedule(FillModuloTestValueKernel<Value>(N_VALID,
ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE); ValueHandle.PrepareForOutput(ARRAY_SIZE, DeviceAdapterTag())), ARRAY_SIZE);
@ -525,7 +525,7 @@ private:
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "Unique on " << ARRAY_SIZE << " values with " description << "Unique on " << ARRAY_SIZE << " values with "
@ -548,7 +548,7 @@ private:
ValueArrayHandle InputHandle, ValueHandle; ValueArrayHandle InputHandle, ValueHandle;
IdArrayHandle OutHandle; IdArrayHandle OutHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchUpperBounds(vtkm::Id percent_vals) : N_VALS((ARRAY_SIZE * percent_vals) / 100) BenchUpperBounds(vtkm::Id percent_vals) : N_VALS((ARRAY_SIZE * percent_vals) / 100)
{ {
Algorithm::Schedule(FillTestValueKernel<Value>( Algorithm::Schedule(FillTestValueKernel<Value>(
@ -557,14 +557,14 @@ private:
ValueHandle.PrepareForOutput(N_VALS, DeviceAdapterTag())), N_VALS); ValueHandle.PrepareForOutput(N_VALS, DeviceAdapterTag())), N_VALS);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()(){ vtkm::Float64 operator()(){
Timer timer; Timer timer;
Algorithm::UpperBounds(InputHandle, ValueHandle, OutHandle); Algorithm::UpperBounds(InputHandle, ValueHandle, OutHandle);
return timer.GetElapsedTime(); return timer.GetElapsedTime();
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "UpperBounds on " << ARRAY_SIZE << " input and " description << "UpperBounds on " << ARRAY_SIZE << " input and "
@ -587,7 +587,7 @@ public:
vtkm::Float64, vtkm::Vec<vtkm::Float64, 3>, vtkm::Float64, vtkm::Vec<vtkm::Float64, 3>,
vtkm::Vec<vtkm::Float32, 4> >{}; vtkm::Vec<vtkm::Float32, 4> >{};
static VTKM_CONT_EXPORT int Run(int benchmarks){ static VTKM_CONT int Run(int benchmarks){
std::cout << DIVIDER << "\nRunning DeviceAdapter benchmarks\n"; std::cout << DIVIDER << "\nRunning DeviceAdapter benchmarks\n";
if (benchmarks & COPY) { if (benchmarks & COPY) {

@ -73,7 +73,7 @@ public:
{ {
} }
VTKM_EXEC_EXPORT VTKM_EXEC
T CumulativeNormalDistribution(T d) const T CumulativeNormalDistribution(T d) const
{ {
const vtkm::Float32 A1 = 0.31938153f; const vtkm::Float32 A1 = 0.31938153f;
@ -98,7 +98,7 @@ public:
} }
template <typename U, typename V, typename W> template <typename U, typename V, typename W>
VTKM_EXEC_EXPORT void operator()(const U& sp, const V& os, const W& oy, VTKM_EXEC void operator()(const U& sp, const V& os, const W& oy,
T& callResult, T& putResult) const T& callResult, T& putResult) const
{ {
const T stockPrice = static_cast<T>(sp); const T stockPrice = static_cast<T>(sp);
@ -129,7 +129,7 @@ public:
typedef void ExecutionSignature(_1,_2); typedef void ExecutionSignature(_1,_2);
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Vec<T,3>& vec, U& result) const void operator()(const vtkm::Vec<T,3>& vec, U& result) const
{ {
result = static_cast<U>(vtkm::Magnitude(vec)); result = static_cast<U>(vtkm::Magnitude(vec));
@ -143,7 +143,7 @@ public:
typedef void ExecutionSignature(_1,_2); typedef void ExecutionSignature(_1,_2);
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(T input, U& output) const void operator()(T input, U& output) const
{ {
output = static_cast<U>(input * input); output = static_cast<U>(input * input);
@ -157,7 +157,7 @@ public:
typedef void ExecutionSignature(_1,_2); typedef void ExecutionSignature(_1,_2);
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(T input, U& output) const void operator()(T input, U& output) const
{ {
output = static_cast<U>(vtkm::Sin(input)); output = static_cast<U>(vtkm::Sin(input));
@ -171,7 +171,7 @@ public:
typedef void ExecutionSignature(_1,_2); typedef void ExecutionSignature(_1,_2);
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(T input, U& output) const void operator()(T input, U& output) const
{ {
output = static_cast<U>(vtkm::Cos(input)); output = static_cast<U>(vtkm::Cos(input));
@ -185,7 +185,7 @@ public:
typedef void ExecutionSignature(_1,_2); typedef void ExecutionSignature(_1,_2);
template<typename T> template<typename T>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Vec<T,3>& vec, T& result) const void operator()(const vtkm::Vec<T,3>& vec, T& result) const
{ {
const T m = vtkm::Magnitude(vec); const T m = vtkm::Magnitude(vec);
@ -193,7 +193,7 @@ public:
} }
template<typename T, typename U> template<typename T, typename U>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Vec<T,3>& , U& ) const void operator()(const vtkm::Vec<T,3>& , U& ) const
{ {
this->RaiseError("Mixed types unsupported."); this->RaiseError("Mixed types unsupported.");
@ -210,7 +210,7 @@ public:
template<typename ConnectivityInVec, template<typename ConnectivityInVec,
typename ThreadIndicesType, typename ThreadIndicesType,
typename IdPairTableType> typename IdPairTableType>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const ConnectivityInVec &connectivity, void operator()(const ConnectivityInVec &connectivity,
const ThreadIndicesType threadIndices, const ThreadIndicesType threadIndices,
const IdPairTableType &edgeIds) const const IdPairTableType &edgeIds) const
@ -243,7 +243,7 @@ public:
typedef _1 InputDomain; typedef _1 InputDomain;
template <typename WeightType, typename T, typename S, typename D> template <typename WeightType, typename T, typename S, typename D>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Id2& low_high, void operator()(const vtkm::Id2& low_high,
const WeightType &weight, const WeightType &weight,
const vtkm::exec::ExecutionWholeArrayConst<T,S,D>& inPortal, const vtkm::exec::ExecutionWholeArrayConst<T,S,D>& inPortal,
@ -256,7 +256,7 @@ public:
} }
template <typename WeightType, typename T, typename S, typename D, typename U> template <typename WeightType, typename T, typename S, typename D, typename U>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Id2& , void operator()(const vtkm::Id2& ,
const WeightType &, const WeightType &,
const vtkm::exec::ExecutionWholeArrayConst<T,S,D>& , const vtkm::exec::ExecutionWholeArrayConst<T,S,D>& ,
@ -307,7 +307,7 @@ private:
std::vector<Value> strike; std::vector<Value> strike;
std::vector<Value> years; std::vector<Value> years;
VTKM_CONT_EXPORT VTKM_CONT
BenchBlackScholes() BenchBlackScholes()
{ {
std::mt19937 rng; std::mt19937 rng;
@ -330,7 +330,7 @@ private:
this->OptionYears = vtkm::cont::make_ArrayHandle(this->years); this->OptionYears = vtkm::cont::make_ArrayHandle(this->years);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::ArrayHandle<Value> callResultHandle, putResultHandle; vtkm::cont::ArrayHandle<Value> callResultHandle, putResultHandle;
@ -353,7 +353,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "BlackScholes " description << "BlackScholes "
@ -366,7 +366,7 @@ private:
template<typename Value> template<typename Value>
struct BenchBlackScholesDynamic : public BenchBlackScholes<Value> { struct BenchBlackScholesDynamic : public BenchBlackScholes<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
ValueDynamicHandle dstocks(this->StockPrice); ValueDynamicHandle dstocks(this->StockPrice);
@ -404,7 +404,7 @@ private:
std::vector< vtkm::Vec<Value, 3> > input; std::vector< vtkm::Vec<Value, 3> > input;
vtkm::cont::ArrayHandle< vtkm::Vec<Value, 3>, StorageTag> InputHandle; vtkm::cont::ArrayHandle< vtkm::Vec<Value, 3>, StorageTag> InputHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchMath() BenchMath()
{ {
std::mt19937 rng; std::mt19937 rng;
@ -421,7 +421,7 @@ private:
this->InputHandle = vtkm::cont::make_ArrayHandle(this->input); this->InputHandle = vtkm::cont::make_ArrayHandle(this->input);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::ArrayHandle<Value> tempHandle1; vtkm::cont::ArrayHandle<Value> tempHandle1;
@ -439,7 +439,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "Magnitude -> Sine -> Square -> Cosine " description << "Magnitude -> Sine -> Square -> Cosine "
@ -452,7 +452,7 @@ private:
template<typename Value> template<typename Value>
struct BenchMathDynamic : public BenchMath<Value> { struct BenchMathDynamic : public BenchMath<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
using MathTypes = vtkm::ListTagBase<vtkm::Vec< vtkm::Float32, 3>, using MathTypes = vtkm::ListTagBase<vtkm::Vec< vtkm::Float32, 3>,
@ -487,7 +487,7 @@ private:
std::vector< vtkm::Vec<Value, 3> > input; std::vector< vtkm::Vec<Value, 3> > input;
vtkm::cont::ArrayHandle< vtkm::Vec<Value, 3>, StorageTag> InputHandle; vtkm::cont::ArrayHandle< vtkm::Vec<Value, 3>, StorageTag> InputHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchFusedMath() BenchFusedMath()
{ {
std::mt19937 rng; std::mt19937 rng;
@ -504,7 +504,7 @@ private:
this->InputHandle = vtkm::cont::make_ArrayHandle(this->input); this->InputHandle = vtkm::cont::make_ArrayHandle(this->input);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::ArrayHandle<Value> result; vtkm::cont::ArrayHandle<Value> result;
@ -516,7 +516,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
description << "Fused Magnitude -> Sine -> Square -> Cosine " description << "Fused Magnitude -> Sine -> Square -> Cosine "
@ -529,7 +529,7 @@ private:
template<typename Value> template<typename Value>
struct BenchFusedMathDynamic : public BenchFusedMath<Value> { struct BenchFusedMathDynamic : public BenchFusedMath<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
using MathTypes = vtkm::ListTagBase<vtkm::Vec< vtkm::Float32, 3>, using MathTypes = vtkm::ListTagBase<vtkm::Vec< vtkm::Float32, 3>,
@ -560,7 +560,7 @@ private:
vtkm::cont::ArrayHandle<Value, StorageTag> FieldHandle; vtkm::cont::ArrayHandle<Value, StorageTag> FieldHandle;
vtkm::cont::ArrayHandle< vtkm::Id2, StorageTag> EdgePairHandle; vtkm::cont::ArrayHandle< vtkm::Id2, StorageTag> EdgePairHandle;
VTKM_CONT_EXPORT VTKM_CONT
BenchEdgeInterp() BenchEdgeInterp()
{ {
using CT = typename vtkm::VecTraits<Value>::ComponentType; using CT = typename vtkm::VecTraits<Value>::ComponentType;
@ -601,7 +601,7 @@ private:
this->WeightHandle = vtkm::cont::make_ArrayHandle(this->weight); this->WeightHandle = vtkm::cont::make_ArrayHandle(this->weight);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::ArrayHandle<Value> result; vtkm::cont::ArrayHandle<Value> result;
@ -618,7 +618,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
const std::size_t size = (CUBE_SIZE-1)*(CUBE_SIZE-1)*(CUBE_SIZE-1)*12; const std::size_t size = (CUBE_SIZE-1)*(CUBE_SIZE-1)*(CUBE_SIZE-1)*12;
@ -632,7 +632,7 @@ private:
template<typename Value> template<typename Value>
struct BenchEdgeInterpDynamic : public BenchEdgeInterp<Value> { struct BenchEdgeInterpDynamic : public BenchEdgeInterp<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
InterpDynamicHandle dfield(this->FieldHandle); InterpDynamicHandle dfield(this->FieldHandle);
@ -660,7 +660,7 @@ private:
public: public:
static VTKM_CONT_EXPORT int Run(int benchmarks){ static VTKM_CONT int Run(int benchmarks){
std::cout << DIVIDER << "\nRunning Field Algorithm benchmarks\n"; std::cout << DIVIDER << "\nRunning Field Algorithm benchmarks\n";
if (benchmarks & BLACK_SCHOLES) { if (benchmarks & BLACK_SCHOLES) {

@ -60,7 +60,7 @@ public:
typedef _2 InputDomain; typedef _2 InputDomain;
template<typename PointValueVecType, typename OutType> template<typename PointValueVecType, typename OutType>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const PointValueVecType &pointValues, void operator()(const PointValueVecType &pointValues,
const vtkm::IdComponent &numPoints, const vtkm::IdComponent &numPoints,
OutType &average) const OutType &average) const
@ -85,7 +85,7 @@ public:
typedef _2 InputDomain; typedef _2 InputDomain;
template<typename CellVecType, typename OutType> template<typename CellVecType, typename OutType>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const CellVecType &cellValues, void operator()(const CellVecType &cellValues,
OutType &avgVal, OutType &avgVal,
const vtkm::IdComponent &numCellIDs) const const vtkm::IdComponent &numCellIDs) const
@ -114,14 +114,14 @@ public:
T IsoValue; T IsoValue;
VTKM_CONT_EXPORT VTKM_CONT
Classification(T isovalue) : Classification(T isovalue) :
IsoValue(isovalue) IsoValue(isovalue)
{ {
} }
template<typename FieldInType> template<typename FieldInType>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const FieldInType &fieldIn, void operator()(const FieldInType &fieldIn,
vtkm::IdComponent &caseNumber) const vtkm::IdComponent &caseNumber) const
{ {
@ -193,7 +193,7 @@ private:
vtkm::cont::ArrayHandle< Value, StorageTag> InputHandle; vtkm::cont::ArrayHandle< Value, StorageTag> InputHandle;
std::size_t DomainSize; std::size_t DomainSize;
VTKM_CONT_EXPORT VTKM_CONT
BenchCellToPointAvg() BenchCellToPointAvg()
{ {
NumberGenerator<Value> generator(static_cast<Value>(1.0), NumberGenerator<Value> generator(static_cast<Value>(1.0),
@ -208,7 +208,7 @@ private:
this->InputHandle = vtkm::cont::make_ArrayHandle(this->input); this->InputHandle = vtkm::cont::make_ArrayHandle(this->input);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::CellSetStructured<3> cellSet; vtkm::cont::CellSetStructured<3> cellSet;
@ -227,7 +227,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
@ -241,7 +241,7 @@ private:
template<typename Value> template<typename Value>
struct BenchCellToPointAvgDynamic : public BenchCellToPointAvg<Value> { struct BenchCellToPointAvgDynamic : public BenchCellToPointAvg<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::CellSetStructured<3> cellSet; vtkm::cont::CellSetStructured<3> cellSet;
@ -273,7 +273,7 @@ private:
vtkm::cont::ArrayHandle< Value, StorageTag> InputHandle; vtkm::cont::ArrayHandle< Value, StorageTag> InputHandle;
std::size_t DomainSize; std::size_t DomainSize;
VTKM_CONT_EXPORT VTKM_CONT
BenchPointToCellAvg() BenchPointToCellAvg()
{ {
NumberGenerator<Value> generator(static_cast<Value>(1.0), NumberGenerator<Value> generator(static_cast<Value>(1.0),
@ -288,7 +288,7 @@ private:
this->InputHandle = vtkm::cont::make_ArrayHandle(this->input); this->InputHandle = vtkm::cont::make_ArrayHandle(this->input);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::CellSetStructured<3> cellSet; vtkm::cont::CellSetStructured<3> cellSet;
@ -307,7 +307,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
@ -321,7 +321,7 @@ private:
template<typename Value> template<typename Value>
struct BenchPointToCellAvgDynamic : public BenchPointToCellAvg<Value> { struct BenchPointToCellAvgDynamic : public BenchPointToCellAvg<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::CellSetStructured<3> cellSet; vtkm::cont::CellSetStructured<3> cellSet;
@ -353,7 +353,7 @@ private:
Value IsoValue; Value IsoValue;
size_t DomainSize; size_t DomainSize;
VTKM_CONT_EXPORT VTKM_CONT
BenchClassification() BenchClassification()
{ {
NumberGenerator<Value> generator(static_cast<Value>(1.0), NumberGenerator<Value> generator(static_cast<Value>(1.0),
@ -369,7 +369,7 @@ private:
this->IsoValue = generator.next(); this->IsoValue = generator.next();
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::CellSetStructured<3> cellSet; vtkm::cont::CellSetStructured<3> cellSet;
@ -391,7 +391,7 @@ private:
virtual std::string Type() const { return std::string("Static"); } virtual std::string Type() const { return std::string("Static"); }
VTKM_CONT_EXPORT VTKM_CONT
std::string Description() const { std::string Description() const {
std::stringstream description; std::stringstream description;
@ -404,7 +404,7 @@ private:
template<typename Value> template<typename Value>
struct BenchClassificationDynamic : public BenchClassification<Value> { struct BenchClassificationDynamic : public BenchClassification<Value> {
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 operator()() vtkm::Float64 operator()()
{ {
vtkm::cont::CellSetStructured<3> cellSet; vtkm::cont::CellSetStructured<3> cellSet;
@ -430,7 +430,7 @@ private:
public: public:
static VTKM_CONT_EXPORT int Run(int benchmarks){ static VTKM_CONT int Run(int benchmarks){
std::cout << DIVIDER << "\nRunning Topology Algorithm benchmarks\n"; std::cout << DIVIDER << "\nRunning Topology Algorithm benchmarks\n";
if (benchmarks & CELL_TO_POINT) { if (benchmarks & CELL_TO_POINT) {

@ -41,18 +41,18 @@
* template<typename Value> * template<typename Value>
* struct BenchSilly { * struct BenchSilly {
* // Setup anything that doesn't need to change per run in the constructor * // Setup anything that doesn't need to change per run in the constructor
* VTKM_CONT_EXPORT BenchSilly(){} * VTKM_CONT BenchSilly(){}
* *
* // The overloaded call operator will run the operations being timed and * // The overloaded call operator will run the operations being timed and
* // return the execution time * // return the execution time
* VTKM_CONT_EXPORT * VTKM_CONT
* vtkm::Float64 operator()(){ * vtkm::Float64 operator()(){
* return 0.05; * return 0.05;
* } * }
* *
* // The benchmark must also provide a method describing itself, this is * // The benchmark must also provide a method describing itself, this is
* // used when printing out run time statistics * // used when printing out run time statistics
* VTKM_CONT_EXPORT * VTKM_CONT
* std::string Description() const { * std::string Description() const {
* return "A silly benchmark"; * return "A silly benchmark";
* } * }
@ -88,7 +88,7 @@
#define VTKM_MAKE_BENCHMARK(Name, Bench, ...) \ #define VTKM_MAKE_BENCHMARK(Name, Bench, ...) \
struct MakeBench##Name { \ struct MakeBench##Name { \
template<typename Value> \ template<typename Value> \
VTKM_CONT_EXPORT \ VTKM_CONT \
Bench<Value> operator()(const Value vtkmNotUsed(v)) const { \ Bench<Value> operator()(const Value vtkmNotUsed(v)) const { \
return Bench<Value>(__VA_ARGS__); \ return Bench<Value>(__VA_ARGS__); \
} \ } \
@ -207,7 +207,7 @@ struct Benchmarker {
Benchmarker() : MAX_RUNTIME(30), MAX_ITERATIONS(500){} Benchmarker() : MAX_RUNTIME(30), MAX_ITERATIONS(500){}
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(Functor func) const { void operator()(Functor func) const {
std::vector<vtkm::Float64> samples; std::vector<vtkm::Float64> samples;
// Do a warm-up run. If the benchmark allocates any additional memory // Do a warm-up run. If the benchmark allocates any additional memory
@ -244,11 +244,11 @@ class InternalPrintTypeAndBench {
MakerFunctor Maker; MakerFunctor Maker;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
InternalPrintTypeAndBench(MakerFunctor maker) : Maker(maker) {} InternalPrintTypeAndBench(MakerFunctor maker) : Maker(maker) {}
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(T t) const { void operator()(T t) const {
std::cout << "*** " std::cout << "*** "
<< vtkm::testing::TypeName<T>::Name() << vtkm::testing::TypeName<T>::Name()
@ -259,7 +259,7 @@ public:
}; };
template<class MakerFunctor, class TypeList> template<class MakerFunctor, class TypeList>
VTKM_CONT_EXPORT VTKM_CONT
void BenchmarkTypes(const MakerFunctor &maker, TypeList){ void BenchmarkTypes(const MakerFunctor &maker, TypeList){
vtkm::ListForEach(InternalPrintTypeAndBench<MakerFunctor>(maker), TypeList()); vtkm::ListForEach(InternalPrintTypeAndBench<MakerFunctor>(maker), TypeList());
} }

@ -131,19 +131,19 @@ struct GetTypeInParentheses<void(T)>
\ \
VTKM_IS_ARRAY_HANDLE(Superclass); \ VTKM_IS_ARRAY_HANDLE(Superclass); \
\ \
VTKM_CONT_EXPORT \ VTKM_CONT \
classname() : Superclass() { } \ classname() : Superclass() { } \
\ \
VTKM_CONT_EXPORT \ VTKM_CONT \
classname(const Thisclass &src) : Superclass(src) { } \ classname(const Thisclass &src) : Superclass(src) { } \
\ \
VTKM_CONT_EXPORT \ VTKM_CONT \
classname(const vtkm::cont::ArrayHandle<typename__ Superclass::ValueType, typename__ Superclass::StorageTag> &src) : Superclass(src) { } \ classname(const vtkm::cont::ArrayHandle<typename__ Superclass::ValueType, typename__ Superclass::StorageTag> &src) : Superclass(src) { } \
\ \
VTKM_CONT_EXPORT \ VTKM_CONT \
virtual ~classname() { } \ virtual ~classname() { } \
\ \
VTKM_CONT_EXPORT \ VTKM_CONT \
Thisclass &operator=(const Thisclass &src) \ Thisclass &operator=(const Thisclass &src) \
{ \ { \
this->Superclass::operator=(src); \ this->Superclass::operator=(src); \
@ -247,7 +247,7 @@ public:
/// Constructs an empty ArrayHandle. Typically used for output or /// Constructs an empty ArrayHandle. Typically used for output or
/// intermediate arrays that will be filled by a VTKm algorithm. /// intermediate arrays that will be filled by a VTKm algorithm.
/// ///
VTKM_CONT_EXPORT ArrayHandle() : Internals(new InternalStruct) VTKM_CONT ArrayHandle() : Internals(new InternalStruct)
{ {
this->Internals->ControlArrayValid = false; this->Internals->ControlArrayValid = false;
this->Internals->ExecutionArrayValid = false; this->Internals->ExecutionArrayValid = false;
@ -260,7 +260,7 @@ public:
/// with CUDA), then the automatically generated copy constructor could be /// with CUDA), then the automatically generated copy constructor could be
/// created for all devices, and it would not be valid for all devices. /// created for all devices, and it would not be valid for all devices.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandle(const vtkm::cont::ArrayHandle<ValueType,StorageTag> &src) ArrayHandle(const vtkm::cont::ArrayHandle<ValueType,StorageTag> &src)
: Internals(src.Internals) : Internals(src.Internals)
{ } { }
@ -288,7 +288,7 @@ public:
/// \brief Copies an ArrayHandle /// \brief Copies an ArrayHandle
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandle<ValueType,StorageTag> & vtkm::cont::ArrayHandle<ValueType,StorageTag> &
operator=(const vtkm::cont::ArrayHandle<ValueType,StorageTag> &src) operator=(const vtkm::cont::ArrayHandle<ValueType,StorageTag> &src)
{ {
@ -298,7 +298,7 @@ public:
/// Get the storage. /// Get the storage.
/// ///
VTKM_CONT_EXPORT StorageType& GetStorage() VTKM_CONT StorageType& GetStorage()
{ {
this->SyncControlArray(); this->SyncControlArray();
if (this->Internals->ControlArrayValid) if (this->Internals->ControlArrayValid)
@ -314,7 +314,7 @@ public:
/// Get the storage. /// Get the storage.
/// ///
VTKM_CONT_EXPORT const StorageType& GetStorage() const VTKM_CONT const StorageType& GetStorage() const
{ {
this->SyncControlArray(); this->SyncControlArray();
if (this->Internals->ControlArrayValid) if (this->Internals->ControlArrayValid)
@ -330,7 +330,7 @@ public:
/// Get the array portal of the control array. /// Get the array portal of the control array.
/// ///
VTKM_CONT_EXPORT PortalControl GetPortalControl() VTKM_CONT PortalControl GetPortalControl()
{ {
this->SyncControlArray(); this->SyncControlArray();
if (this->Internals->ControlArrayValid) if (this->Internals->ControlArrayValid)
@ -350,7 +350,7 @@ public:
/// Get the array portal of the control array. /// Get the array portal of the control array.
/// ///
VTKM_CONT_EXPORT PortalConstControl GetPortalConstControl() const VTKM_CONT PortalConstControl GetPortalConstControl() const
{ {
this->SyncControlArray(); this->SyncControlArray();
if (this->Internals->ControlArrayValid) if (this->Internals->ControlArrayValid)
@ -366,7 +366,7 @@ public:
/// Returns the number of entries in the array. /// Returns the number of entries in the array.
/// ///
VTKM_CONT_EXPORT vtkm::Id GetNumberOfValues() const VTKM_CONT vtkm::Id GetNumberOfValues() const
{ {
if (this->Internals->ControlArrayValid) if (this->Internals->ControlArrayValid)
{ {
@ -386,7 +386,7 @@ public:
/// method can skip copying into an internally managed control array. /// method can skip copying into an internally managed control array.
/// ///
template<typename IteratorType, typename DeviceAdapterTag> template<typename IteratorType, typename DeviceAdapterTag>
VTKM_CONT_EXPORT void CopyInto(IteratorType dest, DeviceAdapterTag) const VTKM_CONT void CopyInto(IteratorType dest, DeviceAdapterTag) const
{ {
using pointer_type = typename std::iterator_traits<IteratorType>::pointer; using pointer_type = typename std::iterator_traits<IteratorType>::pointer;
using value_type = typename std::remove_pointer<pointer_type>::type; using value_type = typename std::remove_pointer<pointer_type>::type;
@ -434,7 +434,7 @@ public:
/// ErrorControlBadValue if the allocation is not feasible (for example, the /// ErrorControlBadValue if the allocation is not feasible (for example, the
/// array storage is read-only). /// array storage is read-only).
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues) void Allocate(vtkm::Id numberOfValues)
{ {
this->ReleaseResourcesExecutionInternal(); this->ReleaseResourcesExecutionInternal();
@ -481,7 +481,7 @@ public:
/// Releases any resources being used in the execution environment (that are /// Releases any resources being used in the execution environment (that are
/// not being shared by the control environment). /// not being shared by the control environment).
/// ///
VTKM_CONT_EXPORT void ReleaseResourcesExecution() VTKM_CONT void ReleaseResourcesExecution()
{ {
// Save any data in the execution environment by making sure it is synced // Save any data in the execution environment by making sure it is synced
// with the control environment. // with the control environment.
@ -492,7 +492,7 @@ public:
/// Releases all resources in both the control and execution environments. /// Releases all resources in both the control and execution environments.
/// ///
VTKM_CONT_EXPORT void ReleaseResources() VTKM_CONT void ReleaseResources()
{ {
this->ReleaseResourcesExecutionInternal(); this->ReleaseResourcesExecutionInternal();
@ -510,7 +510,7 @@ public:
/// execution environment. /// execution environment.
/// ///
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
typename ExecutionTypes<DeviceAdapterTag>::PortalConst typename ExecutionTypes<DeviceAdapterTag>::PortalConst
PrepareForInput(DeviceAdapterTag) const PrepareForInput(DeviceAdapterTag) const
{ {
@ -541,7 +541,7 @@ public:
/// execution environment. /// execution environment.
/// ///
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
typename ExecutionTypes<DeviceAdapterTag>::Portal typename ExecutionTypes<DeviceAdapterTag>::Portal
PrepareForOutput(vtkm::Id numberOfValues, DeviceAdapterTag) PrepareForOutput(vtkm::Id numberOfValues, DeviceAdapterTag)
{ {
@ -578,7 +578,7 @@ public:
/// in the execution environment. /// in the execution environment.
/// ///
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
typename ExecutionTypes<DeviceAdapterTag>::Portal typename ExecutionTypes<DeviceAdapterTag>::Portal
PrepareForInPlace(DeviceAdapterTag) PrepareForInPlace(DeviceAdapterTag)
{ {
@ -609,12 +609,12 @@ public:
/// Like a pointer, two \c ArrayHandles are considered equal if they point /// Like a pointer, two \c ArrayHandles are considered equal if they point
/// to the same location in memory. /// to the same location in memory.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
bool operator==(const ArrayHandle<ValueType,StorageTag> &rhs) const bool operator==(const ArrayHandle<ValueType,StorageTag> &rhs) const
{ {
return (this->Internals.get() == rhs.Internals.get()); return (this->Internals.get() == rhs.Internals.get());
} }
VTKM_CONT_EXPORT VTKM_CONT
bool operator!=(const ArrayHandle<ValueType,StorageTag> &rhs) const bool operator!=(const ArrayHandle<ValueType,StorageTag> &rhs) const
{ {
return (this->Internals.get() != rhs.Internals.get()); return (this->Internals.get() != rhs.Internals.get());
@ -632,7 +632,7 @@ public:
bool ExecutionArrayValid; bool ExecutionArrayValid;
}; };
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandle(const std::shared_ptr<InternalStruct>& i) ArrayHandle(const std::shared_ptr<InternalStruct>& i)
: Internals(i) : Internals(i)
{ } { }
@ -643,7 +643,7 @@ public:
/// method is declared const because logically the data does not. /// method is declared const because logically the data does not.
/// ///
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
void PrepareForDevice(DeviceAdapterTag) const void PrepareForDevice(DeviceAdapterTag) const
{ {
if (this->Internals->ExecutionArray != nullptr) if (this->Internals->ExecutionArray != nullptr)
@ -688,7 +688,7 @@ public:
/// Although the internal state of this class can change, the method is /// Although the internal state of this class can change, the method is
/// declared const because logically the data does not. /// declared const because logically the data does not.
/// ///
VTKM_CONT_EXPORT void SyncControlArray() const VTKM_CONT void SyncControlArray() const
{ {
if (!this->Internals->ControlArrayValid) if (!this->Internals->ControlArrayValid)
{ {
@ -712,7 +712,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResourcesExecutionInternal() void ReleaseResourcesExecutionInternal()
{ {
if (this->Internals->ExecutionArrayValid) if (this->Internals->ExecutionArrayValid)
@ -728,7 +728,7 @@ public:
/// A convenience function for creating an ArrayHandle from a standard C array. /// A convenience function for creating an ArrayHandle from a standard C array.
/// ///
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>
make_ArrayHandle(const T *array, make_ArrayHandle(const T *array,
vtkm::Id length) vtkm::Id length)
@ -744,7 +744,7 @@ make_ArrayHandle(const T *array,
/// ///
template<typename T, template<typename T,
typename Allocator> typename Allocator>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>
make_ArrayHandle(const std::vector<T,Allocator> &array) make_ArrayHandle(const std::vector<T,Allocator> &array)
{ {
@ -752,7 +752,7 @@ make_ArrayHandle(const std::vector<T,Allocator> &array)
} }
template<typename T, typename StorageT> template<typename T, typename StorageT>
VTKM_CONT_EXPORT VTKM_CONT
void void
printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<T,StorageT> &array, printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<T,StorageT> &array,
std::ostream &out) std::ostream &out)
@ -779,7 +779,7 @@ printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<T,StorageT> &array,
} }
template<typename StorageT> template<typename StorageT>
VTKM_CONT_EXPORT VTKM_CONT
void void
printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<vtkm::UInt8,StorageT> &array, printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<vtkm::UInt8,StorageT> &array,
std::ostream &out) std::ostream &out)

@ -45,12 +45,12 @@ public:
typedef PortalTypeThird_ PortalTypeThird; typedef PortalTypeThird_ PortalTypeThird;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalCartesianProduct() ArrayPortalCartesianProduct()
: PortalFirst(), PortalSecond(), PortalThird() : PortalFirst(), PortalSecond(), PortalThird()
{ } //needs to be host and device so that cuda can create lvalue of these { } //needs to be host and device so that cuda can create lvalue of these
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalCartesianProduct(const PortalTypeFirst &portalfirst, ArrayPortalCartesianProduct(const PortalTypeFirst &portalfirst,
const PortalTypeSecond &portalsecond, const PortalTypeSecond &portalsecond,
const PortalTypeThird &portalthird) const PortalTypeThird &portalthird)
@ -63,7 +63,7 @@ public:
/// ///
template<class OtherV, class OtherP1, class OtherP2, class OtherP3> template<class OtherV, class OtherP1, class OtherP2, class OtherP3>
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalCartesianProduct(const ArrayPortalCartesianProduct<OtherV,OtherP1,OtherP2,OtherP3> &src) ArrayPortalCartesianProduct(const ArrayPortalCartesianProduct<OtherV,OtherP1,OtherP2,OtherP3> &src)
: PortalFirst(src.GetPortalFirst()), : PortalFirst(src.GetPortalFirst()),
PortalSecond(src.GetPortalSecond()), PortalSecond(src.GetPortalSecond()),
@ -72,7 +72,7 @@ public:
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->PortalFirst.GetNumberOfValues() * return this->PortalFirst.GetNumberOfValues() *
@ -81,7 +81,7 @@ public:
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const ValueType Get(vtkm::Id index) const
{ {
VTKM_ASSERT(index >= 0); VTKM_ASSERT(index >= 0);
@ -101,7 +101,7 @@ public:
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Set(vtkm::Id index, const ValueType &value) const void Set(vtkm::Id index, const ValueType &value) const
{ {
VTKM_ASSERT(index >= 0); VTKM_ASSERT(index >= 0);
@ -122,15 +122,15 @@ public:
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalTypeFirst &GetFirstPortal() const { return this->PortalFirst; } const PortalTypeFirst &GetFirstPortal() const { return this->PortalFirst; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalTypeSecond &GetSecondPortal() const { return this->PortalSecond; } const PortalTypeSecond &GetSecondPortal() const { return this->PortalSecond; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalTypeThird &GetThirdPortal() const { return this->PortalThird; } const PortalTypeThird &GetThirdPortal() const { return this->PortalThird; }
@ -192,17 +192,17 @@ public:
typename ThirdHandleType::PortalConstControl> typename ThirdHandleType::PortalConstControl>
PortalConstType; PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : FirstArray(), SecondArray(), ThirdArray() { } Storage() : FirstArray(), SecondArray(), ThirdArray() { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const FirstHandleType &array1, const SecondHandleType &array2, const ThirdHandleType &array3) Storage(const FirstHandleType &array1, const SecondHandleType &array2, const ThirdHandleType &array3)
: FirstArray(array1), SecondArray(array2), ThirdArray(array3) : FirstArray(array1), SecondArray(array2), ThirdArray(array3)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() PortalType GetPortal()
{ {
return PortalType(this->FirstArray.GetPortalControl(), return PortalType(this->FirstArray.GetPortalControl(),
@ -210,7 +210,7 @@ public:
this->ThirdArray.GetPortalControl()); this->ThirdArray.GetPortalControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
return PortalConstType(this->FirstArray.GetPortalConstControl(), return PortalConstType(this->FirstArray.GetPortalConstControl(),
@ -218,7 +218,7 @@ public:
this->ThirdArray.GetPortalConstControl()); this->ThirdArray.GetPortalConstControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->FirstArray.GetNumberOfValues() * return this->FirstArray.GetNumberOfValues() *
@ -226,38 +226,38 @@ public:
this->ThirdArray.GetNumberOfValues(); this->ThirdArray.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id /*numberOfValues*/) void Allocate(vtkm::Id /*numberOfValues*/)
{ {
throw vtkm::cont::ErrorControlBadAllocation("Does not make sense."); throw vtkm::cont::ErrorControlBadAllocation("Does not make sense.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id /*numberOfValues*/) void Shrink(vtkm::Id /*numberOfValues*/)
{ {
throw vtkm::cont::ErrorControlBadAllocation("Does not make sense."); throw vtkm::cont::ErrorControlBadAllocation("Does not make sense.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
// This request is ignored since it is asking to release the resources // This request is ignored since it is asking to release the resources
// of the arrays, which may be used elsewhere. // of the arrays, which may be used elsewhere.
} }
VTKM_CONT_EXPORT VTKM_CONT
const FirstHandleType &GetFirstArray() const const FirstHandleType &GetFirstArray() const
{ {
return this->FirstArray; return this->FirstArray;
} }
VTKM_CONT_EXPORT VTKM_CONT
const SecondHandleType &GetSecondArray() const const SecondHandleType &GetSecondArray() const
{ {
return this->SecondArray; return this->SecondArray;
} }
VTKM_CONT_EXPORT VTKM_CONT
const ThirdHandleType &GetThirdArray() const const ThirdHandleType &GetThirdArray() const
{ {
return this->ThirdArray; return this->ThirdArray;
@ -300,7 +300,7 @@ public:
typename ThirdHandleType::template ExecutionTypes<Device>::PortalConst typename ThirdHandleType::template ExecutionTypes<Device>::PortalConst
> PortalConstExecution; > PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) ArrayTransfer(StorageType *storage)
: FirstArray(storage->GetFirstArray()), : FirstArray(storage->GetFirstArray()),
SecondArray(storage->GetSecondArray()), SecondArray(storage->GetSecondArray()),
@ -308,7 +308,7 @@ public:
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->FirstArray.GetNumberOfValues() * return this->FirstArray.GetNumberOfValues() *
@ -317,14 +317,14 @@ public:
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) { PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) {
return PortalConstExecution(this->FirstArray.PrepareForInput(Device()), return PortalConstExecution(this->FirstArray.PrepareForInput(Device()),
this->SecondArray.PrepareForInput(Device()), this->SecondArray.PrepareForInput(Device()),
this->ThirdArray.PrepareForInput(Device())); this->ThirdArray.PrepareForInput(Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData))
{ {
throw vtkm::cont::ErrorControlBadAllocation( throw vtkm::cont::ErrorControlBadAllocation(
@ -332,7 +332,7 @@ public:
"sense because there is overlap in the data."); "sense because there is overlap in the data.");
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
throw vtkm::cont::ErrorControlBadAllocation( throw vtkm::cont::ErrorControlBadAllocation(
@ -340,7 +340,7 @@ public:
"sense because there is overlap in the data."); "sense because there is overlap in the data.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const
{ {
// Implementation of this method should be unnecessary. The internal // Implementation of this method should be unnecessary. The internal
@ -348,13 +348,13 @@ public:
// output data as necessary. // output data as necessary.
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id /*numberOfValues*/) void Shrink(vtkm::Id /*numberOfValues*/)
{ {
throw vtkm::cont::ErrorControlBadAllocation("Does not make sense."); throw vtkm::cont::ErrorControlBadAllocation("Does not make sense.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
this->FirstArray.ReleaseResourcesExecution(); this->FirstArray.ReleaseResourcesExecution();
@ -397,7 +397,7 @@ private:
typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType; typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCartesianProduct(const FirstHandleType &firstArray, ArrayHandleCartesianProduct(const FirstHandleType &firstArray,
const SecondHandleType &secondArray, const SecondHandleType &secondArray,
const ThirdHandleType &thirdArray) const ThirdHandleType &thirdArray)
@ -408,7 +408,7 @@ public:
/// arrays to be zipped together. /// arrays to be zipped together.
/// ///
template<typename FirstHandleType, typename SecondHandleType, typename ThirdHandleType> template<typename FirstHandleType, typename SecondHandleType, typename ThirdHandleType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleCartesianProduct<FirstHandleType,SecondHandleType,ThirdHandleType> vtkm::cont::ArrayHandleCartesianProduct<FirstHandleType,SecondHandleType,ThirdHandleType>
make_ArrayHandleCartesianProduct(const FirstHandleType &first, make_ArrayHandleCartesianProduct(const FirstHandleType &first,
const SecondHandleType &second, const SecondHandleType &second,

@ -32,7 +32,7 @@ namespace internal {
template<typename FromType, typename ToType> template<typename FromType, typename ToType>
struct Cast struct Cast
{ {
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ToType operator()(const FromType &val) const ToType operator()(const FromType &val) const
{ {
return static_cast<ToType>(val); return static_cast<ToType>(val);
@ -75,7 +75,7 @@ public:
/// ArrayHandleCast. /// ArrayHandleCast.
/// ///
template <typename T, typename HandleType> template <typename T, typename HandleType>
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCast<T, HandleType> make_ArrayHandleCast(const HandleType &handle, ArrayHandleCast<T, HandleType> make_ArrayHandleCast(const HandleType &handle,
const T& = T()) const T& = T())
{ {

@ -48,20 +48,20 @@ struct CompositeVectorSwizzleFunctor
// Caution! This is a reference. // Caution! This is a reference.
const ComponentMapType &SourceComponents; const ComponentMapType &SourceComponents;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
CompositeVectorSwizzleFunctor(const ComponentMapType &sourceComponents) CompositeVectorSwizzleFunctor(const ComponentMapType &sourceComponents)
: SourceComponents(sourceComponents) { } : SourceComponents(sourceComponents) { }
// Currently only supporting 1-4 components. // Currently only supporting 1-4 components.
template<typename T1> template<typename T1>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType operator()(const T1 &p1) const { ValueType operator()(const T1 &p1) const {
return ValueType( return ValueType(
vtkm::VecTraits<T1>::GetComponent(p1, this->SourceComponents[0])); vtkm::VecTraits<T1>::GetComponent(p1, this->SourceComponents[0]));
} }
template<typename T1, typename T2> template<typename T1, typename T2>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType operator()(const T1 &p1, const T2 &p2) const { ValueType operator()(const T1 &p1, const T2 &p2) const {
return ValueType( return ValueType(
vtkm::VecTraits<T1>::GetComponent(p1, this->SourceComponents[0]), vtkm::VecTraits<T1>::GetComponent(p1, this->SourceComponents[0]),
@ -69,7 +69,7 @@ struct CompositeVectorSwizzleFunctor
} }
template<typename T1, typename T2, typename T3> template<typename T1, typename T2, typename T3>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType operator()(const T1 &p1, const T2 &p2, const T3 &p3) const { ValueType operator()(const T1 &p1, const T2 &p2, const T3 &p3) const {
return ValueType( return ValueType(
vtkm::VecTraits<T1>::GetComponent(p1, this->SourceComponents[0]), vtkm::VecTraits<T1>::GetComponent(p1, this->SourceComponents[0]),
@ -78,7 +78,7 @@ struct CompositeVectorSwizzleFunctor
} }
template<typename T1, typename T2, typename T3, typename T4> template<typename T1, typename T2, typename T3, typename T4>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType operator()(const T1 &p1, ValueType operator()(const T1 &p1,
const T2 &p2, const T2 &p2,
const T3 &p3, const T3 &p3,
@ -96,19 +96,19 @@ struct CompositeVectorPullValueFunctor
{ {
vtkm::Id Index; vtkm::Id Index;
VTKM_EXEC_EXPORT VTKM_EXEC
CompositeVectorPullValueFunctor(vtkm::Id index) : Index(index) { } CompositeVectorPullValueFunctor(vtkm::Id index) : Index(index) { }
// This form is to pull values out of array arguments. // This form is to pull values out of array arguments.
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
template<typename PortalType> template<typename PortalType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename PortalType::ValueType operator()(const PortalType &portal) const { typename PortalType::ValueType operator()(const PortalType &portal) const {
return portal.Get(this->Index); return portal.Get(this->Index);
} }
// This form is an identity to pass the return value back. // This form is an identity to pass the return value back.
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ReturnValueType &operator()(const ReturnValueType &value) const { const ReturnValueType &operator()(const ReturnValueType &value) const {
return value; return value;
} }
@ -121,7 +121,7 @@ struct CompositeVectorArrayToPortalCont {
}; };
template<typename ArrayHandleType, vtkm::IdComponent Index> template<typename ArrayHandleType, vtkm::IdComponent Index>
VTKM_CONT_EXPORT VTKM_CONT
typename ReturnType<ArrayHandleType, Index>::type typename ReturnType<ArrayHandleType, Index>::type
operator()(const ArrayHandleType &array, operator()(const ArrayHandleType &array,
vtkm::internal::IndexTag<Index>) const { vtkm::internal::IndexTag<Index>) const {
@ -138,7 +138,7 @@ struct CompositeVectorArrayToPortalExec {
}; };
template<typename ArrayHandleType, vtkm::IdComponent Index> template<typename ArrayHandleType, vtkm::IdComponent Index>
VTKM_CONT_EXPORT VTKM_CONT
typename ReturnType<ArrayHandleType, Index>::type typename ReturnType<ArrayHandleType, Index>::type
operator()(const ArrayHandleType &array, operator()(const ArrayHandleType &array,
vtkm::internal::IndexTag<Index>) const { vtkm::internal::IndexTag<Index>) const {
@ -185,24 +185,24 @@ public:
VTKM_STATIC_ASSERT(NUM_COMPONENTS == PortalTypes::ARITY); VTKM_STATIC_ASSERT(NUM_COMPONENTS == PortalTypes::ARITY);
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalCompositeVector() { } ArrayPortalCompositeVector() { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalCompositeVector( ArrayPortalCompositeVector(
const PortalTypes portals, const PortalTypes portals,
vtkm::Vec<vtkm::IdComponent, NUM_COMPONENTS> sourceComponents) vtkm::Vec<vtkm::IdComponent, NUM_COMPONENTS> sourceComponents)
: Portals(portals), SourceComponents(sourceComponents) { } : Portals(portals), SourceComponents(sourceComponents) { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->Portals.template GetParameter<1>().GetNumberOfValues(); return this->Portals.template GetParameter<1>().GetNumberOfValues();
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const { ValueType Get(vtkm::Id index) const {
// This might be inefficient because we are copying all the portals only // This might be inefficient because we are copying all the portals only
// because they are coupled with the return value. // because they are coupled with the return value.
@ -257,10 +257,10 @@ public:
typedef PortalType PortalConstType; typedef PortalType PortalConstType;
typedef typename PortalType::ValueType ValueType; typedef typename PortalType::ValueType ValueType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : Valid(false) { } Storage() : Valid(false) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const FunctionInterfaceWithArrays &arrays, Storage(const FunctionInterfaceWithArrays &arrays,
const ComponentMapType &sourceComponents) const ComponentMapType &sourceComponents)
: Arrays(arrays), SourceComponents(sourceComponents), Valid(true) : Arrays(arrays), SourceComponents(sourceComponents), Valid(true)
@ -269,13 +269,13 @@ public:
detail::CheckArraySizeFunctor(this->GetNumberOfValues())); detail::CheckArraySizeFunctor(this->GetNumberOfValues()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() { PortalType GetPortal() {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
"Composite vector arrays are read only."); "Composite vector arrays are read only.");
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const { PortalConstType GetPortalConst() const {
if (!this->Valid) if (!this->Valid)
{ {
@ -287,7 +287,7 @@ public:
this->SourceComponents); this->SourceComponents);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
if (!this->Valid) if (!this->Valid)
{ {
@ -297,7 +297,7 @@ public:
return this->Arrays.template GetParameter<1>().GetNumberOfValues(); return this->Arrays.template GetParameter<1>().GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) { void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlInternal( throw vtkm::cont::ErrorControlInternal(
@ -308,13 +308,13 @@ public:
"directly used."); "directly used.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) { void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
"Composite vector arrays are read-only."); "Composite vector arrays are read-only.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
if (this->Valid) if (this->Valid)
{ {
@ -322,13 +322,13 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
const FunctionInterfaceWithArrays &GetArrays() const { const FunctionInterfaceWithArrays &GetArrays() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->Arrays; return this->Arrays;
} }
VTKM_CONT_EXPORT VTKM_CONT
const ComponentMapType &GetSourceComponents() const { const ComponentMapType &GetSourceComponents() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->SourceComponents; return this->SourceComponents;
@ -369,15 +369,15 @@ public:
typedef ArrayPortalCompositeVector<SignatureWithPortals> PortalExecution; typedef ArrayPortalCompositeVector<SignatureWithPortals> PortalExecution;
typedef ArrayPortalCompositeVector<SignatureWithPortals> PortalConstExecution; typedef ArrayPortalCompositeVector<SignatureWithPortals> PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) : Storage(storage) { } ArrayTransfer(StorageType *storage) : Storage(storage) { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->Storage->GetNumberOfValues(); return this->Storage->GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) const PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) const
{ {
return return
@ -387,7 +387,7 @@ public:
this->Storage->GetSourceComponents()); this->Storage->GetSourceComponents());
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData))
{ {
// It may be the case a composite vector could be used for in place // It may be the case a composite vector could be used for in place
@ -396,7 +396,7 @@ public:
"Composite vector arrays cannot be used for output or in place."); "Composite vector arrays cannot be used for output or in place.");
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
// It may be the case a composite vector could be used for output if you // It may be the case a composite vector could be used for output if you
@ -406,21 +406,21 @@ public:
"Composite vector arrays cannot be used for output."); "Composite vector arrays cannot be used for output.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const
{ {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
"Composite vector arrays cannot be used for output."); "Composite vector arrays cannot be used for output.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) void Shrink(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
"Composite vector arrays cannot be resized."); "Composite vector arrays cannot be resized.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->Storage->ReleaseResources(); this->Storage->ReleaseResources();
} }
@ -456,7 +456,7 @@ public:
(ArrayHandleCompositeVector<Signature>), (ArrayHandleCompositeVector<Signature>),
(typename internal::ArrayHandleCompositeVectorTraits<Signature>::Superclass)); (typename internal::ArrayHandleCompositeVectorTraits<Signature>::Superclass));
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCompositeVector( ArrayHandleCompositeVector(
const vtkm::internal::FunctionInterface<Signature> &arrays, const vtkm::internal::FunctionInterface<Signature> &arrays,
const ComponentMapType &sourceComponents) const ComponentMapType &sourceComponents)
@ -468,7 +468,7 @@ public:
/// signature. /// signature.
/// ///
template<typename ArrayHandleType1> template<typename ArrayHandleType1>
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCompositeVector(const ArrayHandleType1 &array1, ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
vtkm::IdComponent sourceComponent1) vtkm::IdComponent sourceComponent1)
: Superclass(StorageType( : Superclass(StorageType(
@ -477,7 +477,7 @@ public:
{ } { }
template<typename ArrayHandleType1, template<typename ArrayHandleType1,
typename ArrayHandleType2> typename ArrayHandleType2>
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCompositeVector(const ArrayHandleType1 &array1, ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
vtkm::IdComponent sourceComponent1, vtkm::IdComponent sourceComponent1,
const ArrayHandleType2 &array2, const ArrayHandleType2 &array2,
@ -491,7 +491,7 @@ public:
template<typename ArrayHandleType1, template<typename ArrayHandleType1,
typename ArrayHandleType2, typename ArrayHandleType2,
typename ArrayHandleType3> typename ArrayHandleType3>
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCompositeVector(const ArrayHandleType1 &array1, ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
vtkm::IdComponent sourceComponent1, vtkm::IdComponent sourceComponent1,
const ArrayHandleType2 &array2, const ArrayHandleType2 &array2,
@ -509,7 +509,7 @@ public:
typename ArrayHandleType2, typename ArrayHandleType2,
typename ArrayHandleType3, typename ArrayHandleType3,
typename ArrayHandleType4> typename ArrayHandleType4>
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCompositeVector(const ArrayHandleType1 &array1, ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
vtkm::IdComponent sourceComponent1, vtkm::IdComponent sourceComponent1,
const ArrayHandleType2 &array2, const ArrayHandleType2 &array2,
@ -608,7 +608,7 @@ public:
/// Create a composite vector array from other arrays. /// Create a composite vector array from other arrays.
/// ///
template<typename ValueType1, typename Storage1> template<typename ValueType1, typename Storage1>
VTKM_CONT_EXPORT VTKM_CONT
typename ArrayHandleCompositeVectorType< typename ArrayHandleCompositeVectorType<
vtkm::cont::ArrayHandle<ValueType1,Storage1> >::type vtkm::cont::ArrayHandle<ValueType1,Storage1> >::type
make_ArrayHandleCompositeVector( make_ArrayHandleCompositeVector(
@ -620,7 +620,7 @@ make_ArrayHandleCompositeVector(
sourceComponent1); sourceComponent1);
} }
template<typename ArrayHandleType1> template<typename ArrayHandleType1>
VTKM_CONT_EXPORT VTKM_CONT
typename ArrayHandleCompositeVectorType<ArrayHandleType1>::type typename ArrayHandleCompositeVectorType<ArrayHandleType1>::type
make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1, make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
vtkm::IdComponent sourceComponent1) vtkm::IdComponent sourceComponent1)
@ -631,7 +631,7 @@ make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
} }
template<typename ArrayHandleType1, template<typename ArrayHandleType1,
typename ArrayHandleType2> typename ArrayHandleType2>
VTKM_CONT_EXPORT VTKM_CONT
typename ArrayHandleCompositeVectorType< typename ArrayHandleCompositeVectorType<
ArrayHandleType1, ArrayHandleType2>::type ArrayHandleType1, ArrayHandleType2>::type
make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1, make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
@ -649,7 +649,7 @@ make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
template<typename ArrayHandleType1, template<typename ArrayHandleType1,
typename ArrayHandleType2, typename ArrayHandleType2,
typename ArrayHandleType3> typename ArrayHandleType3>
VTKM_CONT_EXPORT VTKM_CONT
typename ArrayHandleCompositeVectorType< typename ArrayHandleCompositeVectorType<
ArrayHandleType1, ArrayHandleType2, ArrayHandleType3>::type ArrayHandleType1, ArrayHandleType2, ArrayHandleType3>::type
make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1, make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1,
@ -673,7 +673,7 @@ template<typename ArrayHandleType1,
typename ArrayHandleType2, typename ArrayHandleType2,
typename ArrayHandleType3, typename ArrayHandleType3,
typename ArrayHandleType4> typename ArrayHandleType4>
VTKM_CONT_EXPORT VTKM_CONT
typename ArrayHandleCompositeVectorType< typename ArrayHandleCompositeVectorType<
ArrayHandleType1, ArrayHandleType2, ArrayHandleType3, ArrayHandleType4>::type ArrayHandleType1, ArrayHandleType2, ArrayHandleType3, ArrayHandleType4>::type
make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1, make_ArrayHandleCompositeVector(const ArrayHandleType1 &array1,

@ -34,27 +34,27 @@ class ArrayPortalConcatenate
public: public:
typedef typename PortalType1::ValueType ValueType; typedef typename PortalType1::ValueType ValueType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalConcatenate() : portal1(), portal2() {} ArrayPortalConcatenate() : portal1(), portal2() {}
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalConcatenate( const PortalType1 &p1, const PortalType2 &p2 ) ArrayPortalConcatenate( const PortalType1 &p1, const PortalType2 &p2 )
: portal1( p1 ), portal2( p2 ) {} : portal1( p1 ), portal2( p2 ) {}
// Copy constructor // Copy constructor
template< typename OtherP1, typename OtherP2 > template< typename OtherP1, typename OtherP2 >
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalConcatenate( const ArrayPortalConcatenate< OtherP1, OtherP2 > &src ) ArrayPortalConcatenate( const ArrayPortalConcatenate< OtherP1, OtherP2 > &src )
: portal1( src.GetPortal1() ), portal2( src.GetPortal2() ) {} : portal1( src.GetPortal1() ), portal2( src.GetPortal2() ) {}
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->portal1.GetNumberOfValues() + return this->portal1.GetNumberOfValues() +
this->portal2.GetNumberOfValues() ; this->portal2.GetNumberOfValues() ;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get( vtkm::Id index) const ValueType Get( vtkm::Id index) const
{ {
if( index < this->portal1.GetNumberOfValues() ) if( index < this->portal1.GetNumberOfValues() )
@ -63,7 +63,7 @@ public:
return this->portal2.Get( index - this->portal1.GetNumberOfValues() ); return this->portal2.Get( index - this->portal1.GetNumberOfValues() );
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Set( vtkm::Id index, const ValueType &value ) const void Set( vtkm::Id index, const ValueType &value ) const
{ {
if( index < this->portal1.GetNumberOfValues() ) if( index < this->portal1.GetNumberOfValues() )
@ -72,13 +72,13 @@ public:
this->portal2.Set( index - this->portal1.GetNumberOfValues(), value ); this->portal2.Set( index - this->portal1.GetNumberOfValues(), value );
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalType1 &GetPortal1() const const PortalType1 &GetPortal1() const
{ {
return this->portal1; return this->portal1;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalType2 &GetPortal2() const const PortalType2 &GetPortal2() const
{ {
return this->portal2; return this->portal2;
@ -110,14 +110,14 @@ public:
typename ArrayHandleType1::PortalConstControl, typename ArrayHandleType1::PortalConstControl,
typename ArrayHandleType2::PortalConstControl > PortalConstType; typename ArrayHandleType2::PortalConstControl > PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : valid( false ) { } Storage() : valid( false ) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage( const ArrayHandleType1 &a1, const ArrayHandleType2 &a2 ) Storage( const ArrayHandleType1 &a1, const ArrayHandleType2 &a2 )
: array1( a1 ), array2( a2 ), valid( true ) {}; : array1( a1 ), array2( a2 ), valid( true ) {};
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
@ -125,7 +125,7 @@ public:
this->array2.GetPortalConstControl() ); this->array2.GetPortalConstControl() );
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() PortalType GetPortal()
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
@ -133,21 +133,21 @@ public:
this->array2.GetPortalControl() ); this->array2.GetPortalControl() );
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
return this->array1.GetNumberOfValues() + this->array2.GetNumberOfValues(); return this->array1.GetNumberOfValues() + this->array2.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate( vtkm::Id vtkmNotUsed(numberOfValues) ) void Allocate( vtkm::Id vtkmNotUsed(numberOfValues) )
{ {
throw vtkm::cont::ErrorControlInternal( throw vtkm::cont::ErrorControlInternal(
"ArrayHandleConcatenate should not be allocated explicitly. " ); "ArrayHandleConcatenate should not be allocated explicitly. " );
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink( vtkm::Id numberOfValues ) void Shrink( vtkm::Id numberOfValues )
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
@ -160,7 +160,7 @@ public:
this->array2.Shrink( numberOfValues - this->array1.GetNumberOfValues() ); this->array2.Shrink( numberOfValues - this->array1.GetNumberOfValues() );
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources( ) void ReleaseResources( )
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
@ -168,14 +168,14 @@ public:
this->array2.ReleaseResources(); this->array2.ReleaseResources();
} }
VTKM_CONT_EXPORT VTKM_CONT
const ArrayHandleType1 &GetArray1() const const ArrayHandleType1 &GetArray1() const
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
return this->array1; return this->array1;
} }
VTKM_CONT_EXPORT VTKM_CONT
const ArrayHandleType2 &GetArray2() const const ArrayHandleType2 &GetArray2() const
{ {
VTKM_ASSERT( this->valid ); VTKM_ASSERT( this->valid );
@ -214,44 +214,44 @@ public:
typename ArrayHandleType2::template ExecutionTypes< Device >::PortalConst > typename ArrayHandleType2::template ExecutionTypes< Device >::PortalConst >
PortalConstExecution; PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer( StorageType* storage ) ArrayTransfer( StorageType* storage )
: array1( storage->GetArray1() ), array2( storage->GetArray2() ) {} : array1( storage->GetArray1() ), array2( storage->GetArray2() ) {}
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->array1.GetNumberOfValues() + this->array2.GetNumberOfValues() ; return this->array1.GetNumberOfValues() + this->array2.GetNumberOfValues() ;
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput( bool vtkmNotUsed( updateData ) ) PortalConstExecution PrepareForInput( bool vtkmNotUsed( updateData ) )
{ {
return PortalConstExecution( this->array1.PrepareForInput( Device() ), return PortalConstExecution( this->array1.PrepareForInput( Device() ),
this->array2.PrepareForInput( Device() )); this->array2.PrepareForInput( Device() ));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace( bool vtkmNotUsed( updateData ) ) PortalExecution PrepareForInPlace( bool vtkmNotUsed( updateData ) )
{ {
return PortalExecution( this->array1.PrepareForInPlace( Device() ), return PortalExecution( this->array1.PrepareForInPlace( Device() ),
this->array2.PrepareForInPlace( Device() )); this->array2.PrepareForInPlace( Device() ));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput( vtkm::Id vtkmNotUsed(numberOfValues) ) PortalExecution PrepareForOutput( vtkm::Id vtkmNotUsed(numberOfValues) )
{ {
throw vtkm::cont::ErrorControlInternal( throw vtkm::cont::ErrorControlInternal(
"ArrayHandleConcatenate is derived and read-only. " ); "ArrayHandleConcatenate is derived and read-only. " );
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData( StorageType* vtkmNotUsed(storage) ) const void RetrieveOutputData( StorageType* vtkmNotUsed(storage) ) const
{ {
// not need to implement // not need to implement
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink( vtkm::Id numberOfValues ) void Shrink( vtkm::Id numberOfValues )
{ {
if( numberOfValues < this->array1.GetNumberOfValues() ) if( numberOfValues < this->array1.GetNumberOfValues() )
@ -263,7 +263,7 @@ public:
this->array2.Shrink( numberOfValues - this->array1.GetNumberOfValues() ); this->array2.Shrink( numberOfValues - this->array1.GetNumberOfValues() );
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
this->array1.ReleaseResourcesExecution(); this->array1.ReleaseResourcesExecution();
@ -301,7 +301,7 @@ protected:
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleConcatenate( const ArrayHandleType1 &array1, ArrayHandleConcatenate( const ArrayHandleType1 &array1,
const ArrayHandleType2 &array2 ) const ArrayHandleType2 &array2 )
: Superclass( StorageType( array1, array2 ) ) : Superclass( StorageType( array1, array2 ) )
@ -311,7 +311,7 @@ public:
template< typename ArrayHandleType1, typename ArrayHandleType2 > template< typename ArrayHandleType1, typename ArrayHandleType2 >
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleConcatenate< ArrayHandleType1, ArrayHandleType2 > ArrayHandleConcatenate< ArrayHandleType1, ArrayHandleType2 >
make_ArrayHandleConcatenate( const ArrayHandleType1 &array1, make_ArrayHandleConcatenate( const ArrayHandleType1 &array1,
const ArrayHandleType2 &array2 ) const ArrayHandleType2 &array2 )

@ -32,10 +32,10 @@ namespace detail {
template<typename ValueType> template<typename ValueType>
struct ConstantFunctor struct ConstantFunctor
{ {
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ConstantFunctor(const ValueType &value = ValueType()) : Value(value) { } ConstantFunctor(const ValueType &value = ValueType()) : Value(value) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType operator()(vtkm::Id vtkmNotUsed(index)) const ValueType operator()(vtkm::Id vtkmNotUsed(index)) const
{ {
return this->Value; return this->Value;
@ -65,7 +65,7 @@ public:
(ArrayHandleConstant<T>), (ArrayHandleConstant<T>),
(vtkm::cont::ArrayHandleImplicit<T, detail::ConstantFunctor<T> >)); (vtkm::cont::ArrayHandleImplicit<T, detail::ConstantFunctor<T> >));
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleConstant(T value, vtkm::Id numberOfValues = 0) ArrayHandleConstant(T value, vtkm::Id numberOfValues = 0)
: Superclass(detail::ConstantFunctor<T>(value), numberOfValues) { } : Superclass(detail::ConstantFunctor<T>(value), numberOfValues) { }
}; };

@ -40,14 +40,14 @@ class ArrayPortalCounting
public: public:
typedef CountingValueType ValueType; typedef CountingValueType ValueType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalCounting() : ArrayPortalCounting() :
Start(0), Start(0),
Step(1), Step(1),
NumberOfValues(0) NumberOfValues(0)
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalCounting(ValueType start, ValueType step, vtkm::Id numValues) : ArrayPortalCounting(ValueType start, ValueType step, vtkm::Id numValues) :
Start(start), Start(start),
Step(step), Step(step),
@ -55,7 +55,7 @@ public:
{ } { }
template<typename OtherValueType> template<typename OtherValueType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalCounting(const ArrayPortalCounting<OtherValueType> &src) ArrayPortalCounting(const ArrayPortalCounting<OtherValueType> &src)
: Start(src.Start), : Start(src.Start),
Step(src.Step), Step(src.Step),
@ -63,7 +63,7 @@ public:
{ } { }
template<typename OtherValueType> template<typename OtherValueType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalCounting<ValueType> &operator=( ArrayPortalCounting<ValueType> &operator=(
const ArrayPortalCounting<OtherValueType> &src) const ArrayPortalCounting<OtherValueType> &src)
{ {
@ -73,10 +73,10 @@ public:
return *this; return *this;
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; } vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const { ValueType Get(vtkm::Id index) const {
return ValueType(this->Start + return ValueType(this->Start +
this->Step*ValueType(static_cast<ComponentType>(index))); this->Step*ValueType(static_cast<ComponentType>(index)));
@ -118,7 +118,7 @@ public:
typename internal::ArrayHandleCountingTraits<CountingValueType>::Tag typename internal::ArrayHandleCountingTraits<CountingValueType>::Tag
>)); >));
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCounting(CountingValueType start, ArrayHandleCounting(CountingValueType start,
CountingValueType step, CountingValueType step,
vtkm::Id length) vtkm::Id length)
@ -130,7 +130,7 @@ public:
/// A convenience function for creating an ArrayHandleCounting. It takes the /// A convenience function for creating an ArrayHandleCounting. It takes the
/// value to start counting from and and the number of times to increment. /// value to start counting from and and the number of times to increment.
template<typename CountingValueType> template<typename CountingValueType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleCounting<CountingValueType> vtkm::cont::ArrayHandleCounting<CountingValueType>
make_ArrayHandleCounting(CountingValueType start, make_ArrayHandleCounting(CountingValueType start,
CountingValueType step, CountingValueType step,

@ -42,11 +42,11 @@ public:
typedef vtkm::Vec<ComponentType, NUM_COMPONENTS> ValueType; typedef vtkm::Vec<ComponentType, NUM_COMPONENTS> ValueType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalGroupVec() : SourcePortal() { } ArrayPortalGroupVec() : SourcePortal() { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalGroupVec(const SourcePortalType &sourcePortal) ArrayPortalGroupVec(const SourcePortalType &sourcePortal)
: SourcePortal(sourcePortal) { } : SourcePortal(sourcePortal) { }
@ -55,20 +55,20 @@ public:
/// casting that the portals do (like the non-const to const cast). /// casting that the portals do (like the non-const to const cast).
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
template<typename OtherSourcePortalType> template<typename OtherSourcePortalType>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalGroupVec( ArrayPortalGroupVec(
const ArrayPortalGroupVec<OtherSourcePortalType, NUM_COMPONENTS> &src) const ArrayPortalGroupVec<OtherSourcePortalType, NUM_COMPONENTS> &src)
: SourcePortal(src.GetPortal()) { } : SourcePortal(src.GetPortal()) { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->SourcePortal.GetNumberOfValues()/NUM_COMPONENTS; return this->SourcePortal.GetNumberOfValues()/NUM_COMPONENTS;
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const ValueType Get(vtkm::Id index) const
{ {
ValueType result; ValueType result;
@ -84,7 +84,7 @@ public:
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Set(vtkm::Id index, const ValueType &value) const void Set(vtkm::Id index, const ValueType &value) const
{ {
vtkm::Id sourceIndex = index*NUM_COMPONENTS; vtkm::Id sourceIndex = index*NUM_COMPONENTS;
@ -98,7 +98,7 @@ public:
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const SourcePortalType &GetPortal() const { return this->SourcePortal; } const SourcePortalType &GetPortal() const { return this->SourcePortal; }
private: private:
@ -136,28 +136,28 @@ public:
typename SourceArrayHandleType::PortalConstControl, typename SourceArrayHandleType::PortalConstControl,
NUM_COMPONENTS> PortalConstType; NUM_COMPONENTS> PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : Valid(false) { } Storage() : Valid(false) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const SourceArrayHandleType &sourceArray) Storage(const SourceArrayHandleType &sourceArray)
: SourceArray(sourceArray), Valid(true) { } : SourceArray(sourceArray), Valid(true) { }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() PortalType GetPortal()
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalType(this->SourceArray.GetPortalControl()); return PortalType(this->SourceArray.GetPortalControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalConstType(this->SourceArray.GetPortalConstControl()); return PortalConstType(this->SourceArray.GetPortalConstControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
@ -170,21 +170,21 @@ public:
return sourceSize/NUM_COMPONENTS; return sourceSize/NUM_COMPONENTS;
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues) void Allocate(vtkm::Id numberOfValues)
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
this->SourceArray.Allocate(numberOfValues*NUM_COMPONENTS); this->SourceArray.Allocate(numberOfValues*NUM_COMPONENTS);
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) void Shrink(vtkm::Id numberOfValues)
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
this->SourceArray.Shrink(numberOfValues*NUM_COMPONENTS); this->SourceArray.Shrink(numberOfValues*NUM_COMPONENTS);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
if (this->Valid) if (this->Valid)
@ -194,7 +194,7 @@ public:
} }
// Required for later use in ArrayTransfer class // Required for later use in ArrayTransfer class
VTKM_CONT_EXPORT VTKM_CONT
const SourceArrayHandleType &GetSourceArray() const const SourceArrayHandleType &GetSourceArray() const
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
@ -237,11 +237,11 @@ public:
NUM_COMPONENTS> NUM_COMPONENTS>
PortalConstExecution; PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) ArrayTransfer(StorageType *storage)
: SourceArray(storage->GetSourceArray()) { } : SourceArray(storage->GetSourceArray()) { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
vtkm::Id sourceSize = this->SourceArray.GetNumberOfValues(); vtkm::Id sourceSize = this->SourceArray.GetNumberOfValues();
@ -253,7 +253,7 @@ public:
return sourceSize/NUM_COMPONENTS; return sourceSize/NUM_COMPONENTS;
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData))
{ {
if (this->SourceArray.GetNumberOfValues()%NUM_COMPONENTS != 0) if (this->SourceArray.GetNumberOfValues()%NUM_COMPONENTS != 0)
@ -264,7 +264,7 @@ public:
return PortalConstExecution(this->SourceArray.PrepareForInput(Device())); return PortalConstExecution(this->SourceArray.PrepareForInput(Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData))
{ {
if (this->SourceArray.GetNumberOfValues()%NUM_COMPONENTS != 0) if (this->SourceArray.GetNumberOfValues()%NUM_COMPONENTS != 0)
@ -275,14 +275,14 @@ public:
return PortalExecution(this->SourceArray.PrepareForInPlace(Device())); return PortalExecution(this->SourceArray.PrepareForInPlace(Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id numberOfValues) PortalExecution PrepareForOutput(vtkm::Id numberOfValues)
{ {
return PortalExecution(this->SourceArray.PrepareForOutput( return PortalExecution(this->SourceArray.PrepareForOutput(
numberOfValues*NUM_COMPONENTS, Device())); numberOfValues*NUM_COMPONENTS, Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const
{ {
// Implementation of this method should be unnecessary. The internal // Implementation of this method should be unnecessary. The internal
@ -290,13 +290,13 @@ public:
// necessary. // necessary.
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) void Shrink(vtkm::Id numberOfValues)
{ {
this->SourceArray.Shrink(numberOfValues*NUM_COMPONENTS); this->SourceArray.Shrink(numberOfValues*NUM_COMPONENTS);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
this->SourceArray.ReleaseResourcesExecution(); this->SourceArray.ReleaseResourcesExecution();
@ -344,7 +344,7 @@ private:
typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType; typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleGroupVec(const SourceArrayHandleType &sourceArray) ArrayHandleGroupVec(const SourceArrayHandleType &sourceArray)
: Superclass(StorageType(sourceArray)) { } : Superclass(StorageType(sourceArray)) { }
}; };
@ -356,7 +356,7 @@ public:
/// ///
template<vtkm::IdComponent NUM_COMPONENTS, template<vtkm::IdComponent NUM_COMPONENTS,
typename ArrayHandleType> typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleGroupVec<ArrayHandleType, NUM_COMPONENTS> vtkm::cont::ArrayHandleGroupVec<ArrayHandleType, NUM_COMPONENTS>
make_ArrayHandleGroupVec(const ArrayHandleType &array) make_ArrayHandleGroupVec(const ArrayHandleType &array)
{ {

@ -46,27 +46,27 @@ public:
typedef ValueType_ ValueType; typedef ValueType_ ValueType;
typedef FunctorType_ FunctorType; typedef FunctorType_ FunctorType;
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalImplicit() : ArrayPortalImplicit() :
Functor(), Functor(),
NumberOfValues(0) { } NumberOfValues(0) { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalImplicit(FunctorType f, vtkm::Id numValues) : ArrayPortalImplicit(FunctorType f, vtkm::Id numValues) :
Functor(f), Functor(f),
NumberOfValues(numValues) NumberOfValues(numValues)
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; } vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const { return this->Functor(index); } ValueType Get(vtkm::Id index) const { return this->Functor(index); }
typedef vtkm::cont::internal::IteratorFromArrayPortal< typedef vtkm::cont::internal::IteratorFromArrayPortal<
ArrayPortalImplicit<ValueType,FunctorType> > IteratorType; ArrayPortalImplicit<ValueType,FunctorType> > IteratorType;
VTKM_CONT_EXPORT VTKM_CONT
IteratorType GetIteratorBegin() const IteratorType GetIteratorBegin() const
{ {
return IteratorType(*this); return IteratorType(*this);
@ -112,7 +112,7 @@ public:
(ArrayHandleImplicit<T,FunctorType>), (ArrayHandleImplicit<T,FunctorType>),
(typename ArrayTraits::Superclass)); (typename ArrayTraits::Superclass));
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleImplicit(FunctorType functor, vtkm::Id length) ArrayHandleImplicit(FunctorType functor, vtkm::Id length)
: Superclass(typename Superclass::PortalConstControl(functor,length)) : Superclass(typename Superclass::PortalConstControl(functor,length))
{ } { }
@ -123,7 +123,7 @@ public:
/// arry. /// arry.
template <typename T, typename FunctorType> template <typename T, typename FunctorType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleImplicit<T, FunctorType> vtkm::cont::ArrayHandleImplicit<T, FunctorType>
make_ArrayHandleImplicit(FunctorType functor, vtkm::Id length) make_ArrayHandleImplicit(FunctorType functor, vtkm::Id length)
{ {

@ -30,7 +30,7 @@ namespace cont {
namespace detail { namespace detail {
struct IndexFunctor { struct IndexFunctor {
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id operator()(vtkm::Id index) const { return index; } vtkm::Id operator()(vtkm::Id index) const { return index; }
}; };
@ -50,7 +50,7 @@ public:
ArrayHandleIndex, ArrayHandleIndex,
(vtkm::cont::ArrayHandleImplicit<vtkm::Id, detail::IndexFunctor>)); (vtkm::cont::ArrayHandleImplicit<vtkm::Id, detail::IndexFunctor>));
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleIndex(vtkm::Id length) ArrayHandleIndex(vtkm::Id length)
: Superclass(detail::IndexFunctor(), length) { } : Superclass(detail::IndexFunctor(), length) { }
}; };

@ -37,12 +37,12 @@ public:
typedef typename ValuePortalType::ValueType ValueType; typedef typename ValuePortalType::ValueType ValueType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalPermutation( ) ArrayPortalPermutation( )
: IndexPortal(), ValuePortal() { } : IndexPortal(), ValuePortal() { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalPermutation( ArrayPortalPermutation(
const IndexPortalType &indexPortal, const IndexPortalType &indexPortal,
const ValuePortalType &valuePortal) const ValuePortalType &valuePortal)
@ -55,38 +55,38 @@ public:
/// ///
template<typename OtherIP, typename OtherVP> template<typename OtherIP, typename OtherVP>
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalPermutation( ArrayPortalPermutation(
const ArrayPortalPermutation<OtherIP,OtherVP> &src) const ArrayPortalPermutation<OtherIP,OtherVP> &src)
: IndexPortal(src.GetIndexPortal()), ValuePortal(src.GetValuePortal()) : IndexPortal(src.GetIndexPortal()), ValuePortal(src.GetValuePortal())
{ } { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->IndexPortal.GetNumberOfValues(); return this->IndexPortal.GetNumberOfValues();
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_EXPORT VTKM_EXEC
ValueType Get(vtkm::Id index) const { ValueType Get(vtkm::Id index) const {
vtkm::Id permutedIndex = this->IndexPortal.Get(index); vtkm::Id permutedIndex = this->IndexPortal.Get(index);
return this->ValuePortal.Get(permutedIndex); return this->ValuePortal.Get(permutedIndex);
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_EXPORT VTKM_EXEC
void Set(vtkm::Id index, const ValueType &value) const { void Set(vtkm::Id index, const ValueType &value) const {
vtkm::Id permutedIndex = this->IndexPortal.Get(index); vtkm::Id permutedIndex = this->IndexPortal.Get(index);
this->ValuePortal.Set(permutedIndex, value); this->ValuePortal.Set(permutedIndex, value);
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const IndexPortalType &GetIndexPortal() const { return this->IndexPortal; } const IndexPortalType &GetIndexPortal() const { return this->IndexPortal; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const ValuePortalType &GetValuePortal() const { return this->ValuePortal; } const ValuePortalType &GetValuePortal() const { return this->ValuePortal; }
private: private:
@ -124,56 +124,56 @@ public:
typename IndexArrayType::PortalConstControl, typename IndexArrayType::PortalConstControl,
typename ValueArrayType::PortalConstControl> PortalConstType; typename ValueArrayType::PortalConstControl> PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : Valid(false) { } Storage() : Valid(false) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const IndexArrayType &indexArray, const ValueArrayType &valueArray) Storage(const IndexArrayType &indexArray, const ValueArrayType &valueArray)
: IndexArray(indexArray), ValueArray(valueArray), Valid(true) { } : IndexArray(indexArray), ValueArray(valueArray), Valid(true) { }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() { PortalType GetPortal() {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalType(this->IndexArray.GetPortalConstControl(), return PortalType(this->IndexArray.GetPortalConstControl(),
this->ValueArray.GetPortalControl()); this->ValueArray.GetPortalControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const { PortalConstType GetPortalConst() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalConstType(this->IndexArray.GetPortalConstControl(), return PortalConstType(this->IndexArray.GetPortalConstControl(),
this->ValueArray.GetPortalConstControl()); this->ValueArray.GetPortalConstControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->IndexArray.GetNumberOfValues(); return this->IndexArray.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) { void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandlePermutation cannot be allocated."); "ArrayHandlePermutation cannot be allocated.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) { void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandlePermutation cannot shrink."); "ArrayHandlePermutation cannot shrink.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
// This request is ignored since it is asking to release the resources // This request is ignored since it is asking to release the resources
// of the delegate array, which may be used elsewhere. Should the behavior // of the delegate array, which may be used elsewhere. Should the behavior
// be different? // be different?
} }
VTKM_CONT_EXPORT VTKM_CONT
const IndexArrayType &GetIndexArray() const { return this->IndexArray; } const IndexArrayType &GetIndexArray() const { return this->IndexArray; }
VTKM_CONT_EXPORT VTKM_CONT
const ValueArrayType &GetValueArray() const { return this->ValueArray; } const ValueArrayType &GetValueArray() const { return this->ValueArray; }
private: private:
@ -208,29 +208,29 @@ public:
typename ValueArrayType::template ExecutionTypes<Device>::PortalConst> typename ValueArrayType::template ExecutionTypes<Device>::PortalConst>
PortalConstExecution; PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) ArrayTransfer(StorageType *storage)
: IndexArray(storage->GetIndexArray()), : IndexArray(storage->GetIndexArray()),
ValueArray(storage->GetValueArray()) { } ValueArray(storage->GetValueArray()) { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->IndexArray.GetNumberOfValues(); return this->IndexArray.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) { PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) {
return PortalConstExecution(this->IndexArray.PrepareForInput(Device()), return PortalConstExecution(this->IndexArray.PrepareForInput(Device()),
this->ValueArray.PrepareForInput(Device())); this->ValueArray.PrepareForInput(Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) { PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) {
return PortalExecution(this->IndexArray.PrepareForInput(Device()), return PortalExecution(this->IndexArray.PrepareForInput(Device()),
this->ValueArray.PrepareForInPlace(Device())); this->ValueArray.PrepareForInPlace(Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id numberOfValues) PortalExecution PrepareForOutput(vtkm::Id numberOfValues)
{ {
if (numberOfValues != this->GetNumberOfValues()) { if (numberOfValues != this->GetNumberOfValues()) {
@ -256,20 +256,20 @@ public:
this->ValueArray.GetNumberOfValues(), Device())); this->ValueArray.GetNumberOfValues(), Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const { void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const {
// Implementation of this method should be unnecessary. The internal // Implementation of this method should be unnecessary. The internal
// array handles should automatically retrieve the output data as // array handles should automatically retrieve the output data as
// necessary. // necessary.
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) { void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandlePermutation cannot shrink."); "ArrayHandlePermutation cannot shrink.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->IndexArray.ReleaseResourcesExecution(); this->IndexArray.ReleaseResourcesExecution();
this->ValueArray.ReleaseResourcesExecution(); this->ValueArray.ReleaseResourcesExecution();
@ -330,7 +330,7 @@ private:
StorageType; StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandlePermutation(const IndexArrayHandleType &indexArray, ArrayHandlePermutation(const IndexArrayHandleType &indexArray,
const ValueArrayHandleType &valueArray) const ValueArrayHandleType &valueArray)
: Superclass(StorageType(indexArray, valueArray)) { } : Superclass(StorageType(indexArray, valueArray)) { }
@ -341,7 +341,7 @@ private:
/// to apply to each element of the Handle. /// to apply to each element of the Handle.
template <typename IndexArrayHandleType, typename ValueArrayHandleType> template <typename IndexArrayHandleType, typename ValueArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandlePermutation<IndexArrayHandleType, ValueArrayHandleType> vtkm::cont::ArrayHandlePermutation<IndexArrayHandleType, ValueArrayHandleType>
make_ArrayHandlePermutation(IndexArrayHandleType indexArray, make_ArrayHandlePermutation(IndexArrayHandleType indexArray,
ValueArrayHandleType valueArray) ValueArrayHandleType valueArray)

@ -35,11 +35,11 @@ public:
typedef typename PortalType::ValueType ValueType; typedef typename PortalType::ValueType ValueType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalStreaming() : InputPortal(), BlockIndex(0), BlockSize(0), CurBlockSize(0) { } ArrayPortalStreaming() : InputPortal(), BlockIndex(0), BlockSize(0), CurBlockSize(0) { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalStreaming(const PortalType &inputPortal, vtkm::Id blockIndex, ArrayPortalStreaming(const PortalType &inputPortal, vtkm::Id blockIndex,
vtkm::Id blockSize, vtkm::Id curBlockSize) : vtkm::Id blockSize, vtkm::Id curBlockSize) :
InputPortal(inputPortal), BlockIndex(blockIndex), InputPortal(inputPortal), BlockIndex(blockIndex),
@ -47,7 +47,7 @@ public:
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
template<typename OtherP> template<typename OtherP>
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalStreaming(const ArrayPortalStreaming<OtherP> &src) : ArrayPortalStreaming(const ArrayPortalStreaming<OtherP> &src) :
InputPortal(src.GetPortal()), InputPortal(src.GetPortal()),
BlockIndex(src.GetBlockIndex()), BlockIndex(src.GetBlockIndex()),
@ -55,48 +55,48 @@ public:
CurBlockSize(src.GetCurBlockSize()) { } CurBlockSize(src.GetCurBlockSize()) { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->CurBlockSize; return this->CurBlockSize;
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const { ValueType Get(vtkm::Id index) const {
return this->InputPortal.Get(BlockIndex*BlockSize + index); return this->InputPortal.Get(BlockIndex*BlockSize + index);
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Set(vtkm::Id index, const ValueType &value) const { void Set(vtkm::Id index, const ValueType &value) const {
this->InputPortal.Set(BlockIndex*BlockSize + index, value); this->InputPortal.Set(BlockIndex*BlockSize + index, value);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalType &GetPortal() const { return this->InputPortal; } const PortalType &GetPortal() const { return this->InputPortal; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void SetBlockSize(vtkm::Id blockSize) { BlockSize = blockSize; } void SetBlockSize(vtkm::Id blockSize) { BlockSize = blockSize; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void SetBlockIndex(vtkm::Id blockIndex) { BlockIndex = blockIndex; } void SetBlockIndex(vtkm::Id blockIndex) { BlockIndex = blockIndex; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void SetCurBlockSize(vtkm::Id curBlockSize) { CurBlockSize = curBlockSize; } void SetCurBlockSize(vtkm::Id curBlockSize) { CurBlockSize = curBlockSize; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetBlockSize() { return this->BlockSize; } vtkm::Id GetBlockSize() { return this->BlockSize; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetBlockIndex() { return this->BlockIndex; } vtkm::Id GetBlockIndex() { return this->BlockIndex; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetCurBlockSize() { return this->CurBlockSize; } vtkm::Id GetCurBlockSize() { return this->CurBlockSize; }
private: private:
@ -126,60 +126,60 @@ public:
typedef vtkm::cont::internal::ArrayPortalStreaming< typedef vtkm::cont::internal::ArrayPortalStreaming<
typename ArrayHandleInputType::PortalConstControl> PortalConstType; typename ArrayHandleInputType::PortalConstControl> PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : Valid(false) { } Storage() : Valid(false) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const ArrayHandleInputType inputArray, vtkm::Id blockSize, Storage(const ArrayHandleInputType inputArray, vtkm::Id blockSize,
vtkm::Id blockIndex, vtkm::Id curBlockSize) : vtkm::Id blockIndex, vtkm::Id curBlockSize) :
InputArray(inputArray), BlockSize(blockSize), InputArray(inputArray), BlockSize(blockSize),
BlockIndex(blockIndex), CurBlockSize(curBlockSize), Valid(true) { } BlockIndex(blockIndex), CurBlockSize(curBlockSize), Valid(true) { }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() { PortalType GetPortal() {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalType(this->InputArray.GetPortalControl(), return PortalType(this->InputArray.GetPortalControl(),
BlockSize, BlockIndex, CurBlockSize); BlockSize, BlockIndex, CurBlockSize);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const { PortalConstType GetPortalConst() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalConstType(this->InputArray.GetPortalConstControl(), return PortalConstType(this->InputArray.GetPortalConstControl(),
BlockSize, BlockIndex, CurBlockSize); BlockSize, BlockIndex, CurBlockSize);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return CurBlockSize; return CurBlockSize;
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues) const { void Allocate(vtkm::Id numberOfValues) const {
(void)numberOfValues; (void)numberOfValues;
// Do nothing, since we only allocate a streaming array once at the beginning // Do nothing, since we only allocate a streaming array once at the beginning
} }
VTKM_CONT_EXPORT VTKM_CONT
void AllocateFullArray(vtkm::Id numberOfValues) { void AllocateFullArray(vtkm::Id numberOfValues) {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
this->InputArray.Allocate(numberOfValues); this->InputArray.Allocate(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) { void Shrink(vtkm::Id numberOfValues) {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
this->InputArray.Shrink(numberOfValues); this->InputArray.Shrink(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
this->InputArray.ReleaseResources(); this->InputArray.ReleaseResources();
} }
VTKM_CONT_EXPORT VTKM_CONT
const ArrayHandleInputType &GetArray() const { const ArrayHandleInputType &GetArray() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->InputArray; return this->InputArray;
@ -218,7 +218,7 @@ private:
typedef vtkm::cont::internal::Storage<ValueType,StorageTag> StorageType; typedef vtkm::cont::internal::Storage<ValueType,StorageTag> StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleStreaming(const ArrayHandleInputType &inputArray, ArrayHandleStreaming(const ArrayHandleInputType &inputArray,
const vtkm::Id blockIndex, const vtkm::Id blockSize, const vtkm::Id blockIndex, const vtkm::Id blockSize,
const vtkm::Id curBlockSize) const vtkm::Id curBlockSize)
@ -229,7 +229,7 @@ public:
this->GetPortalConstControl().SetCurBlockSize(curBlockSize); this->GetPortalConstControl().SetCurBlockSize(curBlockSize);
} }
VTKM_CONT_EXPORT VTKM_CONT
void AllocateFullArray(vtkm::Id numberOfValues) { void AllocateFullArray(vtkm::Id numberOfValues) {
this->ReleaseResourcesExecutionInternal(); this->ReleaseResourcesExecutionInternal();
this->Internals->ControlArray.AllocateFullArray(numberOfValues); this->Internals->ControlArray.AllocateFullArray(numberOfValues);

@ -58,7 +58,7 @@ public:
typedef FunctorType_ FunctorType; typedef FunctorType_ FunctorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalTransform(const PortalType &portal = PortalType(), ArrayPortalTransform(const PortalType &portal = PortalType(),
const FunctorType &functor = FunctorType()) const FunctorType &functor = FunctorType())
: Portal(portal), Functor(functor) : Portal(portal), Functor(functor)
@ -70,30 +70,30 @@ public:
/// ///
template<class OtherV, class OtherP, class OtherF> template<class OtherV, class OtherP, class OtherF>
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalTransform(const ArrayPortalTransform<OtherV,OtherP,OtherF> &src) ArrayPortalTransform(const ArrayPortalTransform<OtherV,OtherP,OtherF> &src)
: Portal(src.GetPortal()), : Portal(src.GetPortal()),
Functor(src.GetFunctor()) Functor(src.GetFunctor())
{ } { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->Portal.GetNumberOfValues(); return this->Portal.GetNumberOfValues();
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const { ValueType Get(vtkm::Id index) const {
return this->Functor(this->Portal.Get(index)); return this->Functor(this->Portal.Get(index));
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalType &GetPortal() const { return this->Portal; } const PortalType &GetPortal() const { return this->Portal; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const FunctorType &GetFunctor() const { return this->Functor; } const FunctorType &GetFunctor() const { return this->Functor; }
protected: protected:
@ -113,7 +113,7 @@ public:
typedef InverseFunctorType_ InverseFunctorType; typedef InverseFunctorType_ InverseFunctorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalTransform(const PortalType &portal = PortalType(), ArrayPortalTransform(const PortalType &portal = PortalType(),
const FunctorType &functor = FunctorType(), const FunctorType &functor = FunctorType(),
const InverseFunctorType& inverseFunctor = InverseFunctorType()) const InverseFunctorType& inverseFunctor = InverseFunctorType())
@ -122,19 +122,19 @@ public:
template<class OtherV, class OtherP, class OtherF, class OtherInvF> template<class OtherV, class OtherP, class OtherF, class OtherInvF>
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalTransform(const ArrayPortalTransform<OtherV,OtherP,OtherF,OtherInvF> &src) ArrayPortalTransform(const ArrayPortalTransform<OtherV,OtherP,OtherF,OtherInvF> &src)
: Superclass(src), InverseFunctor(src.GetInverseFunctor()) : Superclass(src), InverseFunctor(src.GetInverseFunctor())
{ } { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Set(vtkm::Id index, const ValueType& value) const { void Set(vtkm::Id index, const ValueType& value) const {
return this->Portal.Set(index,this->InverseFunctor(value)); return this->Portal.Set(index,this->InverseFunctor(value));
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const InverseFunctorType &GetInverseFunctor() const { const InverseFunctorType &GetInverseFunctor() const {
return this->InverseFunctor; } return this->InverseFunctor; }
@ -175,60 +175,60 @@ public:
ValueType, typename ArrayHandleType::PortalConstControl, FunctorType> ValueType, typename ArrayHandleType::PortalConstControl, FunctorType>
PortalConstType; PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : Valid(false) { } Storage() : Valid(false) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const ArrayHandleType &array, Storage(const ArrayHandleType &array,
const FunctorType &functor = FunctorType()) const FunctorType &functor = FunctorType())
: Array(array), Functor(functor), Valid(true) { } : Array(array), Functor(functor), Valid(true) { }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() { PortalType GetPortal() {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalType(this->Array.GetPortalControl(), return PortalType(this->Array.GetPortalControl(),
this->Functor); this->Functor);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const { PortalConstType GetPortalConst() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalConstType(this->Array.GetPortalConstControl(), return PortalConstType(this->Array.GetPortalConstControl(),
this->Functor); this->Functor);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->Array.GetNumberOfValues(); return this->Array.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) { void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandleTransform is read only. It cannot be allocated."); "ArrayHandleTransform is read only. It cannot be allocated.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) { void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandleTransform is read only. It cannot shrink."); "ArrayHandleTransform is read only. It cannot shrink.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
// This request is ignored since it is asking to release the resources // This request is ignored since it is asking to release the resources
// of the delegate array, which may be used elsewhere. Should the behavior // of the delegate array, which may be used elsewhere. Should the behavior
// be different? // be different?
} }
VTKM_CONT_EXPORT VTKM_CONT
const ArrayHandleType &GetArray() const { const ArrayHandleType &GetArray() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->Array; return this->Array;
} }
VTKM_CONT_EXPORT VTKM_CONT
const FunctorType &GetFunctor() const { const FunctorType &GetFunctor() const {
return this->Functor; return this->Functor;
} }
@ -254,16 +254,16 @@ public:
typename ArrayHandleType::PortalConstControl,FunctorType,InverseFunctorType> typename ArrayHandleType::PortalConstControl,FunctorType,InverseFunctorType>
PortalConstType; PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : Valid(false) { } Storage() : Valid(false) { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const ArrayHandleType &array, Storage(const ArrayHandleType &array,
const FunctorType &functor, const FunctorType &functor,
const InverseFunctorType &inverseFunctor) const InverseFunctorType &inverseFunctor)
: Array(array), Functor(functor), InverseFunctor(inverseFunctor), Valid(true) { } : Array(array), Functor(functor), InverseFunctor(inverseFunctor), Valid(true) { }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() { PortalType GetPortal() {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalType(this->Array.GetPortalControl(), return PortalType(this->Array.GetPortalControl(),
@ -271,7 +271,7 @@ public:
this->InverseFunctor); this->InverseFunctor);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const { PortalConstType GetPortalConst() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return PortalConstType(this->Array.GetPortalConstControl(), return PortalConstType(this->Array.GetPortalConstControl(),
@ -279,41 +279,41 @@ public:
this->InverseFunctor); this->InverseFunctor);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->Array.GetNumberOfValues(); return this->Array.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues) { void Allocate(vtkm::Id numberOfValues) {
this->Array.Allocate(numberOfValues); this->Array.Allocate(numberOfValues);
this->Valid = true; this->Valid = true;
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) { void Shrink(vtkm::Id numberOfValues) {
this->Array.Shrink(numberOfValues); this->Array.Shrink(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->Array.ReleaseResources(); this->Array.ReleaseResources();
this->Valid = false; this->Valid = false;
} }
VTKM_CONT_EXPORT VTKM_CONT
const ArrayHandleType &GetArray() const { const ArrayHandleType &GetArray() const {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
return this->Array; return this->Array;
} }
VTKM_CONT_EXPORT VTKM_CONT
const FunctorType &GetFunctor() const { const FunctorType &GetFunctor() const {
return this->Functor; return this->Functor;
} }
VTKM_CONT_EXPORT VTKM_CONT
const InverseFunctorType &GetInverseFunctor() const { const InverseFunctorType &GetInverseFunctor() const {
return this->InverseFunctor; return this->InverseFunctor;
} }
@ -348,34 +348,34 @@ public:
typename ArrayHandleType::template ExecutionTypes<Device>::PortalConst, typename ArrayHandleType::template ExecutionTypes<Device>::PortalConst,
FunctorType> PortalConstExecution; FunctorType> PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) ArrayTransfer(StorageType *storage)
: Array(storage->GetArray()), Functor(storage->GetFunctor()) { } : Array(storage->GetArray()), Functor(storage->GetFunctor()) { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->Array.GetNumberOfValues(); return this->Array.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) { PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) {
return PortalConstExecution(this->Array.PrepareForInput(Device()), this->Functor); return PortalConstExecution(this->Array.PrepareForInput(Device()), this->Functor);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool &vtkmNotUsed(updateData)) { PortalExecution PrepareForInPlace(bool &vtkmNotUsed(updateData)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandleTransform read only. " "ArrayHandleTransform read only. "
"Cannot be used for in-place operations."); "Cannot be used for in-place operations.");
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) { PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandleTransform read only. Cannot be used as output."); "ArrayHandleTransform read only. Cannot be used as output.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const { void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const {
throw vtkm::cont::ErrorControlInternal( throw vtkm::cont::ErrorControlInternal(
"ArrayHandleTransform read only. " "ArrayHandleTransform read only. "
@ -383,13 +383,13 @@ public:
"data from the execution environment."); "data from the execution environment.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) { void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandleTransform read only. Cannot shrink."); "ArrayHandleTransform read only. Cannot shrink.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->Array.ReleaseResourcesExecution(); this->Array.ReleaseResourcesExecution();
} }
@ -427,45 +427,45 @@ public:
typename ArrayHandleType::template ExecutionTypes<Device>::PortalConst, typename ArrayHandleType::template ExecutionTypes<Device>::PortalConst,
FunctorType, InverseFunctorType> PortalConstExecution; FunctorType, InverseFunctorType> PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) ArrayTransfer(StorageType *storage)
: Array(storage->GetArray()), : Array(storage->GetArray()),
Functor(storage->GetFunctor()), Functor(storage->GetFunctor()),
InverseFunctor(storage->GetInverseFunctor()) { } InverseFunctor(storage->GetInverseFunctor()) { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->Array.GetNumberOfValues(); return this->Array.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) { PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) {
return PortalConstExecution(this->Array.PrepareForInput(Device()),this->Functor,this->InverseFunctor); return PortalConstExecution(this->Array.PrepareForInput(Device()),this->Functor,this->InverseFunctor);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool &vtkmNotUsed(updateData)) { PortalExecution PrepareForInPlace(bool &vtkmNotUsed(updateData)) {
return PortalExecution(this->Array.PrepareForInPlace(Device()),this->Functor,this->InverseFunctor); return PortalExecution(this->Array.PrepareForInPlace(Device()),this->Functor,this->InverseFunctor);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id numberOfValues) { PortalExecution PrepareForOutput(vtkm::Id numberOfValues) {
return PortalExecution(this->Array.PrepareForOutput(numberOfValues, return PortalExecution(this->Array.PrepareForOutput(numberOfValues,
Device()),this->Functor,this->InverseFunctor); Device()),this->Functor,this->InverseFunctor);
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const { void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const {
// Implementation of this method should be unnecessary. The internal // Implementation of this method should be unnecessary. The internal
// array handle should automatically retrieve the output data as necessary. // array handle should automatically retrieve the output data as necessary.
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) { void Shrink(vtkm::Id numberOfValues) {
this->Array.Shrink(numberOfValues); this->Array.Shrink(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->Array.ReleaseResourcesExecution(); this->Array.ReleaseResourcesExecution();
} }
@ -517,7 +517,7 @@ private:
typedef vtkm::cont::internal::Storage<T, StorageTag> StorageType; typedef vtkm::cont::internal::Storage<T, StorageTag> StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleTransform(const ArrayHandleType &handle, ArrayHandleTransform(const ArrayHandleType &handle,
const FunctorType &functor = FunctorType()) const FunctorType &functor = FunctorType())
: Superclass(StorageType(handle, functor)) { } : Superclass(StorageType(handle, functor)) { }
@ -528,7 +528,7 @@ public:
/// to apply to each element of the Handle. /// to apply to each element of the Handle.
template <typename T, typename HandleType, typename FunctorType> template <typename T, typename HandleType, typename FunctorType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleTransform<T, HandleType, FunctorType> vtkm::cont::ArrayHandleTransform<T, HandleType, FunctorType>
make_ArrayHandleTransform(HandleType handle, FunctorType functor) make_ArrayHandleTransform(HandleType handle, FunctorType functor)
{ {
@ -568,7 +568,7 @@ private:
}; };
template <typename T, typename HandleType, typename FunctorType, typename InverseFunctorType> template <typename T, typename HandleType, typename FunctorType, typename InverseFunctorType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleTransform<T, HandleType, FunctorType, InverseFunctorType> vtkm::cont::ArrayHandleTransform<T, HandleType, FunctorType, InverseFunctorType>
make_ArrayHandleTransform(HandleType handle, FunctorType functor, InverseFunctorType inverseFunctor) make_ArrayHandleTransform(HandleType handle, FunctorType functor, InverseFunctorType inverseFunctor)
{ {

@ -50,7 +50,7 @@ private:
typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType; typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleUniformPointCoordinates( ArrayHandleUniformPointCoordinates(
vtkm::Id3 dimensions, vtkm::Id3 dimensions,
ValueType origin = ValueType(0.0f, 0.0f, 0.0f), ValueType origin = ValueType(0.0f, 0.0f, 0.0f),

@ -41,12 +41,12 @@ public:
typedef PortalTypeSecond_ PortalTypeSecond; typedef PortalTypeSecond_ PortalTypeSecond;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalZip() ArrayPortalZip()
: PortalFirst(), PortalSecond() : PortalFirst(), PortalSecond()
{ } //needs to be host and device so that cuda can create lvalue of these { } //needs to be host and device so that cuda can create lvalue of these
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalZip(const PortalTypeFirst &portalfirst, ArrayPortalZip(const PortalTypeFirst &portalfirst,
const PortalTypeSecond &portalsecond) const PortalTypeSecond &portalsecond)
: PortalFirst(portalfirst), PortalSecond(portalsecond) : PortalFirst(portalfirst), PortalSecond(portalsecond)
@ -57,31 +57,31 @@ public:
/// type casting that the iterators do (like the non-const to const cast). /// type casting that the iterators do (like the non-const to const cast).
/// ///
template<class OtherV, class OtherF, class OtherS> template<class OtherV, class OtherF, class OtherS>
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalZip(const ArrayPortalZip<OtherV,OtherF,OtherS> &src) ArrayPortalZip(const ArrayPortalZip<OtherV,OtherF,OtherS> &src)
: PortalFirst(src.GetFirstPortal()), : PortalFirst(src.GetFirstPortal()),
PortalSecond(src.GetSecondPortal()) PortalSecond(src.GetSecondPortal())
{ } { }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const { return this->PortalFirst.GetNumberOfValues(); } vtkm::Id GetNumberOfValues() const { return this->PortalFirst.GetNumberOfValues(); }
VTKM_EXEC_EXPORT VTKM_EXEC
ValueType Get(vtkm::Id index) const { ValueType Get(vtkm::Id index) const {
return vtkm::make_Pair(this->PortalFirst.Get(index), return vtkm::make_Pair(this->PortalFirst.Get(index),
this->PortalSecond.Get(index)); this->PortalSecond.Get(index));
} }
VTKM_EXEC_EXPORT VTKM_EXEC
void Set(vtkm::Id index, const ValueType &value) const { void Set(vtkm::Id index, const ValueType &value) const {
this->PortalFirst.Set(index, value.first); this->PortalFirst.Set(index, value.first);
this->PortalSecond.Set(index, value.second); this->PortalSecond.Set(index, value.second);
} }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalTypeFirst &GetFirstPortal() const { return this->PortalFirst; } const PortalTypeFirst &GetFirstPortal() const { return this->PortalFirst; }
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
const PortalTypeSecond &GetSecondPortal() const { return this->PortalSecond; } const PortalTypeSecond &GetSecondPortal() const { return this->PortalSecond; }
@ -140,59 +140,59 @@ public:
typename SecondHandleType::PortalConstControl> typename SecondHandleType::PortalConstControl>
PortalConstType; PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage() : FirstArray(), SecondArray() { } Storage() : FirstArray(), SecondArray() { }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const FirstHandleType &farray, const SecondHandleType &sarray) Storage(const FirstHandleType &farray, const SecondHandleType &sarray)
: FirstArray(farray), SecondArray(sarray) : FirstArray(farray), SecondArray(sarray)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() { PortalType GetPortal() {
return PortalType(this->FirstArray.GetPortalControl(), return PortalType(this->FirstArray.GetPortalControl(),
this->SecondArray.GetPortalControl()); this->SecondArray.GetPortalControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const { PortalConstType GetPortalConst() const {
return PortalConstType(this->FirstArray.GetPortalConstControl(), return PortalConstType(this->FirstArray.GetPortalConstControl(),
this->SecondArray.GetPortalConstControl()); this->SecondArray.GetPortalConstControl());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
VTKM_ASSERT(this->FirstArray.GetNumberOfValues() VTKM_ASSERT(this->FirstArray.GetNumberOfValues()
== this->SecondArray.GetNumberOfValues()); == this->SecondArray.GetNumberOfValues());
return this->FirstArray.GetNumberOfValues(); return this->FirstArray.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues) { void Allocate(vtkm::Id numberOfValues) {
this->FirstArray.Allocate(numberOfValues); this->FirstArray.Allocate(numberOfValues);
this->SecondArray.Allocate(numberOfValues); this->SecondArray.Allocate(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) { void Shrink(vtkm::Id numberOfValues) {
this->FirstArray.Shrink(numberOfValues); this->FirstArray.Shrink(numberOfValues);
this->SecondArray.Shrink(numberOfValues); this->SecondArray.Shrink(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
// This request is ignored since it is asking to release the resources // This request is ignored since it is asking to release the resources
// of the two zipped array, which may be used elsewhere. // of the two zipped array, which may be used elsewhere.
} }
VTKM_CONT_EXPORT VTKM_CONT
const FirstHandleType &GetFirstArray() const { const FirstHandleType &GetFirstArray() const {
return this->FirstArray; return this->FirstArray;
} }
VTKM_CONT_EXPORT VTKM_CONT
const SecondHandleType &GetSecondArray() const { const SecondHandleType &GetSecondArray() const {
return this->SecondArray; return this->SecondArray;
} }
@ -230,14 +230,14 @@ public:
typename SecondHandleType::template ExecutionTypes<Device>::PortalConst typename SecondHandleType::template ExecutionTypes<Device>::PortalConst
> PortalConstExecution; > PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) ArrayTransfer(StorageType *storage)
: FirstArray(storage->GetFirstArray()), : FirstArray(storage->GetFirstArray()),
SecondArray(storage->GetSecondArray()) SecondArray(storage->GetSecondArray())
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
VTKM_ASSERT( this->FirstArray.GetNumberOfValues() VTKM_ASSERT( this->FirstArray.GetNumberOfValues()
@ -245,40 +245,40 @@ public:
return this->FirstArray.GetNumberOfValues(); return this->FirstArray.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) { PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) {
return PortalConstExecution(this->FirstArray.PrepareForInput(Device()), return PortalConstExecution(this->FirstArray.PrepareForInput(Device()),
this->SecondArray.PrepareForInput(Device())); this->SecondArray.PrepareForInput(Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) { PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) {
const vtkm::Id numberOfValues = this->GetNumberOfValues(); const vtkm::Id numberOfValues = this->GetNumberOfValues();
return PortalExecution(this->FirstArray.PrepareForOutput(numberOfValues, Device()), return PortalExecution(this->FirstArray.PrepareForOutput(numberOfValues, Device()),
this->SecondArray.PrepareForOutput(numberOfValues, Device())); this->SecondArray.PrepareForOutput(numberOfValues, Device()));
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id numberOfValues) PortalExecution PrepareForOutput(vtkm::Id numberOfValues)
{ {
return PortalExecution( this->FirstArray.PrepareForOutput(numberOfValues, Device()), return PortalExecution( this->FirstArray.PrepareForOutput(numberOfValues, Device()),
this->SecondArray.PrepareForOutput(numberOfValues, Device()) ); this->SecondArray.PrepareForOutput(numberOfValues, Device()) );
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const { void RetrieveOutputData(StorageType *vtkmNotUsed(storage)) const {
// Implementation of this method should be unnecessary. The internal // Implementation of this method should be unnecessary. The internal
// first and second array handles should automatically retrieve the // first and second array handles should automatically retrieve the
// output data as necessary. // output data as necessary.
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) { void Shrink(vtkm::Id numberOfValues) {
this->FirstArray.Shrink(numberOfValues); this->FirstArray.Shrink(numberOfValues);
this->SecondArray.Shrink(numberOfValues); this->SecondArray.Shrink(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->FirstArray.ReleaseResourcesExecution(); this->FirstArray.ReleaseResourcesExecution();
this->SecondArray.ReleaseResourcesExecution(); this->SecondArray.ReleaseResourcesExecution();
@ -319,7 +319,7 @@ private:
typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType; typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleZip(const FirstHandleType &firstArray, ArrayHandleZip(const FirstHandleType &firstArray,
const SecondHandleType &secondArray) const SecondHandleType &secondArray)
: Superclass( StorageType( firstArray, secondArray ) ) { } : Superclass( StorageType( firstArray, secondArray ) ) { }
@ -329,7 +329,7 @@ public:
/// arrays to be zipped together. /// arrays to be zipped together.
/// ///
template<typename FirstHandleType, typename SecondHandleType> template<typename FirstHandleType, typename SecondHandleType>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandleZip<FirstHandleType,SecondHandleType> vtkm::cont::ArrayHandleZip<FirstHandleType,SecondHandleType>
make_ArrayHandleZip(const FirstHandleType &first, make_ArrayHandleZip(const FirstHandleType &first,
const SecondHandleType &second) const SecondHandleType &second)

@ -64,18 +64,18 @@ public:
/// The total number of values in the array. They are index from 0 to /// The total number of values in the array. They are index from 0 to
/// GetNumberOfValues()-1. /// GetNumberOfValues()-1.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const; vtkm::Id GetNumberOfValues() const;
/// Gets a value from the array. /// Gets a value from the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
ValueType Get(vtkm::Id index) const; ValueType Get(vtkm::Id index) const;
/// Sets a value in the array. This function may not exist for an ArrayPortal /// Sets a value in the array. This function may not exist for an ArrayPortal
/// pointing to a const array. /// pointing to a const array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Set(vtkm::Id index, const ValueType &value) const; void Set(vtkm::Id index, const ValueType &value) const;
}; };

@ -47,7 +47,7 @@ public:
/// the array portal. /// the array portal.
/// ///
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalToIterators(const PortalType &portal) : Portal(portal) { } ArrayPortalToIterators(const PortalType &portal) : Portal(portal) { }
/// The type of the iterator. /// The type of the iterator.
@ -58,7 +58,7 @@ public:
/// Returns an iterator pointing to the beginning of the ArrayPortal. /// Returns an iterator pointing to the beginning of the ArrayPortal.
/// ///
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorType GetBegin() const { IteratorType GetBegin() const {
return vtkm::cont::internal::make_IteratorBegin(this->Portal); return vtkm::cont::internal::make_IteratorBegin(this->Portal);
} }
@ -66,7 +66,7 @@ public:
/// Returns an iterator pointing to one past the end of the ArrayPortal. /// Returns an iterator pointing to one past the end of the ArrayPortal.
/// ///
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorType GetEnd() const { IteratorType GetEnd() const {
return vtkm::cont::internal::make_IteratorEnd(this->Portal); return vtkm::cont::internal::make_IteratorEnd(this->Portal);
} }
@ -79,7 +79,7 @@ private:
/// ///
template<typename PortalType> template<typename PortalType>
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType
ArrayPortalToIteratorBegin(const PortalType &portal) ArrayPortalToIteratorBegin(const PortalType &portal)
{ {
@ -91,7 +91,7 @@ ArrayPortalToIteratorBegin(const PortalType &portal)
/// ///
template<typename PortalType> template<typename PortalType>
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType
ArrayPortalToIteratorEnd(const PortalType &portal) ArrayPortalToIteratorEnd(const PortalType &portal)
{ {

@ -34,19 +34,19 @@ namespace cont {
class CellSet class CellSet
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
CellSet(const std::string &name) CellSet(const std::string &name)
: Name(name), LogicalStructure() : Name(name), LogicalStructure()
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSet(const vtkm::cont::CellSet &src) CellSet(const vtkm::cont::CellSet &src)
: Name(src.Name), : Name(src.Name),
LogicalStructure(src.LogicalStructure) LogicalStructure(src.LogicalStructure)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
CellSet &operator=(const vtkm::cont::CellSet &src) CellSet &operator=(const vtkm::cont::CellSet &src)
{ {
this->Name = src.Name; this->Name = src.Name;

@ -105,7 +105,7 @@ public:
typedef typename PointToCellConnectivityType::ConnectivityArrayType ConnectivityArrayType; typedef typename PointToCellConnectivityType::ConnectivityArrayType ConnectivityArrayType;
typedef typename PointToCellConnectivityType::IndexOffsetArrayType IndexOffsetArrayType; typedef typename PointToCellConnectivityType::IndexOffsetArrayType IndexOffsetArrayType;
VTKM_CONT_EXPORT VTKM_CONT
CellSetExplicit(vtkm::Id numpoints = 0, CellSetExplicit(vtkm::Id numpoints = 0,
const std::string &name = std::string()) const std::string &name = std::string())
: CellSet(name), : CellSet(name),
@ -115,7 +115,7 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetExplicit(vtkm::Id numpoints) CellSetExplicit(vtkm::Id numpoints)
: CellSet(std::string()), : CellSet(std::string()),
ConnectivityLength(-1), ConnectivityLength(-1),
@ -124,7 +124,7 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetExplicit(const Thisclass &src) CellSetExplicit(const Thisclass &src)
: CellSet(src), : CellSet(src),
PointToCell(src.PointToCell), PointToCell(src.PointToCell),
@ -134,7 +134,7 @@ public:
NumberOfPoints(src.NumberOfPoints) NumberOfPoints(src.NumberOfPoints)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
Thisclass &operator=(const Thisclass &src) Thisclass &operator=(const Thisclass &src)
{ {
this->CellSet::operator=(src); this->CellSet::operator=(src);
@ -158,32 +158,32 @@ public:
return this->NumberOfPoints; return this->NumberOfPoints;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const
{ {
return this->GetNumberOfCells(); return this->GetNumberOfCells();
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagPoint) const vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagPoint) const
{ {
return this->GetNumberOfPoints(); return this->GetNumberOfPoints();
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id cellIndex) const vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id cellIndex) const
{ {
return this->PointToCell.NumIndices.GetPortalConstControl().Get(cellIndex); return this->PointToCell.NumIndices.GetPortalConstControl().Get(cellIndex);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetCellShape(vtkm::Id cellIndex) const vtkm::Id GetCellShape(vtkm::Id cellIndex) const
{ {
return this->PointToCell.Shapes.GetPortalConstControl().Get(cellIndex); return this->PointToCell.Shapes.GetPortalConstControl().Get(cellIndex);
} }
template <vtkm::IdComponent ItemTupleLength> template <vtkm::IdComponent ItemTupleLength>
VTKM_CONT_EXPORT VTKM_CONT
void GetIndices(vtkm::Id index, void GetIndices(vtkm::Id index,
vtkm::Vec<vtkm::Id,ItemTupleLength> &ids) const vtkm::Vec<vtkm::Id,ItemTupleLength> &ids) const
{ {
@ -196,7 +196,7 @@ public:
} }
/// First method to add cells -- one at a time. /// First method to add cells -- one at a time.
VTKM_CONT_EXPORT VTKM_CONT
void PrepareToAddCells(vtkm::Id numShapes, vtkm::Id connectivityMaxLen) void PrepareToAddCells(vtkm::Id numShapes, vtkm::Id connectivityMaxLen)
{ {
this->PointToCell.Shapes.Allocate(numShapes); this->PointToCell.Shapes.Allocate(numShapes);
@ -208,7 +208,7 @@ public:
} }
template <typename IndexableType> template <typename IndexableType>
VTKM_CONT_EXPORT VTKM_CONT
void AddCell(vtkm::UInt8 cellType, void AddCell(vtkm::UInt8 cellType,
vtkm::IdComponent numVertices, vtkm::IdComponent numVertices,
const IndexableType &ids) const IndexableType &ids)
@ -226,7 +226,7 @@ public:
this->ConnectivityLength += numVertices; this->ConnectivityLength += numVertices;
} }
VTKM_CONT_EXPORT VTKM_CONT
void CompleteAddingCells() void CompleteAddingCells()
{ {
this->PointToCell.Connectivity.Shrink(ConnectivityLength); this->PointToCell.Connectivity.Shrink(ConnectivityLength);
@ -238,7 +238,7 @@ public:
/// Second method to add cells -- all at once. /// Second method to add cells -- all at once.
/// Assigns the array handles to the explicit connectivity. This is /// Assigns the array handles to the explicit connectivity. This is
/// the way you can fill the memory from another system without copying /// the way you can fill the memory from another system without copying
VTKM_CONT_EXPORT VTKM_CONT
void Fill(const vtkm::cont::ArrayHandle<vtkm::UInt8, ShapeStorageTag> &cellTypes, void Fill(const vtkm::cont::ArrayHandle<vtkm::UInt8, ShapeStorageTag> &cellTypes,
const vtkm::cont::ArrayHandle<vtkm::IdComponent, NumIndicesStorageTag> &numIndices, const vtkm::cont::ArrayHandle<vtkm::IdComponent, NumIndicesStorageTag> &numIndices,
const vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag> &connectivity, const vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag> &connectivity,
@ -311,7 +311,7 @@ public:
} }
template<typename Device, typename FromTopology, typename ToTopology> template<typename Device, typename FromTopology, typename ToTopology>
VTKM_CONT_EXPORT VTKM_CONT
void BuildConnectivity(Device, FromTopology, ToTopology) const void BuildConnectivity(Device, FromTopology, ToTopology) const
{ {
typedef CellSetExplicit<ShapeStorageTag, typedef CellSetExplicit<ShapeStorageTag,
@ -328,7 +328,7 @@ public:
} }
template<typename Device> template<typename Device>
VTKM_CONT_EXPORT VTKM_CONT
void CreateConnectivity(Device, void CreateConnectivity(Device,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) vtkm::TopologyElementTagCell)
@ -347,11 +347,11 @@ public:
typedef void ExecutionSignature(_1,_2,_3,_4); typedef void ExecutionSignature(_1,_2,_3,_4);
typedef _1 InputDomain; typedef _1 InputDomain;
VTKM_CONT_EXPORT VTKM_CONT
ExpandIndices() {} ExpandIndices() {}
template<typename PortalType> template<typename PortalType>
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(const vtkm::Id &cellIndex, void operator()(const vtkm::Id &cellIndex,
const vtkm::Id &offset, const vtkm::Id &offset,
const vtkm::Id &numIndices, const vtkm::Id &numIndices,
@ -367,7 +367,7 @@ public:
}; };
template<typename Device> template<typename Device>
VTKM_CONT_EXPORT VTKM_CONT
void CreateConnectivity(Device, void CreateConnectivity(Device,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) vtkm::TopologyElementTagPoint)
@ -447,7 +447,7 @@ public:
} }
template<typename FromTopology, typename ToTopology> template<typename FromTopology, typename ToTopology>
VTKM_CONT_EXPORT VTKM_CONT
const typename ConnectivityChooser<FromTopology,ToTopology>::ShapeArrayType & const typename ConnectivityChooser<FromTopology,ToTopology>::ShapeArrayType &
GetShapesArray(FromTopology,ToTopology) const GetShapesArray(FromTopology,ToTopology) const
{ {
@ -455,7 +455,7 @@ public:
} }
template<typename FromTopology, typename ToTopology> template<typename FromTopology, typename ToTopology>
VTKM_CONT_EXPORT VTKM_CONT
const typename ConnectivityChooser<FromTopology,ToTopology>::NumIndicesArrayType & const typename ConnectivityChooser<FromTopology,ToTopology>::NumIndicesArrayType &
GetNumIndicesArray(FromTopology,ToTopology) const GetNumIndicesArray(FromTopology,ToTopology) const
{ {
@ -463,7 +463,7 @@ public:
} }
template<typename FromTopology, typename ToTopology> template<typename FromTopology, typename ToTopology>
VTKM_CONT_EXPORT VTKM_CONT
const typename ConnectivityChooser<FromTopology,ToTopology>::ConnectivityArrayType & const typename ConnectivityChooser<FromTopology,ToTopology>::ConnectivityArrayType &
GetConnectivityArray(FromTopology,ToTopology) const GetConnectivityArray(FromTopology,ToTopology) const
{ {
@ -471,7 +471,7 @@ public:
} }
template<typename FromTopology, typename ToTopology> template<typename FromTopology, typename ToTopology>
VTKM_CONT_EXPORT VTKM_CONT
const typename ConnectivityChooser<FromTopology,ToTopology>::IndexOffsetArrayType & const typename ConnectivityChooser<FromTopology,ToTopology>::IndexOffsetArrayType &
GetIndexOffsetArray(FromTopology,ToTopology) const GetIndexOffsetArray(FromTopology,ToTopology) const
{ {
@ -493,14 +493,14 @@ private:
// A set of overloaded methods to get the connectivity from a pair of // A set of overloaded methods to get the connectivity from a pair of
// topology element types. // topology element types.
#define VTKM_GET_CONNECTIVITY_METHOD(FromTopology,ToTopology,Ivar) \ #define VTKM_GET_CONNECTIVITY_METHOD(FromTopology,ToTopology,Ivar) \
VTKM_CONT_EXPORT \ VTKM_CONT \
const typename ConnectivityChooser< \ const typename ConnectivityChooser< \
FromTopology,ToTopology>::ConnectivityType & \ FromTopology,ToTopology>::ConnectivityType & \
GetConnectivity(FromTopology, ToTopology) const \ GetConnectivity(FromTopology, ToTopology) const \
{ \ { \
return this->Ivar; \ return this->Ivar; \
} \ } \
VTKM_CONT_EXPORT \ VTKM_CONT \
typename ConnectivityChooser< \ typename ConnectivityChooser< \
FromTopology,ToTopology>::ConnectivityType & \ FromTopology,ToTopology>::ConnectivityType & \
GetConnectivity(FromTopology, ToTopology) \ GetConnectivity(FromTopology, ToTopology) \

@ -38,7 +38,7 @@ template< typename OriginalCellSet, typename PermutationArrayHandleType >
class CellSetGeneralPermutation : public CellSet class CellSetGeneralPermutation : public CellSet
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
CellSetGeneralPermutation(const PermutationArrayHandleType& validCellIds, CellSetGeneralPermutation(const PermutationArrayHandleType& validCellIds,
const OriginalCellSet& cellset, const OriginalCellSet& cellset,
const std::string &name) const std::string &name)
@ -48,7 +48,7 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetGeneralPermutation(const std::string &name) CellSetGeneralPermutation(const std::string &name)
: CellSet(name), : CellSet(name),
ValidCellIds(), ValidCellIds(),
@ -56,20 +56,20 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfCells() const vtkm::Id GetNumberOfCells() const
{ {
return this->ValidCellIds.GetNumberOfValues(); return this->ValidCellIds.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfPoints() const vtkm::Id GetNumberOfPoints() const
{ {
return this->FullCellSet.GetNumberOfPoints(); return this->FullCellSet.GetNumberOfPoints();
} }
//This is the way you can fill the memory from another system without copying //This is the way you can fill the memory from another system without copying
VTKM_CONT_EXPORT VTKM_CONT
void Fill(const PermutationArrayHandleType &validCellIds, void Fill(const PermutationArrayHandleType &validCellIds,
const OriginalCellSet& cellset) const OriginalCellSet& cellset)
{ {
@ -78,7 +78,7 @@ public:
} }
template<typename TopologyElement> template<typename TopologyElement>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetSchedulingRange(TopologyElement) const { vtkm::Id GetSchedulingRange(TopologyElement) const {
VTKM_IS_TOPOLOGY_ELEMENT_TAG(TopologyElement); VTKM_IS_TOPOLOGY_ELEMENT_TAG(TopologyElement);
return this->ValidCellIds.GetNumberOfValues(); return this->ValidCellIds.GetNumberOfValues();
@ -135,7 +135,7 @@ class CellSetPermutation : public vtkm::cont::internal::CellSetGeneralPermutatio
typedef typename vtkm::cont::internal::CellSetGeneralPermutation< typedef typename vtkm::cont::internal::CellSetGeneralPermutation<
OriginalCellSet, PermutationArrayHandleType> ParentType; OriginalCellSet, PermutationArrayHandleType> ParentType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
CellSetPermutation(const PermutationArrayHandleType& validCellIds, CellSetPermutation(const PermutationArrayHandleType& validCellIds,
const OriginalCellSet& cellset, const OriginalCellSet& cellset,
const std::string &name = std::string()) const std::string &name = std::string())
@ -143,7 +143,7 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetPermutation(const std::string &name = std::string()) CellSetPermutation(const std::string &name = std::string())
: ParentType(name) : ParentType(name)
{ {

@ -55,7 +55,7 @@ class CellSetSingleType :
public: public:
template<typename CellShapeTag> template<typename CellShapeTag>
VTKM_CONT_EXPORT VTKM_CONT
CellSetSingleType(CellShapeTag, vtkm::Id numpoints, const std::string &name = std::string()) CellSetSingleType(CellShapeTag, vtkm::Id numpoints, const std::string &name = std::string())
: Superclass(numpoints, name), : Superclass(numpoints, name),
CellTypeAsId(CellShapeTag::Id) CellTypeAsId(CellShapeTag::Id)
@ -63,14 +63,14 @@ public:
} }
template<typename CellShapeTag> template<typename CellShapeTag>
VTKM_CONT_EXPORT VTKM_CONT
CellSetSingleType(CellShapeTag, const std::string &name = std::string()) CellSetSingleType(CellShapeTag, const std::string &name = std::string())
: Superclass(0, name), : Superclass(0, name),
CellTypeAsId(CellShapeTag::Id) CellTypeAsId(CellShapeTag::Id)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetSingleType(vtkm::Id numpoints, CellSetSingleType(vtkm::Id numpoints,
const std::string &name = std::string()) const std::string &name = std::string())
: Superclass(numpoints, name), : Superclass(numpoints, name),
@ -78,19 +78,19 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetSingleType(const std::string &name = std::string()) CellSetSingleType(const std::string &name = std::string())
: Superclass(0, name), : Superclass(0, name),
CellTypeAsId(CellShapeTagEmpty::Id) CellTypeAsId(CellShapeTagEmpty::Id)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetSingleType(const Thisclass &src) CellSetSingleType(const Thisclass &src)
: Superclass(src), CellTypeAsId(src.CellTypeAsId) : Superclass(src), CellTypeAsId(src.CellTypeAsId)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
Thisclass &operator=(const Thisclass &src) Thisclass &operator=(const Thisclass &src)
{ {
this->Superclass::operator=(src); this->Superclass::operator=(src);
@ -101,7 +101,7 @@ public:
virtual ~CellSetSingleType() { } virtual ~CellSetSingleType() { }
/// First method to add cells -- one at a time. /// First method to add cells -- one at a time.
VTKM_CONT_EXPORT VTKM_CONT
void PrepareToAddCells(vtkm::Id numShapes, vtkm::Id connectivityMaxLen) void PrepareToAddCells(vtkm::Id numShapes, vtkm::Id connectivityMaxLen)
{ {
vtkm::IdComponent numberOfPointsPerCell = this->DetermineNumberOfPoints(); vtkm::IdComponent numberOfPointsPerCell = this->DetermineNumberOfPoints();
@ -124,7 +124,7 @@ public:
/// Second method to add cells -- one at a time. /// Second method to add cells -- one at a time.
template <vtkm::IdComponent ItemTupleLength> template <vtkm::IdComponent ItemTupleLength>
VTKM_CONT_EXPORT VTKM_CONT
void AddCell(vtkm::UInt8 vtkmNotUsed(cellType), void AddCell(vtkm::UInt8 vtkmNotUsed(cellType),
vtkm::IdComponent numVertices, vtkm::IdComponent numVertices,
const vtkm::Vec<vtkm::Id,ItemTupleLength> &ids) const vtkm::Vec<vtkm::Id,ItemTupleLength> &ids)
@ -139,7 +139,7 @@ public:
} }
/// Third and final method to add cells -- one at a time. /// Third and final method to add cells -- one at a time.
VTKM_CONT_EXPORT VTKM_CONT
void CompleteAddingCells() void CompleteAddingCells()
{ {
this->PointToCell.Connectivity.Shrink(this->ConnectivityLength); this->PointToCell.Connectivity.Shrink(this->ConnectivityLength);
@ -149,7 +149,7 @@ public:
} }
//This is the way you can fill the memory from another system without copying //This is the way you can fill the memory from another system without copying
VTKM_CONT_EXPORT VTKM_CONT
void Fill(const vtkm::cont::ArrayHandle<vtkm::Id, void Fill(const vtkm::cont::ArrayHandle<vtkm::Id,
ConnectivityStorageTag> &connectivity) ConnectivityStorageTag> &connectivity)
{ {

@ -44,18 +44,18 @@ public:
typedef typename InternalsType::SchedulingRangeType SchedulingRangeType; typedef typename InternalsType::SchedulingRangeType SchedulingRangeType;
VTKM_CONT_EXPORT VTKM_CONT
CellSetStructured(const std::string &name = std::string()) CellSetStructured(const std::string &name = std::string())
: CellSet(name) : CellSet(name)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
CellSetStructured(const Thisclass &src) CellSetStructured(const Thisclass &src)
: CellSet(src), Structure(src.Structure) : CellSet(src), Structure(src.Structure)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
Thisclass &operator=(const Thisclass &src) Thisclass &operator=(const Thisclass &src)
{ {
this->CellSet::operator=(src); this->CellSet::operator=(src);
@ -90,21 +90,21 @@ public:
return this->Structure.GetCellDimensions(); return this->Structure.GetCellDimensions();
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent vtkm::IdComponent
GetNumberOfPointsInCell(vtkm::Id vtkmNotUsed(cellIndex)=0) const GetNumberOfPointsInCell(vtkm::Id vtkmNotUsed(cellIndex)=0) const
{ {
return this->Structure.GetNumberOfPointsInCell(); return this->Structure.GetNumberOfPointsInCell();
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetCellShape() const vtkm::IdComponent GetCellShape() const
{ {
return this->Structure.GetCellShape(); return this->Structure.GetCellShape();
} }
template<typename TopologyElement> template<typename TopologyElement>
VTKM_CONT_EXPORT VTKM_CONT
SchedulingRangeType GetSchedulingRange(TopologyElement) const { SchedulingRangeType GetSchedulingRange(TopologyElement) const {
VTKM_IS_TOPOLOGY_ELEMENT_TAG(TopologyElement); VTKM_IS_TOPOLOGY_ELEMENT_TAG(TopologyElement);
return this->Structure.GetSchedulingRange(TopologyElement()); return this->Structure.GetSchedulingRange(TopologyElement());

@ -83,28 +83,28 @@ class CoordinateSystem : public vtkm::cont::Field
typedef vtkm::cont::Field Superclass; typedef vtkm::cont::Field Superclass;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
CoordinateSystem() : Superclass() { } CoordinateSystem() : Superclass() { }
VTKM_CONT_EXPORT VTKM_CONT
CoordinateSystem(std::string name, CoordinateSystem(std::string name,
const vtkm::cont::DynamicArrayHandle &data) const vtkm::cont::DynamicArrayHandle &data)
: Superclass(name, ASSOC_POINTS, data) { } : Superclass(name, ASSOC_POINTS, data) { }
template<typename T, typename Storage> template<typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
CoordinateSystem(std::string name, CoordinateSystem(std::string name,
const ArrayHandle<T, Storage> &data) const ArrayHandle<T, Storage> &data)
: Superclass(name, ASSOC_POINTS, data) { } : Superclass(name, ASSOC_POINTS, data) { }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
CoordinateSystem(std::string name, CoordinateSystem(std::string name,
const std::vector<T> &data) const std::vector<T> &data)
: Superclass(name, ASSOC_POINTS, data) { } : Superclass(name, ASSOC_POINTS, data) { }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
CoordinateSystem(std::string name, CoordinateSystem(std::string name,
const T *data, const T *data,
vtkm::Id numberOfValues) vtkm::Id numberOfValues)
@ -112,7 +112,7 @@ public:
/// This constructor of coordinate system sets up a regular grid of points. /// This constructor of coordinate system sets up a regular grid of points.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
CoordinateSystem(std::string name, CoordinateSystem(std::string name,
vtkm::Id3 dimensions, vtkm::Id3 dimensions,
vtkm::Vec<vtkm::FloatDefault,3> origin vtkm::Vec<vtkm::FloatDefault,3> origin
@ -125,14 +125,14 @@ public:
vtkm::cont::ArrayHandleUniformPointCoordinates(dimensions, origin, spacing))) vtkm::cont::ArrayHandleUniformPointCoordinates(dimensions, origin, spacing)))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicArrayHandleCoordinateSystem GetData() const vtkm::cont::DynamicArrayHandleCoordinateSystem GetData() const
{ {
return vtkm::cont::DynamicArrayHandleCoordinateSystem( return vtkm::cont::DynamicArrayHandleCoordinateSystem(
this->Superclass::GetData()); this->Superclass::GetData());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicArrayHandleCoordinateSystem GetData() vtkm::cont::DynamicArrayHandleCoordinateSystem GetData()
{ {
return vtkm::cont::DynamicArrayHandleCoordinateSystem( return vtkm::cont::DynamicArrayHandleCoordinateSystem(
@ -140,7 +140,7 @@ public:
} }
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
void GetRange(vtkm::Range *range, DeviceAdapterTag) const void GetRange(vtkm::Range *range, DeviceAdapterTag) const
{ {
this->Superclass::GetRange( this->Superclass::GetRange(
@ -151,7 +151,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList> template<typename DeviceAdapterTag, typename TypeList>
VTKM_CONT_EXPORT VTKM_CONT
void GetRange(vtkm::Range *range, DeviceAdapterTag, TypeList) const void GetRange(vtkm::Range *range, DeviceAdapterTag, TypeList) const
{ {
this->Superclass::GetRange( this->Superclass::GetRange(
@ -162,7 +162,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList, typename StorageList> template<typename DeviceAdapterTag, typename TypeList, typename StorageList>
VTKM_CONT_EXPORT VTKM_CONT
void GetRange(vtkm::Range *range, DeviceAdapterTag, TypeList, StorageList) const void GetRange(vtkm::Range *range, DeviceAdapterTag, TypeList, StorageList) const
{ {
this->Superclass::GetRange( this->Superclass::GetRange(
@ -173,7 +173,7 @@ public:
} }
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag) const const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag) const
{ {
return this->Superclass::GetRange( return this->Superclass::GetRange(
@ -183,7 +183,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList> template<typename DeviceAdapterTag, typename TypeList>
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag, const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag,
TypeList) const TypeList) const
{ {
@ -194,7 +194,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList, typename StorageList> template<typename DeviceAdapterTag, typename TypeList, typename StorageList>
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag, const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag,
TypeList, TypeList,
StorageList) const StorageList) const
@ -206,7 +206,7 @@ public:
} }
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Bounds GetBounds(DeviceAdapterTag) const vtkm::Bounds GetBounds(DeviceAdapterTag) const
{ {
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapterTag); VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapterTag);
@ -217,7 +217,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList> template<typename DeviceAdapterTag, typename TypeList>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Bounds GetBounds(DeviceAdapterTag, TypeList) const vtkm::Bounds GetBounds(DeviceAdapterTag, TypeList) const
{ {
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapterTag); VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapterTag);
@ -229,7 +229,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList, typename StorageList> template<typename DeviceAdapterTag, typename TypeList, typename StorageList>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Bounds GetBounds(DeviceAdapterTag, TypeList, StorageList) const vtkm::Bounds GetBounds(DeviceAdapterTag, TypeList, StorageList) const
{ {
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapterTag); VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapterTag);
@ -250,7 +250,7 @@ public:
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual void PrintSummary(std::ostream &out) const virtual void PrintSummary(std::ostream &out) const
{ {
out << " Coordinate System "; out << " Coordinate System ";

@ -34,12 +34,12 @@ namespace cont {
class DataSet class DataSet
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DataSet() DataSet()
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
void Clear() void Clear()
{ {
this->CoordSystems.clear(); this->CoordSystems.clear();
@ -47,13 +47,13 @@ public:
this->CellSets.clear(); this->CellSets.clear();
} }
VTKM_CONT_EXPORT VTKM_CONT
void AddField(Field field) void AddField(Field field)
{ {
this->Fields.push_back(field); this->Fields.push_back(field);
} }
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::Field &GetField(vtkm::Id index) const const vtkm::cont::Field &GetField(vtkm::Id index) const
{ {
VTKM_ASSERT((index >= 0) && VTKM_ASSERT((index >= 0) &&
@ -61,7 +61,7 @@ public:
return this->Fields[static_cast<std::size_t>(index)]; return this->Fields[static_cast<std::size_t>(index)];
} }
VTKM_CONT_EXPORT VTKM_CONT
bool HasField( bool HasField(
const std::string &name, const std::string &name,
vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY) vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY)
@ -72,7 +72,7 @@ public:
return found; return found;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetFieldIndex( vtkm::Id GetFieldIndex(
const std::string &name, const std::string &name,
vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY) vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY)
@ -91,7 +91,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::Field &GetField(const std::string &name, const vtkm::cont::Field &GetField(const std::string &name,
vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY) vtkm::cont::Field::AssociationEnum assoc = vtkm::cont::Field::ASSOC_ANY)
const const
@ -99,13 +99,13 @@ public:
return this->GetField(this->GetFieldIndex(name, assoc)); return this->GetField(this->GetFieldIndex(name, assoc));
} }
VTKM_CONT_EXPORT VTKM_CONT
void AddCoordinateSystem(vtkm::cont::CoordinateSystem cs) void AddCoordinateSystem(vtkm::cont::CoordinateSystem cs)
{ {
this->CoordSystems.push_back(cs); this->CoordSystems.push_back(cs);
} }
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::CoordinateSystem & const vtkm::cont::CoordinateSystem &
GetCoordinateSystem(vtkm::Id index=0) const GetCoordinateSystem(vtkm::Id index=0) const
{ {
@ -114,7 +114,7 @@ public:
return this->CoordSystems[static_cast<std::size_t>(index)]; return this->CoordSystems[static_cast<std::size_t>(index)];
} }
VTKM_CONT_EXPORT VTKM_CONT
bool HasCoordinateSystem(const std::string &name) const bool HasCoordinateSystem(const std::string &name) const
{ {
bool found; bool found;
@ -122,7 +122,7 @@ public:
return found; return found;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetCoordinateSystemIndex(const std::string &name) const vtkm::Id GetCoordinateSystemIndex(const std::string &name) const
{ {
bool found; bool found;
@ -138,28 +138,28 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::CoordinateSystem & const vtkm::cont::CoordinateSystem &
GetCoordinateSystem(const std::string &name) const GetCoordinateSystem(const std::string &name) const
{ {
return this->GetCoordinateSystem(this->GetCoordinateSystemIndex(name)); return this->GetCoordinateSystem(this->GetCoordinateSystemIndex(name));
} }
VTKM_CONT_EXPORT VTKM_CONT
void AddCellSet(vtkm::cont::DynamicCellSet cellSet) void AddCellSet(vtkm::cont::DynamicCellSet cellSet)
{ {
this->CellSets.push_back(cellSet); this->CellSets.push_back(cellSet);
} }
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
void AddCellSet(const CellSetType &cellSet) void AddCellSet(const CellSetType &cellSet)
{ {
VTKM_IS_CELL_SET(CellSetType); VTKM_IS_CELL_SET(CellSetType);
this->CellSets.push_back(vtkm::cont::DynamicCellSet(cellSet)); this->CellSets.push_back(vtkm::cont::DynamicCellSet(cellSet));
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicCellSet GetCellSet(vtkm::Id index=0) const vtkm::cont::DynamicCellSet GetCellSet(vtkm::Id index=0) const
{ {
VTKM_ASSERT((index >= 0) && VTKM_ASSERT((index >= 0) &&
@ -167,7 +167,7 @@ public:
return this->CellSets[static_cast<std::size_t>(index)]; return this->CellSets[static_cast<std::size_t>(index)];
} }
VTKM_CONT_EXPORT VTKM_CONT
bool HasCellSet(const std::string &name) const bool HasCellSet(const std::string &name) const
{ {
bool found; bool found;
@ -175,7 +175,7 @@ public:
return found; return found;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetCellSetIndex(const std::string &name) const vtkm::Id GetCellSetIndex(const std::string &name) const
{ {
bool found; bool found;
@ -190,31 +190,31 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicCellSet GetCellSet(const std::string &name) const vtkm::cont::DynamicCellSet GetCellSet(const std::string &name) const
{ {
return this->GetCellSet(this->GetCellSetIndex(name)); return this->GetCellSet(this->GetCellSetIndex(name));
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetNumberOfCellSets() const vtkm::IdComponent GetNumberOfCellSets() const
{ {
return static_cast<vtkm::IdComponent>(this->CellSets.size()); return static_cast<vtkm::IdComponent>(this->CellSets.size());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetNumberOfFields() const vtkm::IdComponent GetNumberOfFields() const
{ {
return static_cast<vtkm::IdComponent>(this->Fields.size()); return static_cast<vtkm::IdComponent>(this->Fields.size());
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetNumberOfCoordinateSystems() const vtkm::IdComponent GetNumberOfCoordinateSystems() const
{ {
return static_cast<vtkm::IdComponent>(this->CoordSystems.size()); return static_cast<vtkm::IdComponent>(this->CoordSystems.size());
} }
VTKM_CONT_EXPORT VTKM_CONT
void PrintSummary(std::ostream &out) const void PrintSummary(std::ostream &out) const
{ {
out<<"DataSet:\n"; out<<"DataSet:\n";
@ -242,7 +242,7 @@ private:
std::vector<vtkm::cont::Field> Fields; std::vector<vtkm::cont::Field> Fields;
std::vector<vtkm::cont::DynamicCellSet> CellSets; std::vector<vtkm::cont::DynamicCellSet> CellSets;
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id FindFieldIndex(const std::string &name, vtkm::Id FindFieldIndex(const std::string &name,
vtkm::cont::Field::AssociationEnum association, vtkm::cont::Field::AssociationEnum association,
bool &found) const bool &found) const
@ -261,7 +261,7 @@ private:
return -1; return -1;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id FindCoordinateSystemIndex(const std::string &name, bool &found) const vtkm::Id FindCoordinateSystemIndex(const std::string &name, bool &found) const
{ {
for (std::size_t index=0; index < this->CoordSystems.size(); ++index) for (std::size_t index=0; index < this->CoordSystems.size(); ++index)
@ -276,7 +276,7 @@ private:
return -1; return -1;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id FindCellSetIndex(const std::string &name, bool &found) const vtkm::Id FindCellSetIndex(const std::string &name, bool &found) const
{ {
for (std::size_t index=0; index < static_cast<size_t>(this->GetNumberOfCellSets()); ++index) for (std::size_t index=0; index < static_cast<size_t>(this->GetNumberOfCellSets()); ++index)

@ -34,7 +34,7 @@ namespace cont {
class DataSetBuilderExplicit class DataSetBuilderExplicit
{ {
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void CopyInto(const std::vector<T>& input, void CopyInto(const std::vector<T>& input,
vtkm::cont::ArrayHandle<T>& output ) vtkm::cont::ArrayHandle<T>& output )
@ -44,7 +44,7 @@ class DataSetBuilderExplicit
ArrayPortalToIteratorBegin(output.GetPortalControl()) ); ArrayPortalToIteratorBegin(output.GetPortalControl()) );
} }
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DataSetBuilderExplicit() {} DataSetBuilderExplicit() {}
//Single cell explicits. //Single cell explicits.
@ -52,7 +52,7 @@ public:
//Zoo explicit cell //Zoo explicit cell
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<T> &xVals, Create(const std::vector<T> &xVals,
@ -70,7 +70,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<T> &xVals, Create(const std::vector<T> &xVals,
@ -83,7 +83,7 @@ public:
const std::string &cellNm="cells"); const std::string &cellNm="cells");
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::cont::ArrayHandle<T> &xVals, Create(const vtkm::cont::ArrayHandle<T> &xVals,
@ -103,7 +103,7 @@ public:
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<vtkm::Vec<T,3> > &coords, Create(const std::vector<vtkm::Vec<T,3> > &coords,
@ -114,7 +114,7 @@ public:
const std::string &cellNm="cells"); const std::string &cellNm="cells");
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords, Create(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords,
@ -133,7 +133,7 @@ public:
} }
template<typename T, typename CellShapeTag> template<typename T, typename CellShapeTag>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<vtkm::Vec<T,3> > &coords, Create(const std::vector<vtkm::Vec<T,3> > &coords,
@ -143,7 +143,7 @@ public:
const std::string &cellNm="cells"); const std::string &cellNm="cells");
template<typename T, typename CellShapeTag> template<typename T, typename CellShapeTag>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords, Create(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords,
@ -173,7 +173,7 @@ private:
const std::string &cellNm); const std::string &cellNm);
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords, BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords,
@ -184,7 +184,7 @@ private:
const std::string &cellNm); const std::string &cellNm);
template<typename T, typename CellShapeTag> template<typename T, typename CellShapeTag>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords, BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords,
@ -195,6 +195,7 @@ private:
}; };
template<typename T> template<typename T>
inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicit::Create(const std::vector<T> &xVals, DataSetBuilderExplicit::Create(const std::vector<T> &xVals,
const std::vector<T> &yVals, const std::vector<T> &yVals,
@ -226,6 +227,7 @@ DataSetBuilderExplicit::Create(const std::vector<T> &xVals,
} }
template<typename T> template<typename T>
inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicit::BuildDataSet( DataSetBuilderExplicit::BuildDataSet(
const vtkm::cont::ArrayHandle<T> &X, const vtkm::cont::ArrayHandle<T> &X,
@ -256,6 +258,7 @@ DataSetBuilderExplicit::BuildDataSet(
} }
template<typename T> template<typename T>
inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicit::Create(const std::vector<vtkm::Vec<T,3> > &coords, DataSetBuilderExplicit::Create(const std::vector<vtkm::Vec<T,3> > &coords,
const std::vector<vtkm::UInt8> &shapes, const std::vector<vtkm::UInt8> &shapes,
@ -279,7 +282,7 @@ DataSetBuilderExplicit::Create(const std::vector<vtkm::Vec<T,3> > &coords,
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicit::BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords, DataSetBuilderExplicit::BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords,
const vtkm::cont::ArrayHandle<vtkm::UInt8> &shapes, const vtkm::cont::ArrayHandle<vtkm::UInt8> &shapes,
@ -302,6 +305,7 @@ DataSetBuilderExplicit::BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3
} }
template<typename T, typename CellShapeTag> template<typename T, typename CellShapeTag>
inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicit::Create(const std::vector<vtkm::Vec<T,3> > &coords, DataSetBuilderExplicit::Create(const std::vector<vtkm::Vec<T,3> > &coords,
CellShapeTag tag, CellShapeTag tag,
@ -319,7 +323,7 @@ DataSetBuilderExplicit::Create(const std::vector<vtkm::Vec<T,3> > &coords,
} }
template<typename T, typename CellShapeTag> template<typename T, typename CellShapeTag>
VTKM_CONT_EXPORT inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicit::BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords, DataSetBuilderExplicit::BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3> > &coords,
CellShapeTag tag, CellShapeTag tag,
@ -342,10 +346,10 @@ DataSetBuilderExplicit::BuildDataSet(const vtkm::cont::ArrayHandle<vtkm::Vec<T,3
class DataSetBuilderExplicitIterative class DataSetBuilderExplicitIterative
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DataSetBuilderExplicitIterative() {} DataSetBuilderExplicitIterative() {}
VTKM_CONT_EXPORT VTKM_CONT
void Begin(const std::string &coordName="coords", void Begin(const std::string &coordName="coords",
const std::string &cellName="cells") const std::string &cellName="cells")
{ {
@ -358,10 +362,10 @@ public:
} }
//Define points. //Define points.
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DataSet Create(); vtkm::cont::DataSet Create();
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id AddPoint(const vtkm::Vec<vtkm::Float32, 3> &pt) vtkm::Id AddPoint(const vtkm::Vec<vtkm::Float32, 3> &pt)
{ {
points.push_back(pt); points.push_back(pt);
@ -369,7 +373,7 @@ public:
return id; return id;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id AddPoint(const vtkm::Float32 &x, vtkm::Id AddPoint(const vtkm::Float32 &x,
const vtkm::Float32 &y, const vtkm::Float32 &y,
const vtkm::Float32 &z=0) const vtkm::Float32 &z=0)
@ -380,7 +384,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id AddPoint(const T &x, const T &y, const T &z=0) vtkm::Id AddPoint(const T &x, const T &y, const T &z=0)
{ {
return AddPoint(static_cast<vtkm::Float32>(x), return AddPoint(static_cast<vtkm::Float32>(x),
@ -389,21 +393,21 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id AddPoint(const vtkm::Vec<T,3> &pt) vtkm::Id AddPoint(const vtkm::Vec<T,3> &pt)
{ {
return AddPoint(static_cast<vtkm::Vec<vtkm::Float32,3> >(pt)); return AddPoint(static_cast<vtkm::Vec<vtkm::Float32,3> >(pt));
} }
//Define cells. //Define cells.
VTKM_CONT_EXPORT VTKM_CONT
void AddCell(vtkm::UInt8 shape) void AddCell(vtkm::UInt8 shape)
{ {
this->shapes.push_back(shape); this->shapes.push_back(shape);
this->numIdx.push_back(0); this->numIdx.push_back(0);
} }
VTKM_CONT_EXPORT VTKM_CONT
void AddCell(const vtkm::UInt8 &shape, const std::vector<vtkm::Id> &conn) void AddCell(const vtkm::UInt8 &shape, const std::vector<vtkm::Id> &conn)
{ {
this->shapes.push_back(shape); this->shapes.push_back(shape);
@ -411,7 +415,7 @@ public:
connectivity.insert(connectivity.end(), conn.begin(), conn.end()); connectivity.insert(connectivity.end(), conn.begin(), conn.end());
} }
VTKM_CONT_EXPORT VTKM_CONT
void AddCell(const vtkm::UInt8 &shape, const vtkm::Id *conn, const vtkm::IdComponent &n) void AddCell(const vtkm::UInt8 &shape, const vtkm::Id *conn, const vtkm::IdComponent &n)
{ {
this->shapes.push_back(shape); this->shapes.push_back(shape);
@ -422,7 +426,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
void AddCellPoint(vtkm::Id pointIndex) void AddCellPoint(vtkm::Id pointIndex)
{ {
VTKM_ASSERT(this->numIdx.size() > 0); VTKM_ASSERT(this->numIdx.size() > 0);
@ -439,6 +443,7 @@ private:
std::vector<vtkm::Id> connectivity; std::vector<vtkm::Id> connectivity;
}; };
inline VTKM_CONT
vtkm::cont::DataSet vtkm::cont::DataSet
DataSetBuilderExplicitIterative::Create() DataSetBuilderExplicitIterative::Create()
{ {

@ -32,7 +32,7 @@ namespace cont {
class DataSetBuilderRectilinear class DataSetBuilderRectilinear
{ {
template<typename T, typename U> template<typename T, typename U>
VTKM_CONT_EXPORT VTKM_CONT
static static
void CopyInto(const std::vector<T>& input, void CopyInto(const std::vector<T>& input,
vtkm::cont::ArrayHandle<U>& output ) vtkm::cont::ArrayHandle<U>& output )
@ -42,7 +42,7 @@ class DataSetBuilderRectilinear
} }
template<typename T, typename U> template<typename T, typename U>
VTKM_CONT_EXPORT VTKM_CONT
static static
void CopyInto(const vtkm::cont::ArrayHandle<T>& input, void CopyInto(const vtkm::cont::ArrayHandle<T>& input,
vtkm::cont::ArrayHandle<U>& output ) vtkm::cont::ArrayHandle<U>& output )
@ -53,7 +53,7 @@ class DataSetBuilderRectilinear
} }
template<typename T, typename U> template<typename T, typename U>
VTKM_CONT_EXPORT VTKM_CONT
static static
void CopyInto(const T* input, vtkm::Id len, void CopyInto(const T* input, vtkm::Id len,
vtkm::cont::ArrayHandle<U>& output ) vtkm::cont::ArrayHandle<U>& output )
@ -62,12 +62,12 @@ class DataSetBuilderRectilinear
vtkm::cont::make_ArrayHandle(input, len), output); vtkm::cont::make_ArrayHandle(input, len), output);
} }
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DataSetBuilderRectilinear() {} DataSetBuilderRectilinear() {}
//1D grids. //1D grids.
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<T> &xvals, Create(const std::vector<T> &xvals,
@ -79,7 +79,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(vtkm::Id nx, T *xvals, Create(vtkm::Id nx, T *xvals,
@ -91,7 +91,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::cont::ArrayHandle<T> &xvals, Create(const vtkm::cont::ArrayHandle<T> &xvals,
@ -108,7 +108,7 @@ public:
//2D grids. //2D grids.
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<T> &xvals, const std::vector<T> &yvals, Create(const std::vector<T> &xvals, const std::vector<T> &yvals,
@ -120,7 +120,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(vtkm::Id nx, vtkm::Id ny, Create(vtkm::Id nx, vtkm::Id ny,
@ -133,7 +133,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::cont::ArrayHandle<T> &xvals, Create(const vtkm::cont::ArrayHandle<T> &xvals,
@ -149,7 +149,7 @@ public:
//3D grids. //3D grids.
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(vtkm::Id nx, vtkm::Id ny, vtkm::Id nz, Create(vtkm::Id nx, vtkm::Id ny, vtkm::Id nz,
@ -161,7 +161,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const std::vector<T> &xvals, Create(const std::vector<T> &xvals,
@ -174,7 +174,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::cont::ArrayHandle<T> &xvals, Create(const vtkm::cont::ArrayHandle<T> &xvals,
@ -188,7 +188,7 @@ public:
private: private:
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
BuildDataSet(int dim, BuildDataSet(int dim,
@ -211,7 +211,7 @@ private:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
BuildDataSet(int dim, vtkm::Id nx, vtkm::Id ny, vtkm::Id nz, BuildDataSet(int dim, vtkm::Id nx, vtkm::Id ny, vtkm::Id nz,
@ -232,7 +232,7 @@ private:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
BuildDataSet(int dim, BuildDataSet(int dim,

@ -30,12 +30,12 @@ class DataSetBuilderUniform
{ {
typedef vtkm::Vec<vtkm::FloatDefault,3> VecType; typedef vtkm::Vec<vtkm::FloatDefault,3> VecType;
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DataSetBuilderUniform() {} DataSetBuilderUniform() {}
//1D uniform grid //1D uniform grid
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::Id &dimension, Create(const vtkm::Id &dimension,
@ -51,7 +51,7 @@ public:
coordNm, cellNm); coordNm, cellNm);
} }
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::Id &dimension, Create(const vtkm::Id &dimension,
@ -63,7 +63,7 @@ public:
//2D uniform grids. //2D uniform grids.
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::Id2 &dimensions, Create(const vtkm::Id2 &dimensions,
@ -81,7 +81,7 @@ public:
coordNm, cellNm); coordNm, cellNm);
} }
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::Id2 &dimensions, Create(const vtkm::Id2 &dimensions,
@ -93,7 +93,7 @@ public:
//3D uniform grids. //3D uniform grids.
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::Id3 &dimensions, Create(const vtkm::Id3 &dimensions,
@ -111,7 +111,7 @@ public:
coordNm, cellNm); coordNm, cellNm);
} }
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
Create(const vtkm::Id3 &dimensions, Create(const vtkm::Id3 &dimensions,
@ -122,7 +122,7 @@ public:
} }
private: private:
VTKM_CONT_EXPORT VTKM_CONT
static static
vtkm::cont::DataSet vtkm::cont::DataSet
CreateDataSet(int dim, vtkm::Id nx, vtkm::Id ny, vtkm::Id nz, CreateDataSet(int dim, vtkm::Id nx, vtkm::Id ny, vtkm::Id nz,

@ -30,11 +30,11 @@ namespace cont {
class DataSetFieldAdd class DataSetFieldAdd
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DataSetFieldAdd() {} DataSetFieldAdd() {}
//Point centered fields. //Point centered fields.
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddPointField(vtkm::cont::DataSet &dataSet, void AddPointField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -45,7 +45,7 @@ public:
} }
template <typename T, typename Storage> template <typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddPointField(vtkm::cont::DataSet &dataSet, void AddPointField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -56,7 +56,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddPointField(vtkm::cont::DataSet &dataSet, void AddPointField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -67,7 +67,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddPointField(vtkm::cont::DataSet &dataSet, void AddPointField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -78,7 +78,7 @@ public:
} }
//Cell centered field //Cell centered field
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -90,7 +90,7 @@ public:
} }
template <typename T, typename Storage> template <typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -102,7 +102,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -114,7 +114,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -125,7 +125,7 @@ public:
cellSetName, field, n)); cellSetName, field, n));
} }
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -137,7 +137,7 @@ public:
DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName); DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName);
} }
template <typename T, typename Storage> template <typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -149,7 +149,7 @@ public:
DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName); DataSetFieldAdd::AddCellField(dataSet, fieldName, field, cellSetName);
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,
@ -162,7 +162,7 @@ public:
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
static static
void AddCellField(vtkm::cont::DataSet &dataSet, void AddCellField(vtkm::cont::DataSet &dataSet,
const std::string &fieldName, const std::string &fieldName,

@ -55,7 +55,7 @@ struct DeviceAdapterAlgorithm
/// allocated we will reallocate and clear any current values. /// allocated we will reallocate and clear any current values.
/// ///
template<typename T, typename U, class CIn, class COut> template<typename T, typename U, class CIn, class COut>
VTKM_CONT_EXPORT static void Copy(const vtkm::cont::ArrayHandle<T,CIn> &input, VTKM_CONT static void Copy(const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<U, COut> &output); vtkm::cont::ArrayHandle<U, COut> &output);
/// \brief Copy the contents of a section of one ArrayHandle to another /// \brief Copy the contents of a section of one ArrayHandle to another
@ -76,7 +76,7 @@ struct DeviceAdapterAlgorithm
/// \arg \c input must already be sorted /// \arg \c input must already be sorted
/// ///
template<typename T, typename U, class CIn, class COut> template<typename T, typename U, class CIn, class COut>
VTKM_CONT_EXPORT static bool CopySubRange(const vtkm::cont::ArrayHandle<T,CIn> &input, VTKM_CONT static bool CopySubRange(const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::Id inputStartIndex, vtkm::Id inputStartIndex,
vtkm::Id numberOfElementsToCopy, vtkm::Id numberOfElementsToCopy,
vtkm::cont::ArrayHandle<U, COut> &output, vtkm::cont::ArrayHandle<U, COut> &output,
@ -92,7 +92,7 @@ struct DeviceAdapterAlgorithm
/// \arg \c input must already be sorted /// \arg \c input must already be sorted
/// ///
template<typename T, class CIn, class CVal, class COut> template<typename T, class CIn, class CVal, class COut>
VTKM_CONT_EXPORT static void LowerBounds( VTKM_CONT static void LowerBounds(
const vtkm::cont::ArrayHandle<T,CIn>& input, const vtkm::cont::ArrayHandle<T,CIn>& input,
const vtkm::cont::ArrayHandle<T,CVal>& values, const vtkm::cont::ArrayHandle<T,CVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,COut>& output); vtkm::cont::ArrayHandle<vtkm::Id,COut>& output);
@ -108,7 +108,7 @@ struct DeviceAdapterAlgorithm
/// \arg \c input must already be sorted /// \arg \c input must already be sorted
/// ///
template<typename T, class CIn, class CVal, class COut, class BinaryCompare> template<typename T, class CIn, class CVal, class COut, class BinaryCompare>
VTKM_CONT_EXPORT static void LowerBounds( VTKM_CONT static void LowerBounds(
const vtkm::cont::ArrayHandle<T,CIn>& input, const vtkm::cont::ArrayHandle<T,CIn>& input,
const vtkm::cont::ArrayHandle<T,CVal>& values, const vtkm::cont::ArrayHandle<T,CVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,COut>& output, vtkm::cont::ArrayHandle<vtkm::Id,COut>& output,
@ -122,7 +122,7 @@ struct DeviceAdapterAlgorithm
/// arrays is limited to vtkm::Id. /// arrays is limited to vtkm::Id.
/// ///
template<class CIn, class COut> template<class CIn, class COut>
VTKM_CONT_EXPORT static void LowerBounds( VTKM_CONT static void LowerBounds(
const vtkm::cont::ArrayHandle<vtkm::Id,CIn>& input, const vtkm::cont::ArrayHandle<vtkm::Id,CIn>& input,
vtkm::cont::ArrayHandle<vtkm::Id,COut>& values_output); vtkm::cont::ArrayHandle<vtkm::Id,COut>& values_output);
@ -136,7 +136,7 @@ struct DeviceAdapterAlgorithm
/// ///
/// \return The total sum. /// \return The total sum.
template<typename T, class CIn> template<typename T, class CIn>
VTKM_CONT_EXPORT static T Reduce( VTKM_CONT static T Reduce(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
T initialValue); T initialValue);
@ -151,7 +151,7 @@ struct DeviceAdapterAlgorithm
/// ///
/// \return The total sum. /// \return The total sum.
template<typename T, class CIn, class BinaryFunctor> template<typename T, class CIn, class BinaryFunctor>
VTKM_CONT_EXPORT static T Reduce( VTKM_CONT static T Reduce(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
T initialValue, T initialValue,
BinaryFunctor binary_functor); BinaryFunctor binary_functor);
@ -168,7 +168,7 @@ struct DeviceAdapterAlgorithm
class CKeyIn, class CValIn, class CKeyIn, class CValIn,
class CKeyOut, class CValOut, class CKeyOut, class CValOut,
class BinaryFunctor > class BinaryFunctor >
VTKM_CONT_EXPORT static void ReduceByKey( VTKM_CONT static void ReduceByKey(
const vtkm::cont::ArrayHandle<T,CKeyIn> &keys, const vtkm::cont::ArrayHandle<T,CKeyIn> &keys,
const vtkm::cont::ArrayHandle<U,CValIn> &values, const vtkm::cont::ArrayHandle<U,CValIn> &values,
vtkm::cont::ArrayHandle<T,CKeyOut>& keys_output, vtkm::cont::ArrayHandle<T,CKeyOut>& keys_output,
@ -188,7 +188,7 @@ struct DeviceAdapterAlgorithm
/// \return The total sum. /// \return The total sum.
/// ///
template<typename T, class CIn, class COut> template<typename T, class CIn, class COut>
VTKM_CONT_EXPORT static T ScanInclusive( VTKM_CONT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output); vtkm::cont::ArrayHandle<T,COut>& output);
@ -199,7 +199,7 @@ struct DeviceAdapterAlgorithm
/// \return The total sum. /// \return The total sum.
/// ///
template<typename T, class CIn, class COut> template<typename T, class CIn, class COut>
VTKM_CONT_EXPORT static T StreamingScanInclusive( VTKM_CONT static T StreamingScanInclusive(
const vtkm::Id numBlocks, const vtkm::Id numBlocks,
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output); vtkm::cont::ArrayHandle<T,COut>& output);
@ -217,7 +217,7 @@ struct DeviceAdapterAlgorithm
/// \return The total sum. /// \return The total sum.
/// ///
template<typename T, class CIn, class COut, class BinaryFunctor> template<typename T, class CIn, class COut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanInclusive( VTKM_CONT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output, vtkm::cont::ArrayHandle<T,COut>& output,
BinaryFunctor binary_functor); BinaryFunctor binary_functor);
@ -229,7 +229,7 @@ struct DeviceAdapterAlgorithm
/// \return The total sum. /// \return The total sum.
/// ///
template<typename T, class CIn, class COut, class BinaryFunctor> template<typename T, class CIn, class COut, class BinaryFunctor>
VTKM_CONT_EXPORT static T StreamingScanInclusive( VTKM_CONT static T StreamingScanInclusive(
const vtkm::Id numBlocks, const vtkm::Id numBlocks,
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output, vtkm::cont::ArrayHandle<T,COut>& output,
@ -248,7 +248,7 @@ struct DeviceAdapterAlgorithm
/// \return The total sum. /// \return The total sum.
/// ///
template<typename T, class CIn, class COut> template<typename T, class CIn, class COut>
VTKM_CONT_EXPORT static T ScanExclusive( VTKM_CONT static T ScanExclusive(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
vtkm::cont::ArrayHandle<T,COut>& output); vtkm::cont::ArrayHandle<T,COut>& output);
@ -270,7 +270,7 @@ struct DeviceAdapterAlgorithm
/// in the range [0, \c numInstances]. /// in the range [0, \c numInstances].
/// ///
template<class Functor> template<class Functor>
VTKM_CONT_EXPORT static void Schedule(Functor functor, VTKM_CONT static void Schedule(Functor functor,
vtkm::Id numInstances); vtkm::Id numInstances);
/// \brief Schedule many instances of a function to run on concurrent threads. /// \brief Schedule many instances of a function to run on concurrent threads.
@ -296,7 +296,7 @@ struct DeviceAdapterAlgorithm
/// rangeMax[0]*rangeMax[1]*rangeMax[2])</tt> were called. /// rangeMax[0]*rangeMax[1]*rangeMax[2])</tt> were called.
/// ///
template<class Functor, class IndiceType> template<class Functor, class IndiceType>
VTKM_CONT_EXPORT static void Schedule(Functor functor, VTKM_CONT static void Schedule(Functor functor,
vtkm::Id3 rangeMax); vtkm::Id3 rangeMax);
/// \brief Unstable ascending sort of input array. /// \brief Unstable ascending sort of input array.
@ -305,7 +305,7 @@ struct DeviceAdapterAlgorithm
/// guarantee stability /// guarantee stability
/// ///
template<typename T, class Storage> template<typename T, class Storage>
VTKM_CONT_EXPORT static void Sort(vtkm::cont::ArrayHandle<T,Storage> &values); VTKM_CONT static void Sort(vtkm::cont::ArrayHandle<T,Storage> &values);
/// \brief Unstable ascending sort of input array. /// \brief Unstable ascending sort of input array.
/// ///
@ -315,7 +315,7 @@ struct DeviceAdapterAlgorithm
/// BinaryCompare should be a strict weak ordering comparison operator /// BinaryCompare should be a strict weak ordering comparison operator
/// ///
template<typename T, class Storage, class BinaryCompare> template<typename T, class Storage, class BinaryCompare>
VTKM_CONT_EXPORT static void Sort(vtkm::cont::ArrayHandle<T,Storage> &values, VTKM_CONT static void Sort(vtkm::cont::ArrayHandle<T,Storage> &values,
BinaryCompare binary_compare); BinaryCompare binary_compare);
/// \brief Unstable ascending sort of keys and values. /// \brief Unstable ascending sort of keys and values.
@ -324,7 +324,7 @@ struct DeviceAdapterAlgorithm
/// on the values of keys. /// on the values of keys.
/// ///
template<typename T, typename U, class StorageT, class StorageU> template<typename T, typename U, class StorageT, class StorageU>
VTKM_CONT_EXPORT static void SortByKey( VTKM_CONT static void SortByKey(
vtkm::cont::ArrayHandle<T,StorageT> &keys, vtkm::cont::ArrayHandle<T,StorageT> &keys,
vtkm::cont::ArrayHandle<U,StorageU> &values); vtkm::cont::ArrayHandle<U,StorageU> &values);
@ -336,7 +336,7 @@ struct DeviceAdapterAlgorithm
/// BinaryCompare should be a strict weak ordering comparison operator /// BinaryCompare should be a strict weak ordering comparison operator
/// ///
template<typename T, typename U, class StorageT, class StorageU, class BinaryCompare> template<typename T, typename U, class StorageT, class StorageU, class BinaryCompare>
VTKM_CONT_EXPORT static void SortByKey( VTKM_CONT static void SortByKey(
vtkm::cont::ArrayHandle<T,StorageT> &keys, vtkm::cont::ArrayHandle<T,StorageT> &keys,
vtkm::cont::ArrayHandle<U,StorageU> &values, vtkm::cont::ArrayHandle<U,StorageU> &values,
BinaryCompare binary_compare) BinaryCompare binary_compare)
@ -352,7 +352,7 @@ struct DeviceAdapterAlgorithm
/// compaction algorithm. /// compaction algorithm.
/// ///
template<typename T, class CStencil, class COut> template<typename T, class CStencil, class COut>
VTKM_CONT_EXPORT static void StreamCompact( VTKM_CONT static void StreamCompact(
const vtkm::cont::ArrayHandle<T,CStencil> &stencil, const vtkm::cont::ArrayHandle<T,CStencil> &stencil,
vtkm::cont::ArrayHandle<vtkm::Id,COut> &output); vtkm::cont::ArrayHandle<vtkm::Id,COut> &output);
@ -368,7 +368,7 @@ struct DeviceAdapterAlgorithm
/// algorithm. /// algorithm.
/// ///
template<typename T, typename U, class CIn, class CStencil, class COut> template<typename T, typename U, class CIn, class CStencil, class COut>
VTKM_CONT_EXPORT static void StreamCompact( VTKM_CONT static void StreamCompact(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
const vtkm::cont::ArrayHandle<U,CStencil> &stencil, const vtkm::cont::ArrayHandle<U,CStencil> &stencil,
vtkm::cont::ArrayHandle<T,COut> &output); vtkm::cont::ArrayHandle<T,COut> &output);
@ -386,7 +386,7 @@ struct DeviceAdapterAlgorithm
/// ///
template<typename T, typename U, class CIn, class CStencil, template<typename T, typename U, class CIn, class CStencil,
class COut, class UnaryPredicate> class COut, class UnaryPredicate>
VTKM_CONT_EXPORT static void StreamCompact( VTKM_CONT static void StreamCompact(
const vtkm::cont::ArrayHandle<T,CIn> &input, const vtkm::cont::ArrayHandle<T,CIn> &input,
const vtkm::cont::ArrayHandle<U,CStencil> &stencil, const vtkm::cont::ArrayHandle<U,CStencil> &stencil,
vtkm::cont::ArrayHandle<T,COut> &output, vtkm::cont::ArrayHandle<T,COut> &output,
@ -396,7 +396,7 @@ struct DeviceAdapterAlgorithm
/// ///
/// Waits for any asynchronous operations running on the device to complete. /// Waits for any asynchronous operations running on the device to complete.
/// ///
VTKM_CONT_EXPORT static void Synchronize(); VTKM_CONT static void Synchronize();
/// \brief Reduce an array to only the unique values it contains /// \brief Reduce an array to only the unique values it contains
/// ///
@ -406,7 +406,7 @@ struct DeviceAdapterAlgorithm
/// be modified by this operation. /// be modified by this operation.
/// ///
template<typename T, class Storage> template<typename T, class Storage>
VTKM_CONT_EXPORT static void Unique( VTKM_CONT static void Unique(
vtkm::cont::ArrayHandle<T,Storage>& values); vtkm::cont::ArrayHandle<T,Storage>& values);
/// \brief Reduce an array to only the unique values it contains /// \brief Reduce an array to only the unique values it contains
@ -420,7 +420,7 @@ struct DeviceAdapterAlgorithm
/// is unique. The predicate must return true if the two items are the same. /// is unique. The predicate must return true if the two items are the same.
/// ///
template<typename T, class Storage, class BinaryCompare> template<typename T, class Storage, class BinaryCompare>
VTKM_CONT_EXPORT static void Unique( VTKM_CONT static void Unique(
vtkm::cont::ArrayHandle<T,Storage>& values, vtkm::cont::ArrayHandle<T,Storage>& values,
BinaryCompare binary_compare); BinaryCompare binary_compare);
@ -434,7 +434,7 @@ struct DeviceAdapterAlgorithm
/// \arg \c input must already be sorted /// \arg \c input must already be sorted
/// ///
template<typename T, class CIn, class CVal, class COut> template<typename T, class CIn, class CVal, class COut>
VTKM_CONT_EXPORT static void UpperBounds( VTKM_CONT static void UpperBounds(
const vtkm::cont::ArrayHandle<T,CIn>& input, const vtkm::cont::ArrayHandle<T,CIn>& input,
const vtkm::cont::ArrayHandle<T,CVal>& values, const vtkm::cont::ArrayHandle<T,CVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,COut>& output); vtkm::cont::ArrayHandle<vtkm::Id,COut>& output);
@ -450,7 +450,7 @@ struct DeviceAdapterAlgorithm
/// \arg \c input must already be sorted /// \arg \c input must already be sorted
/// ///
template<typename T, class CIn, class CVal, class COut, class BinaryCompare> template<typename T, class CIn, class CVal, class COut, class BinaryCompare>
VTKM_CONT_EXPORT static void UpperBounds( VTKM_CONT static void UpperBounds(
const vtkm::cont::ArrayHandle<T,CIn>& input, const vtkm::cont::ArrayHandle<T,CIn>& input,
const vtkm::cont::ArrayHandle<T,CVal>& values, const vtkm::cont::ArrayHandle<T,CVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,COut>& output, vtkm::cont::ArrayHandle<vtkm::Id,COut>& output,
@ -464,7 +464,7 @@ struct DeviceAdapterAlgorithm
/// of the arrays is limited to vtkm::Id. /// of the arrays is limited to vtkm::Id.
/// ///
template<class CIn, class COut> template<class CIn, class COut>
VTKM_CONT_EXPORT static void UpperBounds( VTKM_CONT static void UpperBounds(
const vtkm::cont::ArrayHandle<vtkm::Id,CIn>& input, const vtkm::cont::ArrayHandle<vtkm::Id,CIn>& input,
vtkm::cont::ArrayHandle<vtkm::Id,COut>& values_output); vtkm::cont::ArrayHandle<vtkm::Id,COut>& values_output);
}; };
@ -486,7 +486,7 @@ public:
/// When a timer is constructed, all threads are synchronized and the /// When a timer is constructed, all threads are synchronized and the
/// current time is marked so that GetElapsedTime returns the number of /// current time is marked so that GetElapsedTime returns the number of
/// seconds elapsed since the construction. /// seconds elapsed since the construction.
VTKM_CONT_EXPORT DeviceAdapterTimerImplementation() VTKM_CONT DeviceAdapterTimerImplementation()
{ {
this->Reset(); this->Reset();
} }
@ -495,7 +495,7 @@ public:
/// number of seconds elapsed since the call to this. This method /// number of seconds elapsed since the call to this. This method
/// synchronizes all asynchronous operations. /// synchronizes all asynchronous operations.
/// ///
VTKM_CONT_EXPORT void Reset() VTKM_CONT void Reset()
{ {
this->StartTime = this->GetCurrentTime(); this->StartTime = this->GetCurrentTime();
} }
@ -506,7 +506,7 @@ public:
/// number of times to get the progressive time. This method synchronizes all /// number of times to get the progressive time. This method synchronizes all
/// asynchronous operations. /// asynchronous operations.
/// ///
VTKM_CONT_EXPORT vtkm::Float64 GetElapsedTime() VTKM_CONT vtkm::Float64 GetElapsedTime()
{ {
TimeStamp currentTime = this->GetCurrentTime(); TimeStamp currentTime = this->GetCurrentTime();
@ -525,7 +525,7 @@ public:
}; };
TimeStamp StartTime; TimeStamp StartTime;
VTKM_CONT_EXPORT TimeStamp GetCurrentTime() VTKM_CONT TimeStamp GetCurrentTime()
{ {
vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag> vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag>
::Synchronize(); ::Synchronize();
@ -566,7 +566,7 @@ public:
/// The default implementation is to return the value of /// The default implementation is to return the value of
/// vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag>::Valid /// vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag>::Valid
/// ///
VTKM_CONT_EXPORT bool Exists() const VTKM_CONT bool Exists() const
{ {
typedef vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag> DeviceAdapterTraits; typedef vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag> DeviceAdapterTraits;
return DeviceAdapterTraits::Valid; return DeviceAdapterTraits::Valid;

@ -70,10 +70,10 @@ struct PolymorphicArrayHandleContainer
ArrayHandleType Array; ArrayHandleType Array;
VTKM_CONT_EXPORT VTKM_CONT
PolymorphicArrayHandleContainer() : Array() { } PolymorphicArrayHandleContainer() : Array() { }
VTKM_CONT_EXPORT VTKM_CONT
PolymorphicArrayHandleContainer(const ArrayHandleType &array) PolymorphicArrayHandleContainer(const ArrayHandleType &array)
: Array(array) { } : Array(array) { }
@ -107,7 +107,7 @@ struct PolymorphicArrayHandleContainer
// class to get at the internals for the copy constructor. // class to get at the internals for the copy constructor.
struct DynamicArrayHandleCopyHelper { struct DynamicArrayHandleCopyHelper {
template<typename TypeList, typename StorageList> template<typename TypeList, typename StorageList>
VTKM_CONT_EXPORT VTKM_CONT
static static
const std::shared_ptr<vtkm::cont::detail::PolymorphicArrayHandleContainerBase>& const std::shared_ptr<vtkm::cont::detail::PolymorphicArrayHandleContainerBase>&
GetArrayHandleContainer(const vtkm::cont::DynamicArrayHandleBase<TypeList,StorageList> &src) GetArrayHandleContainer(const vtkm::cont::DynamicArrayHandleBase<TypeList,StorageList> &src)
@ -120,7 +120,7 @@ struct DynamicArrayHandleCopyHelper {
// PolymorphicArrayHandleContainerBase to the given type of ArrayHandle. If the // PolymorphicArrayHandleContainerBase to the given type of ArrayHandle. If the
// conversion cannot be done, nullptr is returned. // conversion cannot be done, nullptr is returned.
template<typename Type, typename Storage> template<typename Type, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandle<Type,Storage> * vtkm::cont::ArrayHandle<Type,Storage> *
DynamicArrayHandleTryCast( DynamicArrayHandleTryCast(
vtkm::cont::detail::PolymorphicArrayHandleContainerBase *arrayContainer) vtkm::cont::detail::PolymorphicArrayHandleContainerBase *arrayContainer)
@ -140,7 +140,7 @@ DynamicArrayHandleTryCast(
} }
template<typename Type, typename Storage> template<typename Type, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandle<Type,Storage> * vtkm::cont::ArrayHandle<Type,Storage> *
DynamicArrayHandleTryCast( DynamicArrayHandleTryCast(
const std::shared_ptr<vtkm::cont::detail::PolymorphicArrayHandleContainerBase>& arrayContainer) const std::shared_ptr<vtkm::cont::detail::PolymorphicArrayHandleContainerBase>& arrayContainer)
@ -187,33 +187,33 @@ template<typename TypeList, typename StorageList>
class DynamicArrayHandleBase class DynamicArrayHandleBase
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase() { } DynamicArrayHandleBase() { }
template<typename Type, typename Storage> template<typename Type, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase(const vtkm::cont::ArrayHandle<Type,Storage> &array) DynamicArrayHandleBase(const vtkm::cont::ArrayHandle<Type,Storage> &array)
: ArrayContainer(new vtkm::cont::detail::PolymorphicArrayHandleContainer< : ArrayContainer(new vtkm::cont::detail::PolymorphicArrayHandleContainer<
Type,Storage>(array)) Type,Storage>(array))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase( DynamicArrayHandleBase(
const DynamicArrayHandleBase<TypeList,StorageList> &src) const DynamicArrayHandleBase<TypeList,StorageList> &src)
: ArrayContainer(src.ArrayContainer) { } : ArrayContainer(src.ArrayContainer) { }
template<typename OtherTypeList, typename OtherStorageList> template<typename OtherTypeList, typename OtherStorageList>
VTKM_CONT_EXPORT VTKM_CONT
explicit DynamicArrayHandleBase( explicit DynamicArrayHandleBase(
const DynamicArrayHandleBase<OtherTypeList,OtherStorageList> &src) const DynamicArrayHandleBase<OtherTypeList,OtherStorageList> &src)
: ArrayContainer( : ArrayContainer(
detail::DynamicArrayHandleCopyHelper::GetArrayHandleContainer(src)) detail::DynamicArrayHandleCopyHelper::GetArrayHandleContainer(src))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
~DynamicArrayHandleBase() { } ~DynamicArrayHandleBase() { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicArrayHandleBase<TypeList,StorageList> & vtkm::cont::DynamicArrayHandleBase<TypeList,StorageList> &
operator=(const vtkm::cont::DynamicArrayHandleBase<TypeList,StorageList> &src) operator=(const vtkm::cont::DynamicArrayHandleBase<TypeList,StorageList> &src)
{ {
@ -225,7 +225,7 @@ public:
/// storage. /// storage.
/// ///
template<typename Type, typename Storage> template<typename Type, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
bool IsTypeAndStorage() const { bool IsTypeAndStorage() const {
return ( return (
detail::DynamicArrayHandleTryCast<Type,Storage>(this->ArrayContainer) detail::DynamicArrayHandleTryCast<Type,Storage>(this->ArrayContainer)
@ -235,7 +235,7 @@ public:
/// Returns true if this array matches the array handle type passed in. /// Returns true if this array matches the array handle type passed in.
/// ///
template<typename ArrayHandleType> template<typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
bool IsType() bool IsType()
{ {
VTKM_IS_ARRAY_HANDLE(ArrayHandleType); VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
@ -248,7 +248,7 @@ public:
/// type as the object given. /// type as the object given.
/// ///
template<typename ArrayHandleType> template<typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
bool IsSameType(const ArrayHandleType &) bool IsSameType(const ArrayHandleType &)
{ {
VTKM_IS_ARRAY_HANDLE(ArrayHandleType); VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
@ -261,7 +261,7 @@ public:
/// ///
/// ///
template<typename Type, typename Storage> template<typename Type, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::ArrayHandle<Type, Storage> vtkm::cont::ArrayHandle<Type, Storage>
CastToTypeStorage() const { CastToTypeStorage() const {
vtkm::cont::ArrayHandle<Type, Storage> *downcastArray = vtkm::cont::ArrayHandle<Type, Storage> *downcastArray =
@ -281,7 +281,7 @@ public:
/// to check if the cast can happen. /// to check if the cast can happen.
/// ///
template<typename ArrayHandleType> template<typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleType Cast() const { ArrayHandleType Cast() const {
VTKM_IS_ARRAY_HANDLE(ArrayHandleType); VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
typedef typename ArrayHandleType::ValueType ValueType; typedef typename ArrayHandleType::ValueType ValueType;
@ -301,7 +301,7 @@ public:
/// in the data in one array will be reflected in the other. /// in the data in one array will be reflected in the other.
/// ///
template<typename ArrayHandleType> template<typename ArrayHandleType>
VTKM_CONT_EXPORT VTKM_CONT
void CopyTo(ArrayHandleType &array) const { void CopyTo(ArrayHandleType &array) const {
VTKM_IS_ARRAY_HANDLE(ArrayHandleType); VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
array = this->Cast<ArrayHandleType>(); array = this->Cast<ArrayHandleType>();
@ -315,7 +315,7 @@ public:
/// constraints. /// constraints.
/// ///
template<typename NewTypeList> template<typename NewTypeList>
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase<NewTypeList,StorageList> DynamicArrayHandleBase<NewTypeList,StorageList>
ResetTypeList(NewTypeList = NewTypeList()) const { ResetTypeList(NewTypeList = NewTypeList()) const {
VTKM_IS_LIST_TAG(NewTypeList); VTKM_IS_LIST_TAG(NewTypeList);
@ -330,7 +330,7 @@ public:
/// using an array of particular constraints. /// using an array of particular constraints.
/// ///
template<typename NewStorageList> template<typename NewStorageList>
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase<TypeList,NewStorageList> DynamicArrayHandleBase<TypeList,NewStorageList>
ResetStorageList(NewStorageList = NewStorageList()) const { ResetStorageList(NewStorageList = NewStorageList()) const {
VTKM_IS_LIST_TAG(NewStorageList); VTKM_IS_LIST_TAG(NewStorageList);
@ -344,7 +344,7 @@ public:
/// types and traits. /// types and traits.
/// ///
template<typename NewTypeList, typename NewStorageList> template<typename NewTypeList, typename NewStorageList>
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase<NewTypeList,NewStorageList> DynamicArrayHandleBase<NewTypeList,NewStorageList>
ResetTypeAndStorageLists(NewTypeList = NewTypeList(), ResetTypeAndStorageLists(NewTypeList = NewTypeList(),
NewStorageList = NewStorageList()) const { NewStorageList = NewStorageList()) const {
@ -361,7 +361,7 @@ public:
/// respectively. /// respectively.
/// ///
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
void CastAndCall(const Functor &f) const; void CastAndCall(const Functor &f) const;
/// \brief Create a new array of the same type as this array. /// \brief Create a new array of the same type as this array.
@ -370,7 +370,7 @@ public:
/// returns a new dynamic array handle for it. This method is convenient when /// returns a new dynamic array handle for it. This method is convenient when
/// creating output arrays that should be the same type as some input array. /// creating output arrays that should be the same type as some input array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleBase<TypeList,StorageList> NewInstance() const DynamicArrayHandleBase<TypeList,StorageList> NewInstance() const
{ {
DynamicArrayHandleBase<TypeList,StorageList> newArray; DynamicArrayHandleBase<TypeList,StorageList> newArray;
@ -384,7 +384,7 @@ public:
/// each value of the array. The number of components is determined by /// each value of the array. The number of components is determined by
/// the \c VecTraits::NUM_COMPONENTS trait class. /// the \c VecTraits::NUM_COMPONENTS trait class.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetNumberOfComponents() const vtkm::IdComponent GetNumberOfComponents() const
{ {
return this->ArrayContainer->GetNumberOfComponents(); return this->ArrayContainer->GetNumberOfComponents();
@ -392,13 +392,13 @@ public:
/// \brief Get the number of values in the array. /// \brief Get the number of values in the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->ArrayContainer->GetNumberOfValues(); return this->ArrayContainer->GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual void PrintSummary(std::ostream &out) const virtual void PrintSummary(std::ostream &out) const
{ {
this->ArrayContainer->PrintSummary(out); this->ArrayContainer->PrintSummary(out);
@ -423,13 +423,13 @@ struct DynamicArrayHandleTryStorage {
const Functor &Function; const Functor &Function;
bool FoundCast; bool FoundCast;
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleTryStorage(const DynamicArrayHandle &array, DynamicArrayHandleTryStorage(const DynamicArrayHandle &array,
const Functor &f) const Functor &f)
: Array(&array), Function(f), FoundCast(false) { } : Array(&array), Function(f), FoundCast(false) { }
template<typename Storage> template<typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(Storage) { void operator()(Storage) {
this->DoCast(Storage(), this->DoCast(Storage(),
typename vtkm::cont::internal::IsValidArrayHandle<Type,Storage>::type()); typename vtkm::cont::internal::IsValidArrayHandle<Type,Storage>::type());
@ -460,12 +460,12 @@ struct DynamicArrayHandleTryType {
const Functor &Function; const Functor &Function;
bool FoundCast; bool FoundCast;
VTKM_CONT_EXPORT VTKM_CONT
DynamicArrayHandleTryType(const DynamicArrayHandle &array, const Functor &f) DynamicArrayHandleTryType(const DynamicArrayHandle &array, const Functor &f)
: Array(&array), Function(f), FoundCast(false) { } : Array(&array), Function(f), FoundCast(false) { }
template<typename Type> template<typename Type>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(Type) { void operator()(Type) {
if (this->FoundCast) { return; } if (this->FoundCast) { return; }
typedef DynamicArrayHandleTryStorage<Functor, Type> TryStorageType; typedef DynamicArrayHandleTryStorage<Functor, Type> TryStorageType;
@ -484,7 +484,7 @@ struct DynamicArrayHandleTryType {
template<typename TypeList, typename StorageList> template<typename TypeList, typename StorageList>
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
void DynamicArrayHandleBase<TypeList,StorageList>:: void DynamicArrayHandleBase<TypeList,StorageList>::
CastAndCall(const Functor &f) const CastAndCall(const Functor &f) const
{ {
@ -512,7 +512,7 @@ void DynamicArrayHandleBase<TypeList,StorageList>::
template<> template<>
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
void DynamicArrayHandleBase<VTKM_DEFAULT_TYPE_LIST_TAG, void DynamicArrayHandleBase<VTKM_DEFAULT_TYPE_LIST_TAG,
VTKM_DEFAULT_STORAGE_LIST_TAG>:: VTKM_DEFAULT_STORAGE_LIST_TAG>::
CastAndCall(const Functor &f) const CastAndCall(const Functor &f) const

@ -43,7 +43,7 @@ namespace detail {
// get at the internals for the copy constructor. // get at the internals for the copy constructor.
struct DynamicCellSetCopyHelper { struct DynamicCellSetCopyHelper {
template<typename CellSetList> template<typename CellSetList>
VTKM_CONT_EXPORT VTKM_CONT
static static
const std::shared_ptr<vtkm::cont::internal::SimplePolymorphicContainerBase>& const std::shared_ptr<vtkm::cont::internal::SimplePolymorphicContainerBase>&
GetCellSetContainer(const vtkm::cont::DynamicCellSetBase<CellSetList> &src) GetCellSetContainer(const vtkm::cont::DynamicCellSetBase<CellSetList> &src)
@ -56,7 +56,7 @@ struct DynamicCellSetCopyHelper {
// SimplePolymorphicContainerBase to the given subclass of CellSet. If the // SimplePolymorphicContainerBase to the given subclass of CellSet. If the
// conversion cannot be done, nullptr is returned. // conversion cannot be done, nullptr is returned.
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
CellSetType * CellSetType *
DynamicCellSetTryCast( DynamicCellSetTryCast(
vtkm::cont::internal::SimplePolymorphicContainerBase *cellSetContainer) vtkm::cont::internal::SimplePolymorphicContainerBase *cellSetContainer)
@ -76,7 +76,7 @@ DynamicCellSetTryCast(
} }
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
CellSetType * CellSetType *
DynamicCellSetTryCast( DynamicCellSetTryCast(
const std::shared_ptr<vtkm::cont::internal::SimplePolymorphicContainerBase>& cellSetContainer) const std::shared_ptr<vtkm::cont::internal::SimplePolymorphicContainerBase>& cellSetContainer)
@ -120,11 +120,11 @@ class DynamicCellSetBase
{ {
VTKM_IS_LIST_TAG(CellSetList); VTKM_IS_LIST_TAG(CellSetList);
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DynamicCellSetBase() { } DynamicCellSetBase() { }
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
DynamicCellSetBase(const CellSetType &cellSet) DynamicCellSetBase(const CellSetType &cellSet)
: CellSetContainer( : CellSetContainer(
new vtkm::cont::internal::SimplePolymorphicContainer<CellSetType>( new vtkm::cont::internal::SimplePolymorphicContainer<CellSetType>(
@ -133,22 +133,22 @@ public:
VTKM_IS_CELL_SET(CellSetType); VTKM_IS_CELL_SET(CellSetType);
} }
VTKM_CONT_EXPORT VTKM_CONT
DynamicCellSetBase(const DynamicCellSetBase<CellSetList> &src) DynamicCellSetBase(const DynamicCellSetBase<CellSetList> &src)
: CellSetContainer(src.CellSetContainer) { } : CellSetContainer(src.CellSetContainer) { }
template<typename OtherCellSetList> template<typename OtherCellSetList>
VTKM_CONT_EXPORT VTKM_CONT
explicit explicit
DynamicCellSetBase(const DynamicCellSetBase<OtherCellSetList> &src) DynamicCellSetBase(const DynamicCellSetBase<OtherCellSetList> &src)
: CellSetContainer( : CellSetContainer(
detail::DynamicCellSetCopyHelper::GetCellSetContainer(src)) detail::DynamicCellSetCopyHelper::GetCellSetContainer(src))
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
~DynamicCellSetBase() { } ~DynamicCellSetBase() { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicCellSetBase<CellSetList> & vtkm::cont::DynamicCellSetBase<CellSetList> &
operator=(const vtkm::cont::DynamicCellSetBase<CellSetList> &src) operator=(const vtkm::cont::DynamicCellSetBase<CellSetList> &src)
{ {
@ -159,7 +159,7 @@ public:
/// Returns true if this cell set is of the provided type. /// Returns true if this cell set is of the provided type.
/// ///
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
bool IsType() const { bool IsType() const {
return (detail::DynamicCellSetTryCast<CellSetType>(this->CellSetContainer) return (detail::DynamicCellSetTryCast<CellSetType>(this->CellSetContainer)
!= nullptr); != nullptr);
@ -169,14 +169,14 @@ public:
/// object provided. /// object provided.
/// ///
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
bool IsSameType(const CellSetType &) const { bool IsSameType(const CellSetType &) const {
return this->IsType<CellSetType>(); return this->IsType<CellSetType>();
} }
/// Returns the contained cell set as the abstract \c CellSet type. /// Returns the contained cell set as the abstract \c CellSet type.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::CellSet &CastToBase() const { const vtkm::cont::CellSet &CastToBase() const {
return *reinterpret_cast<const vtkm::cont::CellSet *>( return *reinterpret_cast<const vtkm::cont::CellSet *>(
this->CellSetContainer->GetVoidPointer()); this->CellSetContainer->GetVoidPointer());
@ -187,7 +187,7 @@ public:
/// the cast can happen. /// the cast can happen.
/// ///
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
CellSetType &Cast() const { CellSetType &Cast() const {
CellSetType *cellSetPointer = CellSetType *cellSetPointer =
detail::DynamicCellSetTryCast<CellSetType>(this->CellSetContainer); detail::DynamicCellSetTryCast<CellSetType>(this->CellSetContainer);
@ -207,7 +207,7 @@ public:
/// copied. /// copied.
/// ///
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
void CopyTo(CellSetType &cellSet) const { void CopyTo(CellSetType &cellSet) const {
cellSet = this->Cast<CellSetType>(); cellSet = this->Cast<CellSetType>();
} }
@ -220,7 +220,7 @@ public:
/// when using a cell set of particular constraints. /// when using a cell set of particular constraints.
/// ///
template<typename NewCellSetList> template<typename NewCellSetList>
VTKM_CONT_EXPORT VTKM_CONT
DynamicCellSetBase<NewCellSetList> DynamicCellSetBase<NewCellSetList>
ResetCellSetList(NewCellSetList = NewCellSetList()) const { ResetCellSetList(NewCellSetList = NewCellSetList()) const {
VTKM_IS_LIST_TAG(NewCellSetList); VTKM_IS_LIST_TAG(NewCellSetList);
@ -235,7 +235,7 @@ public:
/// behavior from \c CastAndCall. /// behavior from \c CastAndCall.
/// ///
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
void CastAndCall(const Functor &f) const; void CastAndCall(const Functor &f) const;
/// \brief Create a new cell set of the same type as this cell set. /// \brief Create a new cell set of the same type as this cell set.
@ -245,7 +245,7 @@ public:
/// creating output data sets that should be the same type as some input cell /// creating output data sets that should be the same type as some input cell
/// set. /// set.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
DynamicCellSetBase<CellSetList> NewInstance() const DynamicCellSetBase<CellSetList> NewInstance() const
{ {
DynamicCellSetBase<CellSetList> newCellSet; DynamicCellSetBase<CellSetList> newCellSet;
@ -253,37 +253,37 @@ public:
return newCellSet; return newCellSet;
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual std::string GetName() const virtual std::string GetName() const
{ {
return this->CastToBase().GetName(); return this->CastToBase().GetName();
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual vtkm::Id GetNumberOfCells() const virtual vtkm::Id GetNumberOfCells() const
{ {
return this->CastToBase().GetNumberOfCells(); return this->CastToBase().GetNumberOfCells();
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual vtkm::Id GetNumberOfFaces() const virtual vtkm::Id GetNumberOfFaces() const
{ {
return this->CastToBase().GetNumberOfFaces(); return this->CastToBase().GetNumberOfFaces();
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual vtkm::Id GetNumberOfEdges() const virtual vtkm::Id GetNumberOfEdges() const
{ {
return this->CastToBase().GetNumberOfEdges(); return this->CastToBase().GetNumberOfEdges();
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual vtkm::Id GetNumberOfPoints() const virtual vtkm::Id GetNumberOfPoints() const
{ {
return this->CastToBase().GetNumberOfPoints(); return this->CastToBase().GetNumberOfPoints();
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual void PrintSummary(std::ostream& stream) const virtual void PrintSummary(std::ostream& stream) const
{ {
return this->CastToBase().PrintSummary(stream); return this->CastToBase().PrintSummary(stream);
@ -306,14 +306,14 @@ struct DynamicCellSetTryCellSet
const Functor &Function; const Functor &Function;
bool FoundCast; bool FoundCast;
VTKM_CONT_EXPORT VTKM_CONT
DynamicCellSetTryCellSet( DynamicCellSetTryCellSet(
vtkm::cont::internal::SimplePolymorphicContainerBase *cellSetContainer, vtkm::cont::internal::SimplePolymorphicContainerBase *cellSetContainer,
const Functor &f) const Functor &f)
: CellSetContainer(cellSetContainer), Function(f), FoundCast(false) { } : CellSetContainer(cellSetContainer), Function(f), FoundCast(false) { }
template<typename CellSetType> template<typename CellSetType>
VTKM_CONT_EXPORT VTKM_CONT
void operator()(CellSetType) { void operator()(CellSetType) {
if (!this->FoundCast) if (!this->FoundCast)
{ {
@ -332,7 +332,7 @@ struct DynamicCellSetTryCellSet
template<typename CellSetList> template<typename CellSetList>
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
void DynamicCellSetBase<CellSetList>::CastAndCall(const Functor &f) const void DynamicCellSetBase<CellSetList>::CastAndCall(const Functor &f) const
{ {
typedef detail::DynamicCellSetTryCellSet<Functor> TryCellSetType; typedef detail::DynamicCellSetTryCellSet<Functor> TryCellSetType;

@ -41,14 +41,14 @@ namespace internal {
struct RangeMin struct RangeMin
{ {
template<typename T> template<typename T>
VTKM_EXEC_EXPORT VTKM_EXEC
T operator()(const T& a, const T& b)const { return vtkm::Min(a,b); } T operator()(const T& a, const T& b)const { return vtkm::Min(a,b); }
}; };
struct RangeMax struct RangeMax
{ {
template<typename T> template<typename T>
VTKM_EXEC_EXPORT VTKM_EXEC
T operator()(const T& a, const T& b)const { return vtkm::Max(a,b); } T operator()(const T& a, const T& b)const { return vtkm::Max(a,b); }
}; };
@ -133,7 +133,7 @@ public:
}; };
/// constructors for points / whole mesh /// constructors for points / whole mesh
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const vtkm::cont::DynamicArrayHandle &data) const vtkm::cont::DynamicArrayHandle &data)
@ -150,7 +150,7 @@ public:
} }
template<typename T, typename Storage> template<typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const ArrayHandle<T, Storage> &data) const ArrayHandle<T, Storage> &data)
@ -167,7 +167,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const std::vector<T> &data) const std::vector<T> &data)
@ -184,7 +184,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const T *data, const T *data,
@ -202,7 +202,7 @@ public:
} }
/// constructors for cell set associations /// constructors for cell set associations
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const std::string& cellSetName, const std::string& cellSetName,
@ -219,7 +219,7 @@ public:
} }
template <typename T, typename Storage> template <typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const std::string& cellSetName, const std::string& cellSetName,
@ -236,7 +236,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const std::string& cellSetName, const std::string& cellSetName,
@ -253,7 +253,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
const std::string& cellSetName, const std::string& cellSetName,
@ -271,7 +271,7 @@ public:
} }
/// constructors for logical dimension associations /// constructors for logical dimension associations
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
vtkm::IdComponent logicalDim, vtkm::IdComponent logicalDim,
@ -288,7 +288,7 @@ public:
} }
template <typename T, typename Storage> template <typename T, typename Storage>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
vtkm::IdComponent logicalDim, vtkm::IdComponent logicalDim,
@ -304,7 +304,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
vtkm::IdComponent logicalDim, vtkm::IdComponent logicalDim,
@ -320,7 +320,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
Field(std::string name, Field(std::string name,
AssociationEnum association, AssociationEnum association,
vtkm::IdComponent logicalDim, vtkm::IdComponent logicalDim,
@ -335,7 +335,7 @@ public:
CopyData(data, nvals); CopyData(data, nvals);
} }
VTKM_CONT_EXPORT VTKM_CONT
Field() Field()
: Name(), : Name(),
Association(ASSOC_ANY), Association(ASSOC_ANY),
@ -348,32 +348,32 @@ public:
//Generate an empty field //Generate an empty field
} }
VTKM_CONT_EXPORT VTKM_CONT
const std::string &GetName() const const std::string &GetName() const
{ {
return this->Name; return this->Name;
} }
VTKM_CONT_EXPORT VTKM_CONT
AssociationEnum GetAssociation() const AssociationEnum GetAssociation() const
{ {
return this->Association; return this->Association;
} }
VTKM_CONT_EXPORT VTKM_CONT
std::string GetAssocCellSet() const std::string GetAssocCellSet() const
{ {
return this->AssocCellSetName; return this->AssocCellSetName;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::IdComponent GetAssocLogicalDim() const vtkm::IdComponent GetAssocLogicalDim() const
{ {
return this->AssocLogicalDim; return this->AssocLogicalDim;
} }
template<typename DeviceAdapterTag, typename TypeList, typename StorageList> template<typename DeviceAdapterTag, typename TypeList, typename StorageList>
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag, const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag,
TypeList, TypeList,
StorageList) const StorageList) const
@ -389,7 +389,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList, typename StorageList> template<typename DeviceAdapterTag, typename TypeList, typename StorageList>
VTKM_CONT_EXPORT VTKM_CONT
void GetRange(vtkm::Range *range, void GetRange(vtkm::Range *range,
DeviceAdapterTag, DeviceAdapterTag,
TypeList, TypeList,
@ -405,7 +405,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList> template<typename DeviceAdapterTag, typename TypeList>
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag, const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag,
TypeList) const TypeList) const
{ {
@ -415,7 +415,7 @@ public:
} }
template<typename DeviceAdapterTag, typename TypeList> template<typename DeviceAdapterTag, typename TypeList>
VTKM_CONT_EXPORT VTKM_CONT
void GetRange(vtkm::Range *range, DeviceAdapterTag, TypeList) const void GetRange(vtkm::Range *range, DeviceAdapterTag, TypeList) const
{ {
this->GetRange(range, this->GetRange(range,
@ -425,7 +425,7 @@ public:
} }
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag) const const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange(DeviceAdapterTag) const
{ {
return this->GetRange(DeviceAdapterTag(), return this->GetRange(DeviceAdapterTag(),
@ -434,7 +434,7 @@ public:
} }
template<typename DeviceAdapterTag> template<typename DeviceAdapterTag>
VTKM_CONT_EXPORT VTKM_CONT
void GetRange(vtkm::Range *range, DeviceAdapterTag) const void GetRange(vtkm::Range *range, DeviceAdapterTag) const
{ {
this->GetRange(range, this->GetRange(range,
@ -443,13 +443,13 @@ public:
VTKM_DEFAULT_STORAGE_LIST_TAG()); VTKM_DEFAULT_STORAGE_LIST_TAG());
} }
VTKM_CONT_EXPORT VTKM_CONT
const vtkm::cont::DynamicArrayHandle &GetData() const const vtkm::cont::DynamicArrayHandle &GetData() const
{ {
return this->Data; return this->Data;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::cont::DynamicArrayHandle &GetData() vtkm::cont::DynamicArrayHandle &GetData()
{ {
this->ModifiedFlag = true; this->ModifiedFlag = true;
@ -457,14 +457,14 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
void SetData(const vtkm::cont::ArrayHandle<T> &newdata) void SetData(const vtkm::cont::ArrayHandle<T> &newdata)
{ {
this->Data = newdata; this->Data = newdata;
this->ModifiedFlag = true; this->ModifiedFlag = true;
} }
VTKM_CONT_EXPORT VTKM_CONT
void SetData(const vtkm::cont::DynamicArrayHandle &newdata) void SetData(const vtkm::cont::DynamicArrayHandle &newdata)
{ {
this->Data = newdata; this->Data = newdata;
@ -472,7 +472,7 @@ public:
} }
template <typename T> template <typename T>
VTKM_CONT_EXPORT VTKM_CONT
void CopyData(const T *ptr, vtkm::Id nvals) void CopyData(const T *ptr, vtkm::Id nvals)
{ {
//allocate main memory using an array handle //allocate main memory using an array handle
@ -489,7 +489,7 @@ public:
this->ModifiedFlag = true; this->ModifiedFlag = true;
} }
VTKM_CONT_EXPORT VTKM_CONT
virtual void PrintSummary(std::ostream &out) const virtual void PrintSummary(std::ostream &out) const
{ {
out<<" "<<this->Name; out<<" "<<this->Name;

@ -35,13 +35,13 @@ template<class Device = VTKM_DEFAULT_DEVICE_ADAPTER_TAG>
class RuntimeDeviceInformation class RuntimeDeviceInformation
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
RuntimeDeviceInformation() : RuntimeImplementation() { } RuntimeDeviceInformation() : RuntimeImplementation() { }
/// Returns true if the given device adapter is supported on the current /// Returns true if the given device adapter is supported on the current
/// machine. /// machine.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
bool Exists() const bool Exists() const
{ {
return this->RuntimeImplementation.Exists(); return this->RuntimeImplementation.Exists();

@ -115,16 +115,16 @@ public:
/// Returns a portal to the array. /// Returns a portal to the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal(); PortalType GetPortal();
/// Returns a portal to the array with immutable values. /// Returns a portal to the array with immutable values.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const; PortalConstType GetPortalConst() const;
/// Retuns the number of entries allocated in the array. /// Retuns the number of entries allocated in the array.
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const; vtkm::Id GetNumberOfValues() const;
/// \brief Allocates an array large enough to hold the given number of values. /// \brief Allocates an array large enough to hold the given number of values.
@ -135,7 +135,7 @@ public:
/// ErrorControlBadValue if the allocation is not feasible (for example, the /// ErrorControlBadValue if the allocation is not feasible (for example, the
/// array storage is read-only). /// array storage is read-only).
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues); void Allocate(vtkm::Id numberOfValues);
/// \brief Reduces the size of the array without changing its values. /// \brief Reduces the size of the array without changing its values.
@ -146,7 +146,7 @@ public:
/// \c numberOfValues must be equal or less than the preexisting size /// \c numberOfValues must be equal or less than the preexisting size
/// (returned from GetNumberOfValues). That is, this method can only be used /// (returned from GetNumberOfValues). That is, this method can only be used
/// to shorten the array, not lengthen. /// to shorten the array, not lengthen.
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues); void Shrink(vtkm::Id numberOfValues);
/// \brief Frees any resources (i.e. memory) stored in this array. /// \brief Frees any resources (i.e. memory) stored in this array.
@ -154,7 +154,7 @@ public:
/// After calling this method GetNumberOfValues will return 0. The /// After calling this method GetNumberOfValues will return 0. The
/// resources should also be released when the Storage class is /// resources should also be released when the Storage class is
/// destroyed. /// destroyed.
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources(); void ReleaseResources();
}; };
#endif // VTKM_DOXYGEN_ONLY #endif // VTKM_DOXYGEN_ONLY

@ -176,7 +176,7 @@ public:
public: public:
VTKM_CONT_EXPORT VTKM_CONT
Storage(const ValueType *array = nullptr, vtkm::Id numberOfValues = 0) Storage(const ValueType *array = nullptr, vtkm::Id numberOfValues = 0)
: Array(const_cast<ValueType *>(array)), : Array(const_cast<ValueType *>(array)),
NumberOfValues(numberOfValues), NumberOfValues(numberOfValues),
@ -186,13 +186,13 @@ public:
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
~Storage() ~Storage()
{ {
this->ReleaseResources(); this->ReleaseResources();
} }
VTKM_CONT_EXPORT VTKM_CONT
Storage(const Storage<ValueType, StorageTagBasic> &src) Storage(const Storage<ValueType, StorageTagBasic> &src)
: Array(src.Array), : Array(src.Array),
NumberOfValues(src.NumberOfValues), NumberOfValues(src.NumberOfValues),
@ -208,7 +208,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
Storage &operator=(const Storage<ValueType, StorageTagBasic> &src) Storage &operator=(const Storage<ValueType, StorageTagBasic> &src)
{ {
if (src.DeallocateOnRelease) if (src.DeallocateOnRelease)
@ -228,7 +228,7 @@ public:
return *this; return *this;
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
if (this->NumberOfValues > 0) if (this->NumberOfValues > 0)
@ -250,7 +250,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id numberOfValues) void Allocate(vtkm::Id numberOfValues)
{ {
if (numberOfValues <= this->AllocatedSize) if (numberOfValues <= this->AllocatedSize)
@ -295,13 +295,13 @@ public:
this->UserProvidedMemory = false; this->UserProvidedMemory = false;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->NumberOfValues; return this->NumberOfValues;
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) void Shrink(vtkm::Id numberOfValues)
{ {
if (numberOfValues > this->GetNumberOfValues()) if (numberOfValues > this->GetNumberOfValues())
@ -313,13 +313,13 @@ public:
this->NumberOfValues = numberOfValues; this->NumberOfValues = numberOfValues;
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() PortalType GetPortal()
{ {
return PortalType(this->Array, this->Array + this->NumberOfValues); return PortalType(this->Array, this->Array + this->NumberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
return PortalConstType(this->Array, this->Array + this->NumberOfValues); return PortalConstType(this->Array, this->Array + this->NumberOfValues);
@ -331,12 +331,12 @@ public:
/// memory associated with this array still belongs to the Storage (i.e. /// memory associated with this array still belongs to the Storage (i.e.
/// Storage will eventually deallocate the array). /// Storage will eventually deallocate the array).
/// ///
VTKM_CONT_EXPORT VTKM_CONT
ValueType *GetArray() ValueType *GetArray()
{ {
return this->Array; return this->Array;
} }
VTKM_CONT_EXPORT VTKM_CONT
const ValueType *GetArray() const const ValueType *GetArray() const
{ {
return this->Array; return this->Array;
@ -351,7 +351,7 @@ public:
/// a VTK-m object around. Obviously the caller becomes responsible for /// a VTK-m object around. Obviously the caller becomes responsible for
/// destroying the memory. /// destroying the memory.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
ValueType *StealArray() ValueType *StealArray()
{ {
ValueType *saveArray = this->Array; ValueType *saveArray = this->Array;

@ -66,37 +66,37 @@ public:
typedef void *IteratorType; typedef void *IteratorType;
}; };
VTKM_CONT_EXPORT VTKM_CONT
Storage(const PortalConstType &portal = PortalConstType()) Storage(const PortalConstType &portal = PortalConstType())
: Portal(portal) { } : Portal(portal) { }
// All these methods do nothing but raise errors. // All these methods do nothing but raise errors.
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() PortalType GetPortal()
{ {
throw vtkm::cont::ErrorControlBadValue("Implicit arrays are read-only."); throw vtkm::cont::ErrorControlBadValue("Implicit arrays are read-only.");
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
return this->Portal; return this->Portal;
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->Portal.GetNumberOfValues(); return this->Portal.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id vtkmNotUsed(numberOfValues)) void Allocate(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
throw vtkm::cont::ErrorControlBadValue("Implicit arrays are read-only."); throw vtkm::cont::ErrorControlBadValue("Implicit arrays are read-only.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) void Shrink(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
throw vtkm::cont::ErrorControlBadValue("Implicit arrays are read-only."); throw vtkm::cont::ErrorControlBadValue("Implicit arrays are read-only.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
} }
@ -120,35 +120,35 @@ public:
typedef PortalControl PortalExecution; typedef PortalControl PortalExecution;
typedef PortalConstControl PortalConstExecution; typedef PortalConstControl PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayTransfer(StorageType *storage) : Storage(storage) { } ArrayTransfer(StorageType *storage) : Storage(storage) { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->Storage->GetNumberOfValues(); return this->Storage->GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData))
{ {
return this->Storage->GetPortalConst(); return this->Storage->GetPortalConst();
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData))
{ {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
"Implicit arrays cannot be used for output or in place."); "Implicit arrays cannot be used for output or in place.");
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
"Implicit arrays cannot be used for output."); "Implicit arrays cannot be used for output.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *vtkmNotUsed(controlArray)) const void RetrieveOutputData(StorageType *vtkmNotUsed(controlArray)) const
{ {
throw vtkm::cont::ErrorControlBadValue( throw vtkm::cont::ErrorControlBadValue(
@ -156,7 +156,7 @@ public:
} }
template <class IteratorTypeControl> template <class IteratorTypeControl>
VTKM_CONT_EXPORT void CopyInto(IteratorTypeControl dest) const VTKM_CONT void CopyInto(IteratorTypeControl dest) const
{ {
typedef typename StorageType::PortalConstType PortalType; typedef typename StorageType::PortalConstType PortalType;
PortalType portal = this->Storage->GetPortalConst(); PortalType portal = this->Storage->GetPortalConst();
@ -166,13 +166,13 @@ public:
dest); dest);
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id vtkmNotUsed(numberOfValues)) void Shrink(vtkm::Id vtkmNotUsed(numberOfValues))
{ {
throw vtkm::cont::ErrorControlBadValue("Implicit arrays cannot be resized."); throw vtkm::cont::ErrorControlBadValue("Implicit arrays cannot be resized.");
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { } void ReleaseResources() { }
private: private:

@ -40,14 +40,14 @@ public:
/// When a timer is constructed, all threads are synchronized and the /// When a timer is constructed, all threads are synchronized and the
/// current time is marked so that GetElapsedTime returns the number of /// current time is marked so that GetElapsedTime returns the number of
/// seconds elapsed since the construction. /// seconds elapsed since the construction.
VTKM_CONT_EXPORT VTKM_CONT
Timer() : TimerImplementation() { } Timer() : TimerImplementation() { }
/// Resets the timer. All further calls to GetElapsedTime will report the /// Resets the timer. All further calls to GetElapsedTime will report the
/// number of seconds elapsed since the call to this. This method /// number of seconds elapsed since the call to this. This method
/// synchronizes all asynchronous operations. /// synchronizes all asynchronous operations.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Reset() void Reset()
{ {
this->TimerImplementation.Reset(); this->TimerImplementation.Reset();
@ -59,7 +59,7 @@ public:
/// number of times to get the progressive time. This method synchronizes all /// number of times to get the progressive time. This method synchronizes all
/// asynchronous operations. /// asynchronous operations.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Float64 GetElapsedTime() vtkm::Float64 GetElapsedTime()
{ {
return this->TimerImplementation.GetElapsedTime(); return this->TimerImplementation.GetElapsedTime();
@ -67,8 +67,8 @@ public:
private: private:
/// Some timers are ill-defined when copied, so disallow that for all timers. /// Some timers are ill-defined when copied, so disallow that for all timers.
VTKM_CONT_EXPORT Timer(const Timer<Device> &); // Not implemented. VTKM_CONT Timer(const Timer<Device> &); // Not implemented.
VTKM_CONT_EXPORT void operator=(const Timer<Device> &); // Not implemented. VTKM_CONT void operator=(const Timer<Device> &); // Not implemented.
vtkm::cont::DeviceAdapterTimerImplementation<Device> vtkm::cont::DeviceAdapterTimerImplementation<Device>
TimerImplementation; TimerImplementation;

@ -38,7 +38,7 @@ struct TryExecuteRunIfValid;
template<typename Functor, typename Device> template<typename Functor, typename Device>
struct TryExecuteRunIfValid<Functor, Device, false> struct TryExecuteRunIfValid<Functor, Device, false>
{ {
VTKM_CONT_EXPORT VTKM_CONT
static bool Run(Functor &, vtkm::cont::internal::RuntimeDeviceTracker &) { static bool Run(Functor &, vtkm::cont::internal::RuntimeDeviceTracker &) {
return false; return false;
} }
@ -49,7 +49,7 @@ struct TryExecuteRunIfValid<Functor, Device, true>
{ {
VTKM_IS_DEVICE_ADAPTER_TAG(Device); VTKM_IS_DEVICE_ADAPTER_TAG(Device);
VTKM_CONT_EXPORT VTKM_CONT
static bool Run(Functor &functor, static bool Run(Functor &functor,
vtkm::cont::internal::RuntimeDeviceTracker &tracker) vtkm::cont::internal::RuntimeDeviceTracker &tracker)
{ {
@ -108,13 +108,13 @@ struct TryExecuteImpl
bool Success; bool Success;
VTKM_CONT_EXPORT VTKM_CONT
TryExecuteImpl(FunctorType &functor, TryExecuteImpl(FunctorType &functor,
vtkm::cont::internal::RuntimeDeviceTracker &tracker) vtkm::cont::internal::RuntimeDeviceTracker &tracker)
: Functor(functor), Tracker(tracker), Success(false) { } : Functor(functor), Tracker(tracker), Success(false) { }
template<typename Device> template<typename Device>
VTKM_CONT_EXPORT VTKM_CONT
bool operator()(Device) bool operator()(Device)
{ {
if (!this->Success) if (!this->Success)
@ -154,7 +154,7 @@ struct TryExecuteImpl
/// is used. /// is used.
/// ///
template<typename Functor, typename DeviceList> template<typename Functor, typename DeviceList>
VTKM_CONT_EXPORT VTKM_CONT
bool TryExecute(const Functor &functor, bool TryExecute(const Functor &functor,
vtkm::cont::internal::RuntimeDeviceTracker &tracker, vtkm::cont::internal::RuntimeDeviceTracker &tracker,
DeviceList) DeviceList)
@ -164,7 +164,7 @@ bool TryExecute(const Functor &functor,
return internals.Success; return internals.Success;
} }
template<typename Functor, typename DeviceList> template<typename Functor, typename DeviceList>
VTKM_CONT_EXPORT VTKM_CONT
bool TryExecute(Functor &functor, bool TryExecute(Functor &functor,
vtkm::cont::internal::RuntimeDeviceTracker &tracker, vtkm::cont::internal::RuntimeDeviceTracker &tracker,
DeviceList) DeviceList)
@ -174,28 +174,28 @@ bool TryExecute(Functor &functor,
return internals.Success; return internals.Success;
} }
template<typename Functor, typename DeviceList> template<typename Functor, typename DeviceList>
VTKM_CONT_EXPORT VTKM_CONT
bool TryExecute(const Functor &functor, DeviceList) bool TryExecute(const Functor &functor, DeviceList)
{ {
vtkm::cont::internal::RuntimeDeviceTracker tracker; vtkm::cont::internal::RuntimeDeviceTracker tracker;
return vtkm::cont::TryExecute(functor, tracker, DeviceList()); return vtkm::cont::TryExecute(functor, tracker, DeviceList());
} }
template<typename Functor, typename DeviceList> template<typename Functor, typename DeviceList>
VTKM_CONT_EXPORT VTKM_CONT
bool TryExecute(Functor &functor, DeviceList) bool TryExecute(Functor &functor, DeviceList)
{ {
vtkm::cont::internal::RuntimeDeviceTracker tracker; vtkm::cont::internal::RuntimeDeviceTracker tracker;
return vtkm::cont::TryExecute(functor, tracker, DeviceList()); return vtkm::cont::TryExecute(functor, tracker, DeviceList());
} }
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
bool TryExecute(const Functor &functor) bool TryExecute(const Functor &functor)
{ {
return vtkm::cont::TryExecute(functor, return vtkm::cont::TryExecute(functor,
VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG()); VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG());
} }
template<typename Functor> template<typename Functor>
VTKM_CONT_EXPORT VTKM_CONT
bool TryExecute(Functor &functor) bool TryExecute(Functor &functor)
{ {
return vtkm::cont::TryExecute(functor, return vtkm::cont::TryExecute(functor,

@ -65,7 +65,7 @@ struct Transport
/// operator also has a second argument that is the size of the dispatch that /// operator also has a second argument that is the size of the dispatch that
/// can be used, for example, to allocate data for an output array. /// can be used, for example, to allocate data for an output array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(const ContObjectType contData, vtkm::Id size) const; ExecObjectType operator()(const ContObjectType contData, vtkm::Id size) const;
}; };
#else // VTKM_DOXYGEN_ONLY #else // VTKM_DOXYGEN_ONLY

@ -45,7 +45,7 @@ struct Transport<vtkm::cont::arg::TransportTagArrayIn, ContObjectType, Device>
typedef typename ContObjectType::template ExecutionTypes<Device>::PortalConst typedef typename ContObjectType::template ExecutionTypes<Device>::PortalConst
ExecObjectType; ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const
{ {
// TODO: Throw an exception if object.GetNumberOfValues() does not equal // TODO: Throw an exception if object.GetNumberOfValues() does not equal

@ -48,7 +48,7 @@ struct Transport<vtkm::cont::arg::TransportTagArrayInOut, ContObjectType, Device
typedef typename ContObjectType::template ExecutionTypes<Device>::Portal typedef typename ContObjectType::template ExecutionTypes<Device>::Portal
ExecObjectType; ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(ContObjectType object, vtkm::Id size) const ExecObjectType operator()(ContObjectType object, vtkm::Id size) const
{ {
if (object.GetNumberOfValues() != size) if (object.GetNumberOfValues() != size)

@ -47,7 +47,7 @@ struct Transport<vtkm::cont::arg::TransportTagArrayOut, ContObjectType, Device>
typedef typename ContObjectType::template ExecutionTypes<Device>::Portal typedef typename ContObjectType::template ExecutionTypes<Device>::Portal
ExecObjectType; ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(ContObjectType object, vtkm::Id size) const ExecObjectType operator()(ContObjectType object, vtkm::Id size) const
{ {
return object.PrepareForOutput(size, Device()); return object.PrepareForOutput(size, Device());

@ -51,7 +51,7 @@ struct Transport<
{ {
typedef vtkm::exec::AtomicArray<T, Device> ExecObjectType; typedef vtkm::exec::AtomicArray<T, Device> ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()( ExecObjectType operator()(
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> array, vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> array,
vtkm::Id) const vtkm::Id) const

@ -50,7 +50,7 @@ struct Transport<vtkm::cont::arg::TransportTagCellSetIn<FromTopology,ToTopology>
Device,FromTopology,ToTopology> Device,FromTopology,ToTopology>
::ExecObjectType ExecObjectType; ::ExecObjectType ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const
{ {
//create CUDA version of connectivity array. //create CUDA version of connectivity array.

@ -50,7 +50,7 @@ struct Transport<vtkm::cont::arg::TransportTagExecObject,ContObjectType,Device>
typedef ContObjectType ExecObjectType; typedef ContObjectType ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const
{ {
return object; return object;

@ -56,7 +56,7 @@ struct Transport<
typedef vtkm::exec::ExecutionWholeArrayConst<ValueType, StorageTag, Device> typedef vtkm::exec::ExecutionWholeArrayConst<ValueType, StorageTag, Device>
ExecObjectType; ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(ContObjectType array, vtkm::Id) const ExecObjectType operator()(ContObjectType array, vtkm::Id) const
{ {
// Note: we ignore the size of the domain because the randomly accessed // Note: we ignore the size of the domain because the randomly accessed

@ -58,7 +58,7 @@ struct Transport<
typedef vtkm::exec::ExecutionWholeArray<ValueType, StorageTag, Device> typedef vtkm::exec::ExecutionWholeArray<ValueType, StorageTag, Device>
ExecObjectType; ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(ContObjectType array, vtkm::Id) const ExecObjectType operator()(ContObjectType array, vtkm::Id) const
{ {
// Note: we ignore the size of the domain because the randomly accessed // Note: we ignore the size of the domain because the randomly accessed

@ -58,7 +58,7 @@ struct Transport<
typedef vtkm::exec::ExecutionWholeArray<ValueType, StorageTag, Device> typedef vtkm::exec::ExecutionWholeArray<ValueType, StorageTag, Device>
ExecObjectType; ExecObjectType;
VTKM_CONT_EXPORT VTKM_CONT
ExecObjectType operator()(ContObjectType array, vtkm::Id) const ExecObjectType operator()(ContObjectType array, vtkm::Id) const
{ {
// Note: we ignore the size of the domain because the randomly accessed // Note: we ignore the size of the domain because the randomly accessed

@ -36,7 +36,7 @@ struct TestKernel : public vtkm::exec::FunctorBase
{ {
PortalType Portal; PortalType Portal;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
typedef typename PortalType::ValueType ValueType; typedef typename PortalType::ValueType ValueType;

@ -36,7 +36,7 @@ struct TestKernel : public vtkm::exec::FunctorBase
{ {
PortalType Portal; PortalType Portal;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
typedef typename PortalType::ValueType ValueType; typedef typename PortalType::ValueType ValueType;

@ -36,7 +36,7 @@ struct TestKernel : public vtkm::exec::FunctorBase
{ {
PortalType Portal; PortalType Portal;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
typedef typename PortalType::ValueType ValueType; typedef typename PortalType::ValueType ValueType;

@ -37,7 +37,7 @@ struct TestKernel : public vtkm::exec::FunctorBase
{ {
CellSetInType CellSet; CellSetInType CellSet;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id) const void operator()(vtkm::Id) const
{ {
if (this->CellSet.GetNumberOfElements() != 2) if (this->CellSet.GetNumberOfElements() != 2)

@ -40,7 +40,7 @@ struct TestKernel : public vtkm::exec::FunctorBase
{ {
TestExecutionObject Object; TestExecutionObject Object;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id) const void operator()(vtkm::Id) const
{ {
if (this->Object.Number != EXPECTED_NUMBER) if (this->Object.Number != EXPECTED_NUMBER)

@ -42,7 +42,7 @@ struct TestOutKernel : public vtkm::exec::FunctorBase
{ {
PortalType Portal; PortalType Portal;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
if (this->Portal.GetNumberOfValues() != ARRAY_SIZE) if (this->Portal.GetNumberOfValues() != ARRAY_SIZE)
@ -59,7 +59,7 @@ struct TestInKernel : public vtkm::exec::FunctorBase
{ {
PortalType Portal; PortalType Portal;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
if (this->Portal.GetNumberOfValues() != ARRAY_SIZE) if (this->Portal.GetNumberOfValues() != ARRAY_SIZE)
@ -79,7 +79,7 @@ struct TestInOutKernel : public vtkm::exec::FunctorBase
{ {
PortalType Portal; PortalType Portal;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
if (this->Portal.GetNumberOfValues() != ARRAY_SIZE) if (this->Portal.GetNumberOfValues() != ARRAY_SIZE)
@ -94,13 +94,13 @@ struct TestInOutKernel : public vtkm::exec::FunctorBase
template<typename AtomicType> template<typename AtomicType>
struct TestAtomicKernel : public vtkm::exec::FunctorBase struct TestAtomicKernel : public vtkm::exec::FunctorBase
{ {
VTKM_CONT_EXPORT VTKM_CONT
TestAtomicKernel(const AtomicType &atomicArray) TestAtomicKernel(const AtomicType &atomicArray)
: AtomicArray(atomicArray) { } : AtomicArray(atomicArray) { }
AtomicType AtomicArray; AtomicType AtomicArray;
VTKM_EXEC_EXPORT VTKM_EXEC
void operator()(vtkm::Id index) const void operator()(vtkm::Id index) const
{ {
typedef typename AtomicType::ValueType ValueType; typedef typename AtomicType::ValueType ValueType;

@ -59,35 +59,35 @@ public:
typedef T ValueType; typedef T ValueType;
typedef thrust::system::cuda::pointer<ValueType> DevicePointer; typedef thrust::system::cuda::pointer<ValueType> DevicePointer;
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalCuda() ArrayPortalCuda()
: Data(), NumberOfValues(0) : Data(), NumberOfValues(0)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalCuda(ValueType* d, vtkm::Id numberOfValues) ArrayPortalCuda(ValueType* d, vtkm::Id numberOfValues)
: Data(d), NumberOfValues(numberOfValues) : Data(d), NumberOfValues(numberOfValues)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalCuda(const DevicePointer& ptr, vtkm::Id numberOfValues) ArrayPortalCuda(const DevicePointer& ptr, vtkm::Id numberOfValues)
: Data(ptr), NumberOfValues(numberOfValues) : Data(ptr), NumberOfValues(numberOfValues)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return NumberOfValues; return NumberOfValues;
} }
VTKM_CONT_EXPORT VTKM_CONT
ValueType Get(vtkm::Id index) const ValueType Get(vtkm::Id index) const
{ {
throw vtkm::cont::ErrorControlBadType( throw vtkm::cont::ErrorControlBadType(
"ArrayHandleCuda only provides access to the device pointer."); "ArrayHandleCuda only provides access to the device pointer.");
} }
VTKM_CONT_EXPORT VTKM_CONT
DevicePointer GetDevicePointer() const DevicePointer GetDevicePointer() const
{ {
return Data; return Data;
@ -115,36 +115,36 @@ public:
typedef vtkm::cont::cuda::internal::ArrayPortalCuda<ValueType> PortalType; typedef vtkm::cont::cuda::internal::ArrayPortalCuda<ValueType> PortalType;
typedef vtkm::cont::cuda::internal::ArrayPortalCuda<ValueType> PortalConstType; typedef vtkm::cont::cuda::internal::ArrayPortalCuda<ValueType> PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
Storage(): Storage():
Data(), NumberOfValues(0), IsOwner(true) Data(), NumberOfValues(0), IsOwner(true)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
Storage(ValueType* d, vtkm::Id numberOfValues): Storage(ValueType* d, vtkm::Id numberOfValues):
Data(d), NumberOfValues(numberOfValues), IsOwner(false) Data(d), NumberOfValues(numberOfValues), IsOwner(false)
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType GetPortal() PortalType GetPortal()
{ {
return PortalType(this->Data,this->NumberOfValues); return PortalType(this->Data,this->NumberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
return PortalConstType(this->Data,this->NumberOfValues); return PortalConstType(this->Data,this->NumberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->NumberOfValues; return this->NumberOfValues;
} }
VTKM_CONT_EXPORT VTKM_CONT
void Allocate(vtkm::Id size) void Allocate(vtkm::Id size)
{ {
if (!this->OwnsResources()) if (!this->OwnsResources())
@ -157,7 +157,7 @@ public:
this->NumberOfValues = size; this->NumberOfValues = size;
} }
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) void Shrink(vtkm::Id numberOfValues)
{ {
VTKM_ASSERT(numberOfValues <= this->GetNumberOfValues()); VTKM_ASSERT(numberOfValues <= this->GetNumberOfValues());
@ -167,7 +167,7 @@ public:
this->ReleaseResources(); this->ReleaseResources();
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() void ReleaseResources()
{ {
if (!this->OwnsResources()) if (!this->OwnsResources())
@ -181,13 +181,13 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
DevicePointer GetDevicePointer() const DevicePointer GetDevicePointer() const
{ {
return this->Data; return this->Data;
} }
VTKM_CONT_EXPORT VTKM_CONT
bool OwnsResources() const bool OwnsResources() const
{ {
return this->IsOwner; return this->IsOwner;
@ -226,18 +226,18 @@ public:
typedef vtkm::exec::cuda::internal::ArrayPortalFromThrust< T > PortalType; typedef vtkm::exec::cuda::internal::ArrayPortalFromThrust< T > PortalType;
typedef vtkm::exec::cuda::internal::ConstArrayPortalFromThrust< const T > PortalConstType; typedef vtkm::exec::cuda::internal::ConstArrayPortalFromThrust< const T > PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
ArrayManagerExecutionThrustDevice(StorageType *storage) ArrayManagerExecutionThrustDevice(StorageType *storage)
: Storage(storage) : Storage(storage)
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
~ArrayManagerExecutionThrustDevice() ~ArrayManagerExecutionThrustDevice()
{ } { }
/// Returns the size of the array. /// Returns the size of the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->Storage->GetNumberOfValues(); return this->Storage->GetNumberOfValues();
@ -245,7 +245,7 @@ public:
/// Since memory is already on the device, there is nothing to prepare /// Since memory is already on the device, there is nothing to prepare
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType PrepareForInput(bool) PortalConstType PrepareForInput(bool)
{ {
return PortalConstType(this->Storage->GetDevicePointer(), return PortalConstType(this->Storage->GetDevicePointer(),
@ -255,7 +255,7 @@ public:
/// Since memory is already on the device, there is nothing to prepare /// Since memory is already on the device, there is nothing to prepare
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForInPlace(bool) PortalType PrepareForInPlace(bool)
{ {
return PortalType(this->Storage->GetDevicePointer(), return PortalType(this->Storage->GetDevicePointer(),
@ -265,7 +265,7 @@ public:
/// Allocates the array to the given size. /// Allocates the array to the given size.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForOutput(vtkm::Id numberOfValues) PortalType PrepareForOutput(vtkm::Id numberOfValues)
{ {
if (this->Storage->GetNumberOfValues()) if (this->Storage->GetNumberOfValues())
@ -279,19 +279,19 @@ public:
/// Since output data stays on the device, there is nothing to retrieve /// Since output data stays on the device, there is nothing to retrieve
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType*) const void RetrieveOutputData(StorageType*) const
{ } { }
/// Resizes the device vector. /// Resizes the device vector.
/// ///
VTKM_CONT_EXPORT void Shrink(vtkm::Id numberOfValues) VTKM_CONT void Shrink(vtkm::Id numberOfValues)
{ {
this->Storage->Shrink(static_cast<vtkm::UInt64>(numberOfValues)); this->Storage->Shrink(static_cast<vtkm::UInt64>(numberOfValues));
} }
/// Releases storage resources, if the storage owns them /// Releases storage resources, if the storage owns them
VTKM_CONT_EXPORT void ReleaseResources() VTKM_CONT void ReleaseResources()
{ {
if (this->Storage->OwnsResources()) if (this->Storage->OwnsResources())
this->Storage->ReleaseResources(); this->Storage->ReleaseResources();
@ -334,7 +334,7 @@ public:
vtkm::cont::cuda::StorageTagCuda vtkm::cont::cuda::StorageTagCuda
>)); >));
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleCuda(T *start,vtkm::Id length) ArrayHandleCuda(T *start,vtkm::Id length)
:Superclass( vtkm::cont::internal::Storage<T, vtkm::cont::cuda::StorageTagCuda>(start, length)) :Superclass( vtkm::cont::internal::Storage<T, vtkm::cont::cuda::StorageTagCuda>(start, length))
{ {
@ -345,7 +345,7 @@ public:
/// A convenience function for creating an ArrayHandle from a Cuda pointer. /// A convenience function for creating an ArrayHandle from a Cuda pointer.
/// ///
template<typename T> template<typename T>
VTKM_CONT_EXPORT vtkm::cont::ArrayHandle<T,vtkm::cont::cuda::StorageTagCuda> VTKM_CONT vtkm::cont::ArrayHandle<T,vtkm::cont::cuda::StorageTagCuda>
make_ArrayHandleCuda(T *array,vtkm::Id length) make_ArrayHandleCuda(T *array,vtkm::Id length)
{ {
typedef vtkm::cont::cuda::StorageTagCuda StorageTag; typedef vtkm::cont::cuda::StorageTagCuda StorageTag;
@ -354,7 +354,7 @@ make_ArrayHandleCuda(T *array,vtkm::Id length)
} }
template<typename T> template<typename T>
VTKM_CONT_EXPORT VTKM_CONT
void void
printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<T, printSummary_ArrayHandle(const vtkm::cont::ArrayHandle<T,
vtkm::cont::cuda::StorageTagCuda> &array, vtkm::cont::cuda::StorageTagCuda> &array,
@ -376,7 +376,7 @@ template <typename T>
class ArrayHandle : public vtkm::cont::ArrayHandleCuda<T> class ArrayHandle : public vtkm::cont::ArrayHandleCuda<T>
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandle(T *start,vtkm::Id length) ArrayHandle(T *start,vtkm::Id length)
: vtkm::cont::ArrayHandleCuda<T>(start, length) : vtkm::cont::ArrayHandleCuda<T>(start, length)
{ {

@ -47,11 +47,11 @@ public:
typedef typename Superclass::PortalConstType PortalConstType; typedef typename Superclass::PortalConstType PortalConstType;
typedef typename Superclass::StorageType StorageType; typedef typename Superclass::StorageType StorageType;
VTKM_CONT_EXPORT VTKM_CONT
ArrayManagerExecution(StorageType *storage) ArrayManagerExecution(StorageType *storage)
: Superclass(storage) { } : Superclass(storage) { }
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType PrepareForInput(bool updateData) PortalConstType PrepareForInput(bool updateData)
{ {
try try
@ -72,7 +72,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForInPlace(bool updateData) PortalType PrepareForInPlace(bool updateData)
{ {
try try
@ -93,7 +93,7 @@ public:
} }
} }
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForOutput(vtkm::Id numberOfValues) PortalType PrepareForOutput(vtkm::Id numberOfValues)
{ {
try try

@ -76,14 +76,14 @@ public:
typedef vtkm::exec::cuda::internal::ArrayPortalFromThrust< T > PortalType; typedef vtkm::exec::cuda::internal::ArrayPortalFromThrust< T > PortalType;
typedef vtkm::exec::cuda::internal::ConstArrayPortalFromThrust< T > PortalConstType; typedef vtkm::exec::cuda::internal::ConstArrayPortalFromThrust< T > PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
ArrayManagerExecutionThrustDevice(StorageType *storage) ArrayManagerExecutionThrustDevice(StorageType *storage)
: Storage(storage), Array() : Storage(storage), Array()
{ {
} }
VTKM_CONT_EXPORT VTKM_CONT
~ArrayManagerExecutionThrustDevice() ~ArrayManagerExecutionThrustDevice()
{ {
this->ReleaseResources(); this->ReleaseResources();
@ -91,7 +91,7 @@ public:
/// Returns the size of the array. /// Returns the size of the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return static_cast<vtkm::Id>(this->Array.size()); return static_cast<vtkm::Id>(this->Array.size());
} }
@ -99,7 +99,7 @@ public:
/// Allocates the appropriate size of the array and copies the given data /// Allocates the appropriate size of the array and copies the given data
/// into the array. /// into the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType PrepareForInput(bool updateData) PortalConstType PrepareForInput(bool updateData)
{ {
if (updateData) if (updateData)
@ -118,7 +118,7 @@ public:
/// Workaround for nvcc 7.5 compiler warning bug. /// Workaround for nvcc 7.5 compiler warning bug.
template<typename DummyType> template<typename DummyType>
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType _PrepareForInput(bool updateData) PortalConstType _PrepareForInput(bool updateData)
{ {
return this->PrepareForInput(updateData); return this->PrepareForInput(updateData);
@ -127,7 +127,7 @@ public:
/// Allocates the appropriate size of the array and copies the given data /// Allocates the appropriate size of the array and copies the given data
/// into the array. /// into the array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForInPlace(bool updateData) PortalType PrepareForInPlace(bool updateData)
{ {
if (updateData) if (updateData)
@ -145,7 +145,7 @@ public:
/// Workaround for nvcc 7.5 compiler warning bug. /// Workaround for nvcc 7.5 compiler warning bug.
template<typename DummyType> template<typename DummyType>
VTKM_CONT_EXPORT VTKM_CONT
PortalType _PrepareForInPlace(bool updateData) PortalType _PrepareForInPlace(bool updateData)
{ {
return this->PrepareForInPlace(updateData); return this->PrepareForInPlace(updateData);
@ -153,7 +153,7 @@ public:
/// Allocates the array to the given size. /// Allocates the array to the given size.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForOutput(vtkm::Id numberOfValues) PortalType PrepareForOutput(vtkm::Id numberOfValues)
{ {
if (numberOfValues > this->GetNumberOfValues()) if (numberOfValues > this->GetNumberOfValues())
@ -178,7 +178,7 @@ public:
/// Workaround for nvcc 7.5 compiler warning bug. /// Workaround for nvcc 7.5 compiler warning bug.
template<typename DummyType> template<typename DummyType>
VTKM_CONT_EXPORT VTKM_CONT
PortalType _PrepareForOutput(vtkm::Id numberOfValues) PortalType _PrepareForOutput(vtkm::Id numberOfValues)
{ {
return this->PrepareForOutput(numberOfValues); return this->PrepareForOutput(numberOfValues);
@ -187,7 +187,7 @@ public:
/// Allocates enough space in \c storage and copies the data in the /// Allocates enough space in \c storage and copies the data in the
/// device vector into it. /// device vector into it.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *storage) const void RetrieveOutputData(StorageType *storage) const
{ {
storage->Allocate(static_cast<vtkm::Id>(this->Array.size())); storage->Allocate(static_cast<vtkm::Id>(this->Array.size()));
@ -209,7 +209,7 @@ public:
/// thrust can generally handle iterators for a device as well. /// thrust can generally handle iterators for a device as well.
/// ///
template <class IteratorTypeControl> template <class IteratorTypeControl>
VTKM_CONT_EXPORT void CopyInto(IteratorTypeControl dest) const VTKM_CONT void CopyInto(IteratorTypeControl dest) const
{ {
::thrust::copy( ::thrust::copy(
this->Array.data(), this->Array.data(),
@ -219,7 +219,7 @@ public:
/// Resizes the device vector. /// Resizes the device vector.
/// ///
VTKM_CONT_EXPORT void Shrink(vtkm::Id numberOfValues) VTKM_CONT void Shrink(vtkm::Id numberOfValues)
{ {
// The operation will succeed even if this assertion fails, but this // The operation will succeed even if this assertion fails, but this
// is still supposed to be a precondition to Shrink. // is still supposed to be a precondition to Shrink.
@ -231,7 +231,7 @@ public:
/// Frees all memory. /// Frees all memory.
/// ///
VTKM_CONT_EXPORT void ReleaseResources() VTKM_CONT void ReleaseResources()
{ {
this->Array.clear(); this->Array.clear();
this->Array.shrink_to_fit(); this->Array.shrink_to_fit();
@ -249,7 +249,7 @@ private:
::thrust::system::cuda::vector<ValueType, ::thrust::system::cuda::vector<ValueType,
UninitializedAllocator<ValueType> > Array; UninitializedAllocator<ValueType> > Array;
VTKM_CONT_EXPORT VTKM_CONT
void CopyToExecution() void CopyToExecution()
{ {
try try

@ -60,7 +60,7 @@ struct DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagCuda>
vtkm::cont::DeviceAdapterTagCuda> vtkm::cont::DeviceAdapterTagCuda>
{ {
VTKM_CONT_EXPORT static void Synchronize() VTKM_CONT static void Synchronize()
{ {
VTKM_CUDA_CALL(cudaDeviceSynchronize()); VTKM_CUDA_CALL(cudaDeviceSynchronize());
} }
@ -73,25 +73,25 @@ template<>
class DeviceAdapterTimerImplementation<vtkm::cont::DeviceAdapterTagCuda> class DeviceAdapterTimerImplementation<vtkm::cont::DeviceAdapterTagCuda>
{ {
public: public:
VTKM_CONT_EXPORT DeviceAdapterTimerImplementation() VTKM_CONT DeviceAdapterTimerImplementation()
{ {
VTKM_CUDA_CALL(cudaEventCreate(&this->StartEvent)); VTKM_CUDA_CALL(cudaEventCreate(&this->StartEvent));
VTKM_CUDA_CALL(cudaEventCreate(&this->EndEvent)); VTKM_CUDA_CALL(cudaEventCreate(&this->EndEvent));
this->Reset(); this->Reset();
} }
VTKM_CONT_EXPORT ~DeviceAdapterTimerImplementation() VTKM_CONT ~DeviceAdapterTimerImplementation()
{ {
VTKM_CUDA_CALL(cudaEventDestroy(this->StartEvent)); VTKM_CUDA_CALL(cudaEventDestroy(this->StartEvent));
VTKM_CUDA_CALL(cudaEventDestroy(this->EndEvent)); VTKM_CUDA_CALL(cudaEventDestroy(this->EndEvent));
} }
VTKM_CONT_EXPORT void Reset() VTKM_CONT void Reset()
{ {
VTKM_CUDA_CALL(cudaEventRecord(this->StartEvent, 0)); VTKM_CUDA_CALL(cudaEventRecord(this->StartEvent, 0));
VTKM_CUDA_CALL(cudaEventSynchronize(this->StartEvent)); VTKM_CUDA_CALL(cudaEventSynchronize(this->StartEvent));
} }
VTKM_CONT_EXPORT vtkm::Float64 GetElapsedTime() VTKM_CONT vtkm::Float64 GetElapsedTime()
{ {
VTKM_CUDA_CALL(cudaEventRecord(this->EndEvent, 0)); VTKM_CUDA_CALL(cudaEventRecord(this->EndEvent, 0));
VTKM_CUDA_CALL(cudaEventSynchronize(this->EndEvent)); VTKM_CUDA_CALL(cudaEventSynchronize(this->EndEvent));
@ -124,7 +124,7 @@ template<>
class DeviceAdapterRuntimeDetector<vtkm::cont::DeviceAdapterTagCuda> class DeviceAdapterRuntimeDetector<vtkm::cont::DeviceAdapterTagCuda>
{ {
public: public:
VTKM_CONT_EXPORT DeviceAdapterRuntimeDetector(): VTKM_CONT DeviceAdapterRuntimeDetector():
NumberOfDevices(0), NumberOfDevices(0),
HighestArchSupported(0) HighestArchSupported(0)
{ {
@ -174,7 +174,7 @@ public:
/// Only returns true if we have at-least one CUDA capable device of SM_20 or /// Only returns true if we have at-least one CUDA capable device of SM_20 or
/// greater ( fermi ). /// greater ( fermi ).
/// ///
VTKM_CONT_EXPORT bool Exists() const VTKM_CONT bool Exists() const
{ {
// //
return this->NumberOfDevices > 0 && this->HighestArchSupported >= 20; return this->NumberOfDevices > 0 && this->HighestArchSupported >= 20;
@ -191,7 +191,7 @@ template<typename T>
class DeviceAdapterAtomicArrayImplementation<T,vtkm::cont::DeviceAdapterTagCuda> class DeviceAdapterAtomicArrayImplementation<T,vtkm::cont::DeviceAdapterTagCuda>
{ {
public: public:
VTKM_CONT_EXPORT VTKM_CONT
DeviceAdapterAtomicArrayImplementation( DeviceAdapterAtomicArrayImplementation(
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> handle): vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> handle):
Portal( handle.PrepareForInPlace( vtkm::cont::DeviceAdapterTagCuda()) ) Portal( handle.PrepareForInPlace( vtkm::cont::DeviceAdapterTagCuda()) )

@ -287,7 +287,7 @@ struct DeviceAdapterAlgorithmThrust : vtkm::cont::internal::DeviceAdapterAlgorit
private: private:
#endif #endif
template<class InputPortal, class OutputPortal> template<class InputPortal, class OutputPortal>
VTKM_CONT_EXPORT static void CopyPortal(const InputPortal &input, VTKM_CONT static void CopyPortal(const InputPortal &input,
const OutputPortal &output) const OutputPortal &output)
{ {
try try
@ -304,7 +304,7 @@ private:
} }
template<class InputPortal, class OutputPortal> template<class InputPortal, class OutputPortal>
VTKM_CONT_EXPORT static void CopySubRangePortal(const InputPortal &input, VTKM_CONT static void CopySubRangePortal(const InputPortal &input,
vtkm::Id inputOffset, vtkm::Id inputOffset,
vtkm::Id size, vtkm::Id size,
const OutputPortal &output, const OutputPortal &output,
@ -324,7 +324,7 @@ private:
} }
template<class InputPortal, class ValuesPortal, class OutputPortal> template<class InputPortal, class ValuesPortal, class OutputPortal>
VTKM_CONT_EXPORT static void LowerBoundsPortal(const InputPortal &input, VTKM_CONT static void LowerBoundsPortal(const InputPortal &input,
const ValuesPortal &values, const ValuesPortal &values,
const OutputPortal &output) const OutputPortal &output)
{ {
@ -333,7 +333,7 @@ private:
} }
template<class InputPortal, class OutputPortal> template<class InputPortal, class OutputPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
void LowerBoundsPortal(const InputPortal &input, void LowerBoundsPortal(const InputPortal &input,
const OutputPortal &values_output) const OutputPortal &values_output)
{ {
@ -344,7 +344,7 @@ private:
template<class InputPortal, class ValuesPortal, class OutputPortal, template<class InputPortal, class ValuesPortal, class OutputPortal,
class BinaryCompare> class BinaryCompare>
VTKM_CONT_EXPORT static void LowerBoundsPortal(const InputPortal &input, VTKM_CONT static void LowerBoundsPortal(const InputPortal &input,
const ValuesPortal &values, const ValuesPortal &values,
const OutputPortal &output, const OutputPortal &output,
BinaryCompare binary_compare) BinaryCompare binary_compare)
@ -370,7 +370,7 @@ private:
} }
template<class InputPortal> template<class InputPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
typename InputPortal::ValueType ReducePortal(const InputPortal &input, typename InputPortal::ValueType ReducePortal(const InputPortal &input,
typename InputPortal::ValueType initialValue) typename InputPortal::ValueType initialValue)
{ {
@ -381,7 +381,7 @@ private:
} }
template<class InputPortal, class BinaryFunctor> template<class InputPortal, class BinaryFunctor>
VTKM_CONT_EXPORT static VTKM_CONT static
typename InputPortal::ValueType ReducePortal(const InputPortal &input, typename InputPortal::ValueType ReducePortal(const InputPortal &input,
typename InputPortal::ValueType initialValue, typename InputPortal::ValueType initialValue,
BinaryFunctor binary_functor) BinaryFunctor binary_functor)
@ -409,7 +409,7 @@ private:
template<class KeysPortal, class ValuesPortal, template<class KeysPortal, class ValuesPortal,
class KeysOutputPortal, class ValueOutputPortal, class KeysOutputPortal, class ValueOutputPortal,
class BinaryFunctor> class BinaryFunctor>
VTKM_CONT_EXPORT static VTKM_CONT static
vtkm::Id ReduceByKeyPortal(const KeysPortal &keys, vtkm::Id ReduceByKeyPortal(const KeysPortal &keys,
const ValuesPortal& values, const ValuesPortal& values,
const KeysOutputPortal &keys_output, const KeysOutputPortal &keys_output,
@ -454,7 +454,7 @@ private:
} }
template<class InputPortal, class OutputPortal> template<class InputPortal, class OutputPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
typename InputPortal::ValueType ScanExclusivePortal(const InputPortal &input, typename InputPortal::ValueType ScanExclusivePortal(const InputPortal &input,
const OutputPortal &output) const OutputPortal &output)
{ {
@ -468,7 +468,7 @@ private:
} }
template<class InputPortal, class OutputPortal, class BinaryFunctor> template<class InputPortal, class OutputPortal, class BinaryFunctor>
VTKM_CONT_EXPORT static VTKM_CONT static
typename InputPortal::ValueType ScanExclusivePortal(const InputPortal &input, typename InputPortal::ValueType ScanExclusivePortal(const InputPortal &input,
const OutputPortal &output, const OutputPortal &output,
BinaryFunctor binaryOp, BinaryFunctor binaryOp,
@ -520,7 +520,7 @@ private:
} }
template<class InputPortal, class OutputPortal> template<class InputPortal, class OutputPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
typename InputPortal::ValueType ScanInclusivePortal(const InputPortal &input, typename InputPortal::ValueType ScanInclusivePortal(const InputPortal &input,
const OutputPortal &output) const OutputPortal &output)
{ {
@ -529,7 +529,7 @@ private:
} }
template<class InputPortal, class OutputPortal, class BinaryFunctor> template<class InputPortal, class OutputPortal, class BinaryFunctor>
VTKM_CONT_EXPORT static VTKM_CONT static
typename InputPortal::ValueType ScanInclusivePortal(const InputPortal &input, typename InputPortal::ValueType ScanInclusivePortal(const InputPortal &input,
const OutputPortal &output, const OutputPortal &output,
BinaryFunctor binary_functor) BinaryFunctor binary_functor)
@ -561,14 +561,14 @@ private:
} }
template<class ValuesPortal> template<class ValuesPortal>
VTKM_CONT_EXPORT static void SortPortal(const ValuesPortal &values) VTKM_CONT static void SortPortal(const ValuesPortal &values)
{ {
typedef typename ValuesPortal::ValueType ValueType; typedef typename ValuesPortal::ValueType ValueType;
SortPortal(values, ::thrust::less<ValueType>()); SortPortal(values, ::thrust::less<ValueType>());
} }
template<class ValuesPortal, class BinaryCompare> template<class ValuesPortal, class BinaryCompare>
VTKM_CONT_EXPORT static void SortPortal(const ValuesPortal &values, VTKM_CONT static void SortPortal(const ValuesPortal &values,
BinaryCompare binary_compare) BinaryCompare binary_compare)
{ {
typedef typename ValuesPortal::ValueType ValueType; typedef typename ValuesPortal::ValueType ValueType;
@ -589,7 +589,7 @@ private:
template<class KeysPortal, class ValuesPortal> template<class KeysPortal, class ValuesPortal>
VTKM_CONT_EXPORT static void SortByKeyPortal(const KeysPortal &keys, VTKM_CONT static void SortByKeyPortal(const KeysPortal &keys,
const ValuesPortal &values) const ValuesPortal &values)
{ {
typedef typename KeysPortal::ValueType ValueType; typedef typename KeysPortal::ValueType ValueType;
@ -597,7 +597,7 @@ private:
} }
template<class KeysPortal, class ValuesPortal, class BinaryCompare> template<class KeysPortal, class ValuesPortal, class BinaryCompare>
VTKM_CONT_EXPORT static void SortByKeyPortal(const KeysPortal &keys, VTKM_CONT static void SortByKeyPortal(const KeysPortal &keys,
const ValuesPortal &values, const ValuesPortal &values,
BinaryCompare binary_compare) BinaryCompare binary_compare)
{ {
@ -622,7 +622,7 @@ private:
class StencilPortal, class StencilPortal,
class OutputPortal, class OutputPortal,
class UnaryPredicate> class UnaryPredicate>
VTKM_CONT_EXPORT static VTKM_CONT static
vtkm::Id CopyIfPortal(ValueIterator valuesBegin, vtkm::Id CopyIfPortal(ValueIterator valuesBegin,
ValueIterator valuesEnd, ValueIterator valuesEnd,
StencilPortal stencil, StencilPortal stencil,
@ -662,7 +662,7 @@ private:
class StencilPortal, class StencilPortal,
class OutputPortal, class OutputPortal,
class UnaryPredicate> class UnaryPredicate>
VTKM_CONT_EXPORT static VTKM_CONT static
vtkm::Id CopyIfPortal(ValuePortal values, vtkm::Id CopyIfPortal(ValuePortal values,
StencilPortal stencil, StencilPortal stencil,
OutputPortal output, OutputPortal output,
@ -676,7 +676,7 @@ private:
} }
template<class ValuesPortal> template<class ValuesPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
vtkm::Id UniquePortal(const ValuesPortal values) vtkm::Id UniquePortal(const ValuesPortal values)
{ {
typedef typename detail::IteratorTraits<ValuesPortal>::IteratorType typedef typename detail::IteratorTraits<ValuesPortal>::IteratorType
@ -697,7 +697,7 @@ private:
} }
template<class ValuesPortal, class BinaryCompare> template<class ValuesPortal, class BinaryCompare>
VTKM_CONT_EXPORT static VTKM_CONT static
vtkm::Id UniquePortal(const ValuesPortal values, BinaryCompare binary_compare) vtkm::Id UniquePortal(const ValuesPortal values, BinaryCompare binary_compare)
{ {
typedef typename detail::IteratorTraits<ValuesPortal>::IteratorType typedef typename detail::IteratorTraits<ValuesPortal>::IteratorType
@ -723,7 +723,7 @@ private:
} }
template<class InputPortal, class ValuesPortal, class OutputPortal> template<class InputPortal, class ValuesPortal, class OutputPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
void UpperBoundsPortal(const InputPortal &input, void UpperBoundsPortal(const InputPortal &input,
const ValuesPortal &values, const ValuesPortal &values,
const OutputPortal &output) const OutputPortal &output)
@ -745,7 +745,7 @@ private:
template<class InputPortal, class ValuesPortal, class OutputPortal, template<class InputPortal, class ValuesPortal, class OutputPortal,
class BinaryCompare> class BinaryCompare>
VTKM_CONT_EXPORT static void UpperBoundsPortal(const InputPortal &input, VTKM_CONT static void UpperBoundsPortal(const InputPortal &input,
const ValuesPortal &values, const ValuesPortal &values,
const OutputPortal &output, const OutputPortal &output,
BinaryCompare binary_compare) BinaryCompare binary_compare)
@ -771,7 +771,7 @@ private:
} }
template<class InputPortal, class OutputPortal> template<class InputPortal, class OutputPortal>
VTKM_CONT_EXPORT static VTKM_CONT static
void UpperBoundsPortal(const InputPortal &input, void UpperBoundsPortal(const InputPortal &input,
const OutputPortal &values_output) const OutputPortal &values_output)
{ {
@ -794,7 +794,7 @@ private:
public: public:
template<typename T, typename U, class SIn, class SOut> template<typename T, typename U, class SIn, class SOut>
VTKM_CONT_EXPORT static void Copy( VTKM_CONT static void Copy(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::cont::ArrayHandle<U,SOut> &output) vtkm::cont::ArrayHandle<U,SOut> &output)
{ {
@ -804,7 +804,7 @@ public:
} }
template<typename T, typename U, class SIn, class SOut> template<typename T, typename U, class SIn, class SOut>
VTKM_CONT_EXPORT static bool CopySubRange( VTKM_CONT static bool CopySubRange(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::Id inputStartIndex, vtkm::Id inputStartIndex,
vtkm::Id numberOfElementsToCopy, vtkm::Id numberOfElementsToCopy,
@ -852,7 +852,7 @@ public:
} }
template<typename T, class SIn, class SVal, class SOut> template<typename T, class SIn, class SVal, class SOut>
VTKM_CONT_EXPORT static void LowerBounds( VTKM_CONT static void LowerBounds(
const vtkm::cont::ArrayHandle<T,SIn>& input, const vtkm::cont::ArrayHandle<T,SIn>& input,
const vtkm::cont::ArrayHandle<T,SVal>& values, const vtkm::cont::ArrayHandle<T,SVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output) vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output)
@ -864,7 +864,7 @@ public:
} }
template<typename T, class SIn, class SVal, class SOut, class BinaryCompare> template<typename T, class SIn, class SVal, class SOut, class BinaryCompare>
VTKM_CONT_EXPORT static void LowerBounds( VTKM_CONT static void LowerBounds(
const vtkm::cont::ArrayHandle<T,SIn>& input, const vtkm::cont::ArrayHandle<T,SIn>& input,
const vtkm::cont::ArrayHandle<T,SVal>& values, const vtkm::cont::ArrayHandle<T,SVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output, vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output,
@ -878,7 +878,7 @@ public:
} }
template<class SIn, class SOut> template<class SIn, class SOut>
VTKM_CONT_EXPORT static void LowerBounds( VTKM_CONT static void LowerBounds(
const vtkm::cont::ArrayHandle<vtkm::Id,SIn> &input, const vtkm::cont::ArrayHandle<vtkm::Id,SIn> &input,
vtkm::cont::ArrayHandle<vtkm::Id,SOut> &values_output) vtkm::cont::ArrayHandle<vtkm::Id,SOut> &values_output)
{ {
@ -887,7 +887,7 @@ public:
} }
template<typename T, class SIn> template<typename T, class SIn>
VTKM_CONT_EXPORT static T Reduce( VTKM_CONT static T Reduce(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
T initialValue) T initialValue)
{ {
@ -901,7 +901,7 @@ public:
} }
template<typename T, class SIn, class BinaryFunctor> template<typename T, class SIn, class BinaryFunctor>
VTKM_CONT_EXPORT static T Reduce( VTKM_CONT static T Reduce(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
T initialValue, T initialValue,
BinaryFunctor binary_functor) BinaryFunctor binary_functor)
@ -918,7 +918,7 @@ public:
template<typename T, typename U, class KIn, class VIn, class KOut, class VOut, template<typename T, typename U, class KIn, class VIn, class KOut, class VOut,
class BinaryFunctor> class BinaryFunctor>
VTKM_CONT_EXPORT static void ReduceByKey( VTKM_CONT static void ReduceByKey(
const vtkm::cont::ArrayHandle<T,KIn> &keys, const vtkm::cont::ArrayHandle<T,KIn> &keys,
const vtkm::cont::ArrayHandle<U,VIn> &values, const vtkm::cont::ArrayHandle<U,VIn> &values,
vtkm::cont::ArrayHandle<T,KOut> &keys_output, vtkm::cont::ArrayHandle<T,KOut> &keys_output,
@ -944,7 +944,7 @@ public:
} }
template<typename T, class SIn, class SOut> template<typename T, class SIn, class SOut>
VTKM_CONT_EXPORT static T ScanExclusive( VTKM_CONT static T ScanExclusive(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::cont::ArrayHandle<T,SOut>& output) vtkm::cont::ArrayHandle<T,SOut>& output)
{ {
@ -965,7 +965,7 @@ public:
} }
template<typename T, class SIn, class SOut, class BinaryFunctor> template<typename T, class SIn, class SOut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanExclusive( VTKM_CONT static T ScanExclusive(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::cont::ArrayHandle<T,SOut>& output, vtkm::cont::ArrayHandle<T,SOut>& output,
BinaryFunctor binary_functor, BinaryFunctor binary_functor,
@ -991,7 +991,7 @@ public:
} }
template<typename T, class SIn, class SOut> template<typename T, class SIn, class SOut>
VTKM_CONT_EXPORT static T ScanInclusive( VTKM_CONT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::cont::ArrayHandle<T,SOut>& output) vtkm::cont::ArrayHandle<T,SOut>& output)
{ {
@ -1012,7 +1012,7 @@ public:
} }
template<typename T, class SIn, class SOut, class BinaryFunctor> template<typename T, class SIn, class SOut, class BinaryFunctor>
VTKM_CONT_EXPORT static T ScanInclusive( VTKM_CONT static T ScanInclusive(
const vtkm::cont::ArrayHandle<T,SIn> &input, const vtkm::cont::ArrayHandle<T,SIn> &input,
vtkm::cont::ArrayHandle<T,SOut>& output, vtkm::cont::ArrayHandle<T,SOut>& output,
BinaryFunctor binary_functor) BinaryFunctor binary_functor)
@ -1041,7 +1041,7 @@ private:
#endif #endif
// we use cuda pinned memory to reduce the amount of synchronization // we use cuda pinned memory to reduce the amount of synchronization
// and mem copies between the host and device. // and mem copies between the host and device.
VTKM_CONT_EXPORT VTKM_CONT
static char* GetPinnedErrorArray(vtkm::Id &arraySize, char** hostPointer) static char* GetPinnedErrorArray(vtkm::Id &arraySize, char** hostPointer)
{ {
const vtkm::Id ERROR_ARRAY_SIZE = 1024; const vtkm::Id ERROR_ARRAY_SIZE = 1024;
@ -1065,7 +1065,7 @@ private:
// we query cuda for the max blocks per grid for 1D scheduling // we query cuda for the max blocks per grid for 1D scheduling
// and cache the values in static variables // and cache the values in static variables
VTKM_CONT_EXPORT VTKM_CONT
static vtkm::Vec<vtkm::UInt32,3> GetMaxGridOfThreadBlocks() static vtkm::Vec<vtkm::UInt32,3> GetMaxGridOfThreadBlocks()
{ {
static bool gridQueryInit = false; static bool gridQueryInit = false;
@ -1104,7 +1104,7 @@ private:
public: public:
template<class Functor> template<class Functor>
VTKM_CONT_EXPORT static void Schedule(Functor functor, vtkm::Id numInstances) VTKM_CONT static void Schedule(Functor functor, vtkm::Id numInstances)
{ {
//since the memory is pinned we can access it safely on the host //since the memory is pinned we can access it safely on the host
//without a memcpy //without a memcpy
@ -1162,7 +1162,7 @@ public:
} }
template<class Functor> template<class Functor>
VTKM_CONT_EXPORT VTKM_CONT
static void Schedule(Functor functor, const vtkm::Id3& rangeMax) static void Schedule(Functor functor, const vtkm::Id3& rangeMax)
{ {
//since the memory is pinned we can access it safely on the host //since the memory is pinned we can access it safely on the host
@ -1221,14 +1221,14 @@ public:
} }
template<typename T, class Storage> template<typename T, class Storage>
VTKM_CONT_EXPORT static void Sort( VTKM_CONT static void Sort(
vtkm::cont::ArrayHandle<T,Storage>& values) vtkm::cont::ArrayHandle<T,Storage>& values)
{ {
SortPortal(values.PrepareForInPlace(DeviceAdapterTag())); SortPortal(values.PrepareForInPlace(DeviceAdapterTag()));
} }
template<typename T, class Storage, class BinaryCompare> template<typename T, class Storage, class BinaryCompare>
VTKM_CONT_EXPORT static void Sort( VTKM_CONT static void Sort(
vtkm::cont::ArrayHandle<T,Storage>& values, vtkm::cont::ArrayHandle<T,Storage>& values,
BinaryCompare binary_compare) BinaryCompare binary_compare)
{ {
@ -1237,7 +1237,7 @@ public:
template<typename T, typename U, template<typename T, typename U,
class StorageT, class StorageU> class StorageT, class StorageU>
VTKM_CONT_EXPORT static void SortByKey( VTKM_CONT static void SortByKey(
vtkm::cont::ArrayHandle<T,StorageT>& keys, vtkm::cont::ArrayHandle<T,StorageT>& keys,
vtkm::cont::ArrayHandle<U,StorageU>& values) vtkm::cont::ArrayHandle<U,StorageU>& values)
{ {
@ -1248,7 +1248,7 @@ public:
template<typename T, typename U, template<typename T, typename U,
class StorageT, class StorageU, class StorageT, class StorageU,
class BinaryCompare> class BinaryCompare>
VTKM_CONT_EXPORT static void SortByKey( VTKM_CONT static void SortByKey(
vtkm::cont::ArrayHandle<T,StorageT>& keys, vtkm::cont::ArrayHandle<T,StorageT>& keys,
vtkm::cont::ArrayHandle<U,StorageU>& values, vtkm::cont::ArrayHandle<U,StorageU>& values,
BinaryCompare binary_compare) BinaryCompare binary_compare)
@ -1260,7 +1260,7 @@ public:
template<typename T, class SStencil, class SOut> template<typename T, class SStencil, class SOut>
VTKM_CONT_EXPORT static void StreamCompact( VTKM_CONT static void StreamCompact(
const vtkm::cont::ArrayHandle<T,SStencil>& stencil, const vtkm::cont::ArrayHandle<T,SStencil>& stencil,
vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output) vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output)
{ {
@ -1278,7 +1278,7 @@ public:
class SIn, class SIn,
class SStencil, class SStencil,
class SOut> class SOut>
VTKM_CONT_EXPORT static void StreamCompact( VTKM_CONT static void StreamCompact(
const vtkm::cont::ArrayHandle<U,SIn>& input, const vtkm::cont::ArrayHandle<U,SIn>& input,
const vtkm::cont::ArrayHandle<T,SStencil>& stencil, const vtkm::cont::ArrayHandle<T,SStencil>& stencil,
vtkm::cont::ArrayHandle<U,SOut>& output) vtkm::cont::ArrayHandle<U,SOut>& output)
@ -1297,7 +1297,7 @@ public:
class SStencil, class SStencil,
class SOut, class SOut,
class UnaryPredicate> class UnaryPredicate>
VTKM_CONT_EXPORT static void StreamCompact( VTKM_CONT static void StreamCompact(
const vtkm::cont::ArrayHandle<U,SIn>& input, const vtkm::cont::ArrayHandle<U,SIn>& input,
const vtkm::cont::ArrayHandle<T,SStencil>& stencil, const vtkm::cont::ArrayHandle<T,SStencil>& stencil,
vtkm::cont::ArrayHandle<U,SOut>& output, vtkm::cont::ArrayHandle<U,SOut>& output,
@ -1312,7 +1312,7 @@ public:
} }
template<typename T, class Storage> template<typename T, class Storage>
VTKM_CONT_EXPORT static void Unique( VTKM_CONT static void Unique(
vtkm::cont::ArrayHandle<T,Storage> &values) vtkm::cont::ArrayHandle<T,Storage> &values)
{ {
vtkm::Id newSize = UniquePortal(values.PrepareForInPlace(DeviceAdapterTag())); vtkm::Id newSize = UniquePortal(values.PrepareForInPlace(DeviceAdapterTag()));
@ -1321,7 +1321,7 @@ public:
} }
template<typename T, class Storage, class BinaryCompare> template<typename T, class Storage, class BinaryCompare>
VTKM_CONT_EXPORT static void Unique( VTKM_CONT static void Unique(
vtkm::cont::ArrayHandle<T,Storage> &values, vtkm::cont::ArrayHandle<T,Storage> &values,
BinaryCompare binary_compare) BinaryCompare binary_compare)
{ {
@ -1331,7 +1331,7 @@ public:
} }
template<typename T, class SIn, class SVal, class SOut> template<typename T, class SIn, class SVal, class SOut>
VTKM_CONT_EXPORT static void UpperBounds( VTKM_CONT static void UpperBounds(
const vtkm::cont::ArrayHandle<T,SIn>& input, const vtkm::cont::ArrayHandle<T,SIn>& input,
const vtkm::cont::ArrayHandle<T,SVal>& values, const vtkm::cont::ArrayHandle<T,SVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output) vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output)
@ -1343,7 +1343,7 @@ public:
} }
template<typename T, class SIn, class SVal, class SOut, class BinaryCompare> template<typename T, class SIn, class SVal, class SOut, class BinaryCompare>
VTKM_CONT_EXPORT static void UpperBounds( VTKM_CONT static void UpperBounds(
const vtkm::cont::ArrayHandle<T,SIn>& input, const vtkm::cont::ArrayHandle<T,SIn>& input,
const vtkm::cont::ArrayHandle<T,SVal>& values, const vtkm::cont::ArrayHandle<T,SVal>& values,
vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output, vtkm::cont::ArrayHandle<vtkm::Id,SOut>& output,
@ -1357,7 +1357,7 @@ public:
} }
template<class SIn, class SOut> template<class SIn, class SOut>
VTKM_CONT_EXPORT static void UpperBounds( VTKM_CONT static void UpperBounds(
const vtkm::cont::ArrayHandle<vtkm::Id,SIn> &input, const vtkm::cont::ArrayHandle<vtkm::Id,SIn> &input,
vtkm::cont::ArrayHandle<vtkm::Id,SOut> &values_output) vtkm::cont::ArrayHandle<vtkm::Id,SOut> &values_output)
{ {

@ -86,7 +86,7 @@ struct IteratorTraits
}; };
template<typename PortalType> template<typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
typename IteratorTraits<PortalType>::IteratorType typename IteratorTraits<PortalType>::IteratorType
MakeIteratorBegin(PortalType portal, detail::ThrustIteratorFromArrayPortalTag) MakeIteratorBegin(PortalType portal, detail::ThrustIteratorFromArrayPortalTag)
{ {
@ -94,7 +94,7 @@ MakeIteratorBegin(PortalType portal, detail::ThrustIteratorFromArrayPortalTag)
} }
template<typename PortalType> template<typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
typename IteratorTraits<PortalType>::IteratorType typename IteratorTraits<PortalType>::IteratorType
MakeIteratorBegin(PortalType portal, detail::ThrustIteratorDevicePtrTag) MakeIteratorBegin(PortalType portal, detail::ThrustIteratorDevicePtrTag)
{ {
@ -103,7 +103,7 @@ MakeIteratorBegin(PortalType portal, detail::ThrustIteratorDevicePtrTag)
} }
template<typename PortalType> template<typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
typename IteratorTraits<PortalType>::IteratorType typename IteratorTraits<PortalType>::IteratorType
MakeIteratorEnd(PortalType portal, detail::ThrustIteratorFromArrayPortalTag) MakeIteratorEnd(PortalType portal, detail::ThrustIteratorFromArrayPortalTag)
{ {
@ -115,7 +115,7 @@ MakeIteratorEnd(PortalType portal, detail::ThrustIteratorFromArrayPortalTag)
} }
template<typename PortalType> template<typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
typename IteratorTraits<PortalType>::IteratorType typename IteratorTraits<PortalType>::IteratorType
MakeIteratorEnd(PortalType portal, detail::ThrustIteratorDevicePtrTag) MakeIteratorEnd(PortalType portal, detail::ThrustIteratorDevicePtrTag)
{ {
@ -128,7 +128,7 @@ MakeIteratorEnd(PortalType portal, detail::ThrustIteratorDevicePtrTag)
template<typename PortalType> template<typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
typename detail::IteratorTraits<PortalType>::IteratorType typename detail::IteratorTraits<PortalType>::IteratorType
IteratorBegin(PortalType portal) IteratorBegin(PortalType portal)
{ {
@ -137,7 +137,7 @@ IteratorBegin(PortalType portal)
} }
template<typename PortalType> template<typename PortalType>
VTKM_CONT_EXPORT VTKM_CONT
typename detail::IteratorTraits<PortalType>::IteratorType typename detail::IteratorTraits<PortalType>::IteratorType
IteratorEnd(PortalType portal) IteratorEnd(PortalType portal)
{ {

@ -32,7 +32,7 @@ namespace internal {
struct Testing struct Testing
{ {
public: public:
static VTKM_CONT_EXPORT int CheckCudaBeforeExit(int result) static VTKM_CONT int CheckCudaBeforeExit(int result)
{ {
cudaError_t cudaError = cudaPeekAtLastError(); cudaError_t cudaError = cudaPeekAtLastError();
if (cudaError != cudaSuccess) if (cudaError != cudaSuccess)
@ -49,7 +49,7 @@ public:
} }
template<class Func> template<class Func>
static VTKM_CONT_EXPORT int Run(Func function) static VTKM_CONT int Run(Func function)
{ {
int result = vtkm::cont::testing::Testing::Run(function); int result = vtkm::cont::testing::Testing::Run(function);
return CheckCudaBeforeExit(result); return CheckCudaBeforeExit(result);

@ -59,13 +59,13 @@ public:
typedef typename StorageType::PortalType PortalControl; typedef typename StorageType::PortalType PortalControl;
typedef typename StorageType::PortalConstType PortalConstControl; typedef typename StorageType::PortalConstType PortalConstControl;
VTKM_CONT_EXPORT VTKM_CONT
virtual ~ArrayHandleExecutionManagerBase() { } virtual ~ArrayHandleExecutionManagerBase() { }
/// Returns the number of values stored in the array. Results are undefined /// Returns the number of values stored in the array. Results are undefined
/// if data has not been loaded or allocated. /// if data has not been loaded or allocated.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { vtkm::Id GetNumberOfValues() const {
return this->GetNumberOfValuesImpl(); return this->GetNumberOfValuesImpl();
} }
@ -77,7 +77,7 @@ public:
/// Returns a constant array portal valid in the execution environment. /// Returns a constant array portal valid in the execution environment.
/// ///
template<typename DeviceAdapter> template<typename DeviceAdapter>
VTKM_CONT_EXPORT VTKM_CONT
typename ExecutionTypes<DeviceAdapter>::PortalConst typename ExecutionTypes<DeviceAdapter>::PortalConst
PrepareForInput(bool updateData, DeviceAdapter) { PrepareForInput(bool updateData, DeviceAdapter) {
this->VerifyDeviceAdapter(DeviceAdapter()); this->VerifyDeviceAdapter(DeviceAdapter());
@ -94,7 +94,7 @@ public:
/// Returns a read-write array portal valid in the execution environment. /// Returns a read-write array portal valid in the execution environment.
/// ///
template<typename DeviceAdapter> template<typename DeviceAdapter>
VTKM_CONT_EXPORT VTKM_CONT
typename ExecutionTypes<DeviceAdapter>::Portal typename ExecutionTypes<DeviceAdapter>::Portal
PrepareForInPlace(bool updateData, DeviceAdapter) { PrepareForInPlace(bool updateData, DeviceAdapter) {
this->VerifyDeviceAdapter(DeviceAdapter()); this->VerifyDeviceAdapter(DeviceAdapter());
@ -112,7 +112,7 @@ public:
/// Returns a writable array portal valid in the execution environment. /// Returns a writable array portal valid in the execution environment.
/// ///
template<typename DeviceAdapter> template<typename DeviceAdapter>
VTKM_CONT_EXPORT VTKM_CONT
typename ExecutionTypes<DeviceAdapter>::Portal typename ExecutionTypes<DeviceAdapter>::Portal
PrepareForOutput(vtkm::Id numberOfValues, DeviceAdapter) { PrepareForOutput(vtkm::Id numberOfValues, DeviceAdapter) {
this->VerifyDeviceAdapter(DeviceAdapter()); this->VerifyDeviceAdapter(DeviceAdapter());
@ -129,7 +129,7 @@ public:
/// operation. This method should only be called after PrepareForOutput is /// operation. This method should only be called after PrepareForOutput is
/// called. /// called.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *storage) const { void RetrieveOutputData(StorageType *storage) const {
this->RetrieveOutputDataImpl(storage); this->RetrieveOutputDataImpl(storage);
} }
@ -143,7 +143,7 @@ public:
/// (returned from GetNumberOfValues). That is, this method can only be used /// (returned from GetNumberOfValues). That is, this method can only be used
/// to shorten the array, not lengthen. /// to shorten the array, not lengthen.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) { void Shrink(vtkm::Id numberOfValues) {
this->ShrinkImpl(numberOfValues); this->ShrinkImpl(numberOfValues);
} }
@ -151,13 +151,13 @@ public:
/// Frees any resources (i.e. memory) allocated for the exeuction /// Frees any resources (i.e. memory) allocated for the exeuction
/// environment, if any. /// environment, if any.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { void ReleaseResources() {
this->ReleaseResourcesImpl(); this->ReleaseResourcesImpl();
} }
template<typename DeviceAdapter> template<typename DeviceAdapter>
VTKM_CONT_EXPORT VTKM_CONT
bool IsDeviceAdapter(DeviceAdapter) const bool IsDeviceAdapter(DeviceAdapter) const
{ {
return this->IsDeviceAdapterImpl( return this->IsDeviceAdapterImpl(
@ -187,7 +187,7 @@ protected:
private: private:
template<typename DeviceAdapter> template<typename DeviceAdapter>
VTKM_CONT_EXPORT VTKM_CONT
void VerifyDeviceAdapter(DeviceAdapter device) const void VerifyDeviceAdapter(DeviceAdapter device) const
{ {
if (!this->IsDeviceAdapter(device)) if (!this->IsDeviceAdapter(device))
@ -222,63 +222,63 @@ public:
typedef typename ArrayTransferType::PortalExecution PortalExecution; typedef typename ArrayTransferType::PortalExecution PortalExecution;
typedef typename ArrayTransferType::PortalConstExecution PortalConstExecution; typedef typename ArrayTransferType::PortalConstExecution PortalConstExecution;
VTKM_CONT_EXPORT VTKM_CONT
ArrayHandleExecutionManager(StorageType *storage) ArrayHandleExecutionManager(StorageType *storage)
: Transfer(storage) { } : Transfer(storage) { }
template<class IteratorTypeControl> template<class IteratorTypeControl>
VTKM_CONT_EXPORT void CopyInto(IteratorTypeControl dest) const VTKM_CONT void CopyInto(IteratorTypeControl dest) const
{ {
this->Transfer.CopyInto(dest); this->Transfer.CopyInto(dest);
} }
protected: protected:
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValuesImpl() const vtkm::Id GetNumberOfValuesImpl() const
{ {
return this->Transfer.GetNumberOfValues(); return this->Transfer.GetNumberOfValues();
} }
VTKM_CONT_EXPORT VTKM_CONT
void PrepareForInputImpl(bool updateData, void *portalExecutionVoid) void PrepareForInputImpl(bool updateData, void *portalExecutionVoid)
{ {
PortalConstExecution portal = this->Transfer.PrepareForInput(updateData); PortalConstExecution portal = this->Transfer.PrepareForInput(updateData);
*reinterpret_cast<PortalConstExecution *>(portalExecutionVoid) = portal; *reinterpret_cast<PortalConstExecution *>(portalExecutionVoid) = portal;
} }
VTKM_CONT_EXPORT VTKM_CONT
void PrepareForInPlaceImpl(bool updateData, void *portalExecutionVoid) void PrepareForInPlaceImpl(bool updateData, void *portalExecutionVoid)
{ {
PortalExecution portal = this->Transfer.PrepareForInPlace(updateData); PortalExecution portal = this->Transfer.PrepareForInPlace(updateData);
*reinterpret_cast<PortalExecution *>(portalExecutionVoid) = portal; *reinterpret_cast<PortalExecution *>(portalExecutionVoid) = portal;
} }
VTKM_CONT_EXPORT VTKM_CONT
void PrepareForOutputImpl(vtkm::Id numberOfValues, void *portalExecutionVoid) void PrepareForOutputImpl(vtkm::Id numberOfValues, void *portalExecutionVoid)
{ {
PortalExecution portal = this->Transfer.PrepareForOutput(numberOfValues); PortalExecution portal = this->Transfer.PrepareForOutput(numberOfValues);
*reinterpret_cast<PortalExecution *>(portalExecutionVoid) = portal; *reinterpret_cast<PortalExecution *>(portalExecutionVoid) = portal;
} }
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputDataImpl(StorageType *storage) const void RetrieveOutputDataImpl(StorageType *storage) const
{ {
this->Transfer.RetrieveOutputData(storage); this->Transfer.RetrieveOutputData(storage);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ShrinkImpl(Id numberOfValues) void ShrinkImpl(Id numberOfValues)
{ {
this->Transfer.Shrink(numberOfValues); this->Transfer.Shrink(numberOfValues);
} }
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResourcesImpl() void ReleaseResourcesImpl()
{ {
this->Transfer.ReleaseResources(); this->Transfer.ReleaseResources();
} }
VTKM_CONT_EXPORT VTKM_CONT
bool IsDeviceAdapterImpl(const DeviceAdapterId &id) const bool IsDeviceAdapterImpl(const DeviceAdapterId &id) const
{ {
return id == vtkm::cont::DeviceAdapterTraits<DeviceAdapter>::GetId(); return id == vtkm::cont::DeviceAdapterTraits<DeviceAdapter>::GetId();

@ -76,13 +76,13 @@ public:
/// objects should be avoided (copy references or pointers only). The /// objects should be avoided (copy references or pointers only). The
/// reference can also, of course, be ignored. /// reference can also, of course, be ignored.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
ArrayManagerExecution(vtkm::cont::internal::Storage<T,StorageTag> &storage); ArrayManagerExecution(vtkm::cont::internal::Storage<T,StorageTag> &storage);
/// Returns the number of values stored in the array. Results are undefined /// Returns the number of values stored in the array. Results are undefined
/// if data has not been loaded or allocated. /// if data has not been loaded or allocated.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const; vtkm::Id GetNumberOfValues() const;
/// Prepares the data for use as input in the execution environment. If the /// Prepares the data for use as input in the execution environment. If the
@ -91,7 +91,7 @@ public:
/// ///
/// Returns a constant array portal valid in the execution environment. /// Returns a constant array portal valid in the execution environment.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalConstExecution PrepareForInput(bool updateData); PortalConstExecution PrepareForInput(bool updateData);
/// Prepares the data for use as both input and output in the execution /// Prepares the data for use as both input and output in the execution
@ -100,7 +100,7 @@ public:
/// ///
/// Returns a read-write array portal valid in the execution environment. /// Returns a read-write array portal valid in the execution environment.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution LoadDataForInPlace(bool updateData); PortalExecution LoadDataForInPlace(bool updateData);
/// Allocates an array in the execution environment of the specified size. If /// Allocates an array in the execution environment of the specified size. If
@ -110,7 +110,7 @@ public:
/// ///
/// Returns a writable array portal valid in the execution environment. /// Returns a writable array portal valid in the execution environment.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id numberOfValues); PortalExecution PrepareForOutput(vtkm::Id numberOfValues);
/// Allocates data in the given Storage and copies data held in the execution /// Allocates data in the given Storage and copies data held in the execution
@ -120,7 +120,7 @@ public:
/// operation. This method should only be called after PrepareForOutput is /// operation. This method should only be called after PrepareForOutput is
/// called. /// called.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData( void RetrieveOutputData(
vtkm::cont::internal::Storage<T,StorageTag>* storage) const; vtkm::cont::internal::Storage<T,StorageTag>* storage) const;
@ -131,7 +131,7 @@ public:
/// and exeuction have seperate memory spaces). /// and exeuction have seperate memory spaces).
/// ///
template <class IteratorTypeControl> template <class IteratorTypeControl>
VTKM_CONT_EXPORT void CopyInto(IteratorTypeControl dest) const; VTKM_CONT void CopyInto(IteratorTypeControl dest) const;
/// \brief Reduces the size of the array without changing its values. /// \brief Reduces the size of the array without changing its values.
/// ///
@ -142,13 +142,13 @@ public:
/// (returned from GetNumberOfValues). That is, this method can only be used /// (returned from GetNumberOfValues). That is, this method can only be used
/// to shorten the array, not lengthen. /// to shorten the array, not lengthen.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues); void Shrink(vtkm::Id numberOfValues);
/// Frees any resources (i.e. memory) allocated for the exeuction /// Frees any resources (i.e. memory) allocated for the exeuction
/// environment, if any. /// environment, if any.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources(); void ReleaseResources();
}; };
#else // VTKM_DOXGEN_ONLY #else // VTKM_DOXGEN_ONLY

@ -45,13 +45,13 @@ public:
typedef typename StorageType::PortalType PortalType; typedef typename StorageType::PortalType PortalType;
typedef typename StorageType::PortalConstType PortalConstType; typedef typename StorageType::PortalConstType PortalConstType;
VTKM_CONT_EXPORT VTKM_CONT
ArrayManagerExecutionShareWithControl(StorageType *storage) ArrayManagerExecutionShareWithControl(StorageType *storage)
: Storage(storage) { } : Storage(storage) { }
/// Returns the size of the storage. /// Returns the size of the storage.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->Storage->GetNumberOfValues(); return this->Storage->GetNumberOfValues();
@ -59,7 +59,7 @@ public:
/// Returns the constant portal from the storage. /// Returns the constant portal from the storage.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalConstType PrepareForInput(bool vtkmNotUsed(uploadData)) const PortalConstType PrepareForInput(bool vtkmNotUsed(uploadData)) const
{ {
return this->Storage->GetPortalConst(); return this->Storage->GetPortalConst();
@ -67,7 +67,7 @@ public:
/// Returns the read-write portal from the storage. /// Returns the read-write portal from the storage.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForInPlace(bool vtkmNotUsed(uploadData)) PortalType PrepareForInPlace(bool vtkmNotUsed(uploadData))
{ {
return this->Storage->GetPortal(); return this->Storage->GetPortal();
@ -75,7 +75,7 @@ public:
/// Allocates data in the storage and return the portal to that. /// Allocates data in the storage and return the portal to that.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
PortalType PrepareForOutput(vtkm::Id numberOfValues) PortalType PrepareForOutput(vtkm::Id numberOfValues)
{ {
this->Storage->Allocate(numberOfValues); this->Storage->Allocate(numberOfValues);
@ -86,7 +86,7 @@ public:
/// this class's portals should already be written to the given \c /// this class's portals should already be written to the given \c
/// controlArray (under correct operation). /// controlArray (under correct operation).
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void RetrieveOutputData(StorageType *storage) const void RetrieveOutputData(StorageType *storage) const
{ {
(void)storage; (void)storage;
@ -97,7 +97,7 @@ public:
/// iterator. /// iterator.
/// ///
template <class IteratorTypeControl> template <class IteratorTypeControl>
VTKM_CONT_EXPORT void CopyInto(IteratorTypeControl dest) const VTKM_CONT void CopyInto(IteratorTypeControl dest) const
{ {
typedef typename StorageType::PortalConstType::IteratorType IteratorType; typedef typename StorageType::PortalConstType::IteratorType IteratorType;
IteratorType beginIterator = IteratorType beginIterator =
@ -109,7 +109,7 @@ public:
/// Shrinks the storage. /// Shrinks the storage.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) void Shrink(vtkm::Id numberOfValues)
{ {
this->Storage->Shrink(numberOfValues); this->Storage->Shrink(numberOfValues);
@ -117,7 +117,7 @@ public:
/// A no-op. /// A no-op.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void ReleaseResources() { } void ReleaseResources() { }
private: private:

@ -51,11 +51,11 @@ public:
typedef IteratorT IteratorType; typedef IteratorT IteratorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalFromIterators() { } ArrayPortalFromIterators() { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalFromIterators(IteratorT begin, IteratorT end) ArrayPortalFromIterators(IteratorT begin, IteratorT end)
: BeginIterator(begin) : BeginIterator(begin)
{ {
@ -78,34 +78,34 @@ public:
/// type casting that the iterators do (like the non-const to const cast). /// type casting that the iterators do (like the non-const to const cast).
/// ///
template<class OtherIteratorT> template<class OtherIteratorT>
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT> &src) ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT> &src)
: BeginIterator(src.GetIteratorBegin()), NumberOfValues(src.GetNumberOfValues()) : BeginIterator(src.GetIteratorBegin()), NumberOfValues(src.GetNumberOfValues())
{ } { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->NumberOfValues; return this->NumberOfValues;
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const ValueType Get(vtkm::Id index) const
{ {
return *this->IteratorAt(index); return *this->IteratorAt(index);
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
void Set(vtkm::Id index, const ValueType& value) const void Set(vtkm::Id index, const ValueType& value) const
{ {
*(this->BeginIterator + index) = value; *(this->BeginIterator + index) = value;
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorT GetIteratorBegin() const { IteratorT GetIteratorBegin() const {
return this->BeginIterator; return this->BeginIterator;
} }
@ -115,7 +115,7 @@ private:
vtkm::Id NumberOfValues; vtkm::Id NumberOfValues;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorT IteratorAt(vtkm::Id index) const IteratorT IteratorAt(vtkm::Id index) const
{ {
VTKM_ASSERT(index >= 0); VTKM_ASSERT(index >= 0);
@ -135,11 +135,11 @@ public:
typedef IteratorT IteratorType; typedef IteratorT IteratorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalFromIterators() { } ArrayPortalFromIterators() { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalFromIterators(IteratorT begin, IteratorT end) ArrayPortalFromIterators(IteratorT begin, IteratorT end)
: BeginIterator(begin) : BeginIterator(begin)
{ {
@ -162,27 +162,27 @@ public:
/// type casting that the iterators do (like the non-const to const cast). /// type casting that the iterators do (like the non-const to const cast).
/// ///
template<class OtherIteratorT> template<class OtherIteratorT>
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT> &src) ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT> &src)
: BeginIterator(src.GetIteratorBegin()), NumberOfValues(src.GetNumberOfValues()) : BeginIterator(src.GetIteratorBegin()), NumberOfValues(src.GetNumberOfValues())
{ } { }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
vtkm::Id GetNumberOfValues() const vtkm::Id GetNumberOfValues() const
{ {
return this->NumberOfValues; return this->NumberOfValues;
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ValueType Get(vtkm::Id index) const ValueType Get(vtkm::Id index) const
{ {
return *this->IteratorAt(index); return *this->IteratorAt(index);
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorT GetIteratorBegin() const { IteratorT GetIteratorBegin() const {
return this->BeginIterator; return this->BeginIterator;
} }
@ -192,7 +192,7 @@ private:
vtkm::Id NumberOfValues; vtkm::Id NumberOfValues;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorT IteratorAt(vtkm::Id index) const IteratorT IteratorAt(vtkm::Id index) const
{ {
VTKM_ASSERT(index >= 0); VTKM_ASSERT(index >= 0);
@ -224,7 +224,7 @@ public:
typedef _IteratorType IteratorType; typedef _IteratorType IteratorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalToIterators(const PortalType &portal) ArrayPortalToIterators(const PortalType &portal)
: Iterator(portal.GetIteratorBegin()), : Iterator(portal.GetIteratorBegin()),
NumberOfValues(portal.GetNumberOfValues()) NumberOfValues(portal.GetNumberOfValues())
@ -237,7 +237,7 @@ public:
typedef stdext::checked_array_iterator<_IteratorType> IteratorType; typedef stdext::checked_array_iterator<_IteratorType> IteratorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalToIterators(const PortalType &portal) ArrayPortalToIterators(const PortalType &portal)
: Iterator(portal.GetIteratorBegin(), : Iterator(portal.GetIteratorBegin(),
static_cast<size_t>(portal.GetNumberOfValues())), static_cast<size_t>(portal.GetNumberOfValues())),
@ -247,11 +247,11 @@ public:
#endif // VTKM_MSVC #endif // VTKM_MSVC
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorType GetBegin() const { return this->Iterator; } IteratorType GetBegin() const { return this->Iterator; }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorType GetEnd() const { IteratorType GetEnd() const {
IteratorType iterator = this->Iterator; IteratorType iterator = this->Iterator;
typedef typename std::iterator_traits<IteratorType>::difference_type typedef typename std::iterator_traits<IteratorType>::difference_type

@ -42,14 +42,14 @@ public:
typedef typename DelegatePortalType::ValueType ValueType; typedef typename DelegatePortalType::ValueType ValueType;
VTKM_CONT_EXPORT ArrayPortalShrink() : NumberOfValues(0) { } VTKM_CONT ArrayPortalShrink() : NumberOfValues(0) { }
VTKM_CONT_EXPORT ArrayPortalShrink(const DelegatePortalType &delegatePortal) VTKM_CONT ArrayPortalShrink(const DelegatePortalType &delegatePortal)
: DelegatePortal(delegatePortal), : DelegatePortal(delegatePortal),
NumberOfValues(delegatePortal.GetNumberOfValues()) NumberOfValues(delegatePortal.GetNumberOfValues())
{ } { }
VTKM_CONT_EXPORT ArrayPortalShrink(const DelegatePortalType &delegatePortal, VTKM_CONT ArrayPortalShrink(const DelegatePortalType &delegatePortal,
vtkm::Id numberOfValues) vtkm::Id numberOfValues)
: DelegatePortal(delegatePortal), NumberOfValues(numberOfValues) : DelegatePortal(delegatePortal), NumberOfValues(numberOfValues)
{ {
@ -61,16 +61,16 @@ public:
/// the delegates can do (like the non-const to const cast). /// the delegates can do (like the non-const to const cast).
/// ///
template<class OtherDelegateType> template<class OtherDelegateType>
VTKM_CONT_EXPORT VTKM_CONT
ArrayPortalShrink(const ArrayPortalShrink<OtherDelegateType> &src) ArrayPortalShrink(const ArrayPortalShrink<OtherDelegateType> &src)
: DelegatePortal(src.GetDelegatePortal()), : DelegatePortal(src.GetDelegatePortal()),
NumberOfValues(src.GetNumberOfValues()) NumberOfValues(src.GetNumberOfValues())
{ } { }
VTKM_CONT_EXPORT VTKM_CONT
vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; } vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; }
VTKM_CONT_EXPORT VTKM_CONT
ValueType Get(vtkm::Id index) const ValueType Get(vtkm::Id index) const
{ {
VTKM_ASSERT(index >= 0); VTKM_ASSERT(index >= 0);
@ -78,7 +78,7 @@ public:
return this->DelegatePortal.Get(index); return this->DelegatePortal.Get(index);
} }
VTKM_CONT_EXPORT VTKM_CONT
void Set(vtkm::Id index, const ValueType& value) const void Set(vtkm::Id index, const ValueType& value) const
{ {
VTKM_ASSERT(index >= 0); VTKM_ASSERT(index >= 0);
@ -89,7 +89,7 @@ public:
/// Special method in this ArrayPortal that allows you to shrink the /// Special method in this ArrayPortal that allows you to shrink the
/// (exposed) array. /// (exposed) array.
/// ///
VTKM_CONT_EXPORT VTKM_CONT
void Shrink(vtkm::Id numberOfValues) void Shrink(vtkm::Id numberOfValues)
{ {
VTKM_ASSERT(numberOfValues < this->GetNumberOfValues()); VTKM_ASSERT(numberOfValues < this->GetNumberOfValues());
@ -125,7 +125,7 @@ class ArrayPortalToIterators<
public: public:
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
ArrayPortalToIterators(const PortalType &portal) ArrayPortalToIterators(const PortalType &portal)
: DelegateIterators(portal.GetDelegatePortal()), : DelegateIterators(portal.GetDelegatePortal()),
NumberOfValues(portal.GetNumberOfValues()) NumberOfValues(portal.GetNumberOfValues())
@ -134,13 +134,13 @@ public:
typedef typename DelegateArrayPortalToIterators::IteratorType IteratorType; typedef typename DelegateArrayPortalToIterators::IteratorType IteratorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorType GetBegin() const { IteratorType GetBegin() const {
return this->DelegateIterators.GetBegin(); return this->DelegateIterators.GetBegin();
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT_EXPORT VTKM_EXEC_CONT
IteratorType GetEnd() const { IteratorType GetEnd() const {
IteratorType iterator = this->GetBegin(); IteratorType iterator = this->GetBegin();
std::advance(iterator, this->NumberOfValues); std::advance(iterator, this->NumberOfValues);

Some files were not shown because too many files have changed in this diff Show More