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.
+ 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.

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

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

@ -69,11 +69,11 @@ public:
const vtkm::Float32 xmin, ymin, zmin, xmax, ymax, zmax;
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]),
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
{
const vtkm::Id x = vertexId % (xdim);

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

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

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

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

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

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

@ -41,7 +41,7 @@ namespace vtkm {
struct Sum
{
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;
}
@ -53,7 +53,7 @@ struct Sum
struct Product
{
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;
}
@ -71,7 +71,7 @@ struct Product
struct Maximum
{
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;
}
@ -84,7 +84,7 @@ struct Maximum
struct Minimum
{
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;
}
@ -96,7 +96,7 @@ struct Minimum
struct BitwiseAnd
{
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;
}
@ -108,7 +108,7 @@ struct BitwiseAnd
struct BitwiseOr
{
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;
}
@ -120,7 +120,7 @@ struct BitwiseOr
struct BitwiseXor
{
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;
}

@ -30,7 +30,7 @@ namespace vtkm {
struct Equal
{
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;
}
@ -42,7 +42,7 @@ struct Equal
struct NotEqual
{
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;
}
@ -54,7 +54,7 @@ struct NotEqual
struct SortLess
{
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;
}
@ -67,7 +67,7 @@ struct SortLess
struct SortGreater
{
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;
}
@ -80,7 +80,7 @@ struct SortGreater
struct LogicalAnd
{
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;
}
@ -93,7 +93,7 @@ struct LogicalAnd
struct LogicalOr
{
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;
}

@ -41,10 +41,10 @@ struct Bounds
vtkm::Range Y;
vtkm::Range Z;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
Bounds() { }
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
Bounds(const vtkm::Range &xRange,
const vtkm::Range &yRange,
const vtkm::Range &zRange)
@ -56,7 +56,7 @@ struct Bounds
typename T4,
typename T5,
typename T6>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
Bounds(const T1 &minX, const T2 &maxX,
const T3 &minY, const T4 &maxY,
const T5 &minZ, const T6 &maxZ)
@ -69,7 +69,7 @@ struct Bounds
/// ymin, ymax, zmin, zmax.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
explicit Bounds(const T bounds[6])
: X(vtkm::Range(bounds[0], bounds[1])),
Y(vtkm::Range(bounds[2], bounds[3])),
@ -80,14 +80,14 @@ struct Bounds
/// point.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
Bounds(const vtkm::Vec<T,3> &minPoint, const vtkm::Vec<T,3> &maxPoint)
: X(vtkm::Range(minPoint[0], maxPoint[0])),
Y(vtkm::Range(minPoint[1], maxPoint[1])),
Z(vtkm::Range(minPoint[2], maxPoint[2]))
{ }
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
const vtkm::Bounds &operator=(const vtkm::Bounds &src)
{
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
/// infinity, true is returned.
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool IsNonEmpty() const
{
return (this->X.IsNonEmpty() &&
@ -113,7 +113,7 @@ struct Bounds
/// \b Determines if a point coordinate is within the bounds.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool Contains(const vtkm::Vec<T,3> &point) const
{
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
/// are empty, the results are undefined.
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64,3> Center() const
{
return vtkm::Vec<vtkm::Float64,3>(this->X.Center(),
@ -141,7 +141,7 @@ struct Bounds
/// nothing is done.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void Include(const vtkm::Vec<T,3> &point)
{
this->X.Include(point[0]);
@ -154,7 +154,7 @@ struct Bounds
/// 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.
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void Include(const vtkm::Bounds &bounds)
{
this->X.Include(bounds.X);
@ -166,7 +166,7 @@ struct Bounds
///
/// 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 unionBounds(*this);
@ -176,13 +176,13 @@ struct Bounds
/// \b Operator for union
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Bounds operator+(const vtkm::Bounds &otherBounds) const
{
return this->Union(otherBounds);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator==(const vtkm::Bounds &bounds) const
{
return ((this->X == bounds.X) &&
@ -190,7 +190,7 @@ struct Bounds
(this->Z == bounds.Z));
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator!=(const vtkm::Bounds &bounds) const
{
return ((this->X != bounds.X) ||
@ -203,7 +203,7 @@ struct Bounds
/// Helper function for printing bounds during testing
///
VTKM_CONT_EXPORT
static inline VTKM_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
{
return stream << "{ X:" << bounds.X

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

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

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

@ -47,17 +47,17 @@ public:
static const vtkm::IdComponent NUM_ROWS = NumRow;
static const vtkm::IdComponent NUM_COLUMNS = NumCol;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
Matrix() { }
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
explicit Matrix(const ComponentType &value)
: Components(vtkm::Vec<ComponentType, NUM_COLUMNS>(value)) { }
/// Brackets are used to reference a matrix like a 2D array (i.e.
/// matrix[row][column]).
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
const vtkm::Vec<ComponentType, NUM_COLUMNS> &
operator[](vtkm::IdComponent rowIndex) const {
VTKM_ASSERT(rowIndex >= 0);
@ -68,7 +68,7 @@ public:
/// Brackets are used to referens a matrix like a 2D array i.e.
/// matrix[row][column].
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<ComponentType, NUM_COLUMNS> &
operator[](vtkm::IdComponent rowIndex) {
VTKM_ASSERT(rowIndex >= 0);
@ -79,7 +79,7 @@ public:
/// Parentheses are used to reference a matrix using mathematical tuple
/// notation i.e. matrix(row,column).
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
const ComponentType &
operator()(vtkm::IdComponent rowIndex, vtkm::IdComponent colIndex) const {
VTKM_ASSERT(rowIndex >= 0);
@ -92,7 +92,7 @@ public:
/// Parentheses are used to reference a matrix using mathematical tuple
/// notation i.e. matrix(row,column).
///
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ComponentType &
operator()(vtkm::IdComponent rowIndex, vtkm::IdComponent colIndex) {
VTKM_ASSERT(rowIndex >= 0);
@ -110,7 +110,7 @@ private:
/// matrix.
///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
const vtkm::Vec<T, NumCol> &MatrixGetRow(
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.
///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T, NumRow> MatrixGetColumn(
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.
///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void MatrixSetRow(vtkm::Matrix<T,NumRow,NumCol> &matrix,
vtkm::IdComponent rowIndex,
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.
///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void MatrixSetColumn(vtkm::Matrix<T,NumRow,NumCol> &matrix,
vtkm::IdComponent columnIndex,
const vtkm::Vec<T,NumRow> &columnValues)
@ -164,7 +164,7 @@ template<typename T,
vtkm::IdComponent NumRow,
vtkm::IdComponent NumCol,
vtkm::IdComponent NumInternal>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,NumRow,NumCol> MatrixMultiply(
const vtkm::Matrix<T,NumRow,NumInternal> &leftFactor,
const vtkm::Matrix<T,NumInternal,NumCol> &rightFactor)
@ -191,7 +191,7 @@ vtkm::Matrix<T,NumRow,NumCol> MatrixMultiply(
/// Standard matrix-vector multiplication.
///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,NumRow> MatrixMultiply(
const vtkm::Matrix<T,NumRow,NumCol> &leftFactor,
const vtkm::Vec<T,NumCol> &rightFactor)
@ -208,7 +208,7 @@ vtkm::Vec<T,NumRow> MatrixMultiply(
/// Standard vector-matrix multiplication
///
template<typename T, vtkm::IdComponent NumRow, vtkm::IdComponent NumCol>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,NumCol> MatrixMultiply(
const vtkm::Vec<T,NumRow> &leftFactor,
const vtkm::Matrix<T,NumRow,NumCol> &rightFactor)
@ -226,7 +226,7 @@ vtkm::Vec<T,NumCol> MatrixMultiply(
/// Returns the identity matrix.
///
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,Size,Size> MatrixIdentity()
{
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.
///
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void MatrixIdentity(vtkm::Matrix<T,Size,Size> &matrix)
{
matrix = vtkm::MatrixIdentity<T,Size>();
@ -249,7 +249,7 @@ void MatrixIdentity(vtkm::Matrix<T,Size,Size> &matrix)
/// Returns the transpose of the given matrix.
///
template<typename T, vtkm::IdComponent NumRows, vtkm::IdComponent NumCols>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,NumCols,NumRows> MatrixTranspose(
const vtkm::Matrix<T,NumRows,NumCols> &matrix)
{
@ -274,7 +274,7 @@ namespace detail {
// Used with MatrixLUPFactor.
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void MatrixLUPFactorFindPivot(vtkm::Matrix<T,Size,Size> &A,
vtkm::Vec<vtkm::IdComponent,Size> &permutation,
vtkm::IdComponent topCornerIndex,
@ -318,7 +318,7 @@ void MatrixLUPFactorFindPivot(vtkm::Matrix<T,Size,Size> &A,
// Used with MatrixLUPFactor
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void MatrixLUPFactorFindUpperTriangleElements(vtkm::Matrix<T,Size,Size> &A,
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.
///
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
void MatrixLUPFactor(vtkm::Matrix<T,Size,Size> &A,
vtkm::Vec<vtkm::IdComponent,Size> &permutation,
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.
///
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,Size>
MatrixLUPSolve(const vtkm::Matrix<T,Size,Size> &LU,
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.
///
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,
const vtkm::Vec<T,Size> &b,
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.
///
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,
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.
///
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,Size,Size> &A)
{
// 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.
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,1,1> &A)
{
return A(0,0);
}
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T MatrixDeterminant(const vtkm::Matrix<T,2,2> &A)
{
return A(0,0)*A(1,1) - A(1,0)*A(0,1);
}
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
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) +
@ -572,26 +572,26 @@ public:
typedef vtkm::VecTraitsTagMultipleComponents HasMultipleComponents;
typedef vtkm::VecTraitsTagSizeStatic IsSizeStatic;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
static vtkm::IdComponent GetNumberOfComponents(const MatrixType &) {
return NUM_COMPONENTS;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
static const ComponentType &GetComponent(const MatrixType &matrix,
vtkm::IdComponent component) {
vtkm::IdComponent colIndex = component % NumCol;
vtkm::IdComponent rowIndex = component / NumCol;
return matrix(rowIndex,colIndex);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
static ComponentType &GetComponent(MatrixType &matrix,
vtkm::IdComponent component) {
vtkm::IdComponent colIndex = component % NumCol;
vtkm::IdComponent rowIndex = component / NumCol;
return matrix(rowIndex,colIndex);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
static void SetComponent(MatrixType &matrix,
vtkm::IdComponent component,
T value)
@ -606,7 +606,7 @@ public:
// Basic comparison operators.
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,
const vtkm::Matrix<T,NumRow,NumCol> &b)
{
@ -620,7 +620,7 @@ bool operator==(const vtkm::Matrix<T,NumRow,NumCol> &a,
return true;
}
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,
const vtkm::Matrix<T,NumRow,NumCol> &b)
{

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

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

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

@ -42,7 +42,7 @@ namespace vtkm {
/// transformations.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,3> Transform3DPoint(const vtkm::Matrix<T,4,4> &matrix,
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,3> Transform3DPointPerspective(const vtkm::Matrix<T,4,4> &matrix,
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,3> Transform3DVector(const vtkm::Matrix<T,4,4> &matrix,
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4>
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DScale(const vtkm::Vec<T,3> &scaleVec)
{
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DScale(const T &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.
///
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> translateMatrix;
@ -150,7 +150,7 @@ vtkm::Matrix<T,4,4> Transform3DTranslate(const T &x, const T &y, const T &z)
return translateMatrix;
}
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DTranslate(const vtkm::Vec<T,3> &v)
{
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees,
const vtkm::Vec<T,3> &axisOfRotation)
{
@ -198,7 +198,7 @@ vtkm::Matrix<T,4,4> Transform3DRotate(T angleDegrees,
return matrix;
}
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
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));
@ -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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotateX(T angleDegrees)
{
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotateY(T angleDegrees)
{
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.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Matrix<T,4,4> Transform3DRotateZ(T angleDegrees)
{
return vtkm::Transform3DRotate(angleDegrees, T(0), T(0), T(1));

@ -72,7 +72,7 @@ public:
/// also be treated as vectors.
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.
@ -85,14 +85,14 @@ struct TypeTraits<const T> : TypeTraits<T>
template<> struct TypeTraits<T> { \
typedef TypeTraitsRealTag NumericTag; \
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) \
template<> struct TypeTraits< T > { \
typedef TypeTraitsIntegerTag NumericTag; \
typedef TypeTraitsScalarTag DimensionalityTag; \
VTKM_EXEC_CONT_EXPORT static T ZeroInitialization() \
VTKM_EXEC_CONT static T ZeroInitialization() \
{ \
typedef T ReturnType; \
return ReturnType(); \
@ -129,7 +129,7 @@ struct TypeTraits<vtkm::Vec<T,Size> >
typedef typename vtkm::TypeTraits<T>::NumericTag NumericTag;
typedef TypeTraitsVectorTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
static vtkm::Vec<T,Size> ZeroInitialization()
{ return vtkm::Vec<T,Size>( (T()) ); }
};
@ -142,7 +142,7 @@ struct TypeTraits<vtkm::Pair<T,U> >
typedef TypeTraitsUnknownTag NumericTag;
typedef TypeTraitsScalarTag DimensionalityTag;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
static vtkm::Pair<T,U> ZeroInitialization()
{
return vtkm::Pair<T,U>(TypeTraits<T>::ZeroInitialization(),

@ -182,7 +182,7 @@ template <vtkm::IdComponent Size>
struct VecComponentWiseUnaryOperation
{
template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const
{
T result;
@ -198,7 +198,7 @@ template<>
struct VecComponentWiseUnaryOperation<1>
{
template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const
{
return T(unaryOp(v[0]));
@ -209,7 +209,7 @@ template<>
struct VecComponentWiseUnaryOperation<2>
{
template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const
{
return T(unaryOp(v[0]), unaryOp(v[1]));
@ -220,7 +220,7 @@ template<>
struct VecComponentWiseUnaryOperation<3>
{
template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const
{
return T(unaryOp(v[0]), unaryOp(v[1]), unaryOp(v[2]));
@ -231,7 +231,7 @@ template<>
struct VecComponentWiseUnaryOperation<4>
{
template<typename T, typename UnaryOpType>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
T operator()(const T &v, const UnaryOpType &unaryOp) const
{
return T(unaryOp(v[0]), unaryOp(v[1]), unaryOp(v[2]), unaryOp(v[3]));
@ -244,12 +244,12 @@ struct BindLeftBinaryOp
// Warning: a reference.
const T& LeftValue;
const BinaryOpType BinaryOp;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
BindLeftBinaryOp(const T &leftValue, BinaryOpType binaryOp = BinaryOpType())
: LeftValue(leftValue), BinaryOp(binaryOp) { }
template<typename RightT>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ReturnT operator()(const RightT &rightValue) const
{
return static_cast<ReturnT>(this->BinaryOp(this->LeftValue,
@ -263,12 +263,12 @@ struct BindRightBinaryOp
// Warning: a reference.
const T& RightValue;
const BinaryOpType BinaryOp;
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
BindRightBinaryOp(const T &rightValue, BinaryOpType binaryOp = BinaryOpType())
: RightValue(rightValue), BinaryOp(binaryOp) { }
template<typename LeftT>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ReturnT operator()(const LeftT &leftValue) const
{
return static_cast<ReturnT>(this->BinaryOp(static_cast<T>(leftValue),
@ -291,7 +291,7 @@ struct BindRightBinaryOp
struct Add
{
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);
}
@ -300,7 +300,7 @@ struct Add
struct Subtract
{
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);
}
@ -309,7 +309,7 @@ struct Subtract
struct Multiply
{
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);
}
@ -318,7 +318,7 @@ struct Multiply
struct Divide
{
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);
}
@ -327,7 +327,7 @@ struct Divide
struct Negate
{
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);
}
@ -355,12 +355,12 @@ public:
static const vtkm::IdComponent NUM_COMPONENTS = Size;
protected:
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
VecBase()
{
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
explicit VecBase(const ComponentType& value)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -370,8 +370,8 @@ protected:
}
template <typename OtherValueType, typename OtherDerivedType>
VTKM_EXEC_CONT_EXPORT VecBase(
const VecBase<OtherValueType, Size, OtherDerivedType>& src)
VTKM_EXEC_CONT
VecBase(const VecBase<OtherValueType, Size, OtherDerivedType>& src)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
{
@ -380,14 +380,14 @@ protected:
}
public:
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::IdComponent GetNumberOfComponents() const
{
return NUM_COMPONENTS;
}
template <vtkm::IdComponent OtherSize>
VTKM_EXEC_CONT_EXPORT void CopyInto(
VTKM_EXEC_CONT void CopyInto(
vtkm::Vec<ComponentType, OtherSize>& dest) const
{
for (vtkm::IdComponent index = 0;
@ -397,7 +397,7 @@ public:
}
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass& operator=(const DerivedClass& src)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -407,14 +407,14 @@ public:
return *static_cast<DerivedClass*>(this);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
const ComponentType& operator[](vtkm::IdComponent idx) const
{
VTKM_ASSERT(idx >= 0);
VTKM_ASSERT(idx < this->NUM_COMPONENTS);
return this->Components[idx];
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ComponentType& operator[](vtkm::IdComponent idx)
{
VTKM_ASSERT(idx >= 0);
@ -422,7 +422,7 @@ public:
return this->Components[idx];
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator==(const DerivedClass& other) const
{
bool equal=true;
@ -433,7 +433,7 @@ public:
return equal;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator<(const DerivedClass& other) const
{
for (vtkm::IdComponent i = 0; i < NUM_COMPONENTS; ++i)
@ -452,13 +452,13 @@ public:
return false;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator!=(const DerivedClass& other) const
{
return !(this->operator==(other));
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ComponentType Dot(const DerivedClass& other) const
{
ComponentType result = this->Components[0] * other[0];
@ -480,7 +480,7 @@ public:
#pragma GCC diagnostic ignored "-Wconversion"
#endif // gcc || clang
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass operator+(const DerivedClass& other) const
{
DerivedClass result;
@ -491,7 +491,7 @@ public:
return result;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass& operator+=(const DerivedClass& other)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -501,7 +501,7 @@ public:
return *static_cast<DerivedClass*>(this);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass operator-(const DerivedClass& other) const
{
DerivedClass result;
@ -512,7 +512,7 @@ public:
return result;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass& operator-=(const DerivedClass& other)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -522,7 +522,7 @@ public:
return *static_cast<DerivedClass*>(this);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass operator*(const DerivedClass& other) const
{
DerivedClass result;
@ -533,7 +533,7 @@ public:
return result;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass& operator*=(const DerivedClass& other)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -543,7 +543,7 @@ public:
return *static_cast<DerivedClass*>(this);
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass operator/(const DerivedClass& other) const
{
DerivedClass result;
@ -554,7 +554,7 @@ public:
return result;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
DerivedClass& operator/=(const DerivedClass& other)
{
for (vtkm::IdComponent i = 0; i < Size; ++i)
@ -569,13 +569,13 @@ public:
#endif // gcc || clang
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ComponentType* GetPointer()
{
return this->Components;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
const ComponentType* GetPointer() const
{
return this->Components;
@ -614,12 +614,12 @@ public:
static const vtkm::IdComponent NUM_COMPONENTS = Size;
#endif
VTKM_EXEC_CONT_EXPORT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { }
// VTKM_EXEC_CONT_EXPORT explicit Vec(const T* values) : Superclass(values) { }
VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
// VTKM_EXEC_CONT explicit Vec(const T* values) : Superclass(values) { }
template<typename OtherType>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
Vec(const Vec<OtherType, Size> &src) : Superclass(src) { }
};
@ -636,31 +636,31 @@ public:
typedef T ComponentType;
static const vtkm::IdComponent NUM_COMPONENTS = 0;
VTKM_EXEC_CONT_EXPORT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const ComponentType&) { }
VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT explicit Vec(const ComponentType&) { }
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> &
operator=(const Vec<ComponentType, NUM_COMPONENTS> &)
{
return *this;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
ComponentType operator[](vtkm::IdComponent vtkmNotUsed(idx)) const
{
return ComponentType();
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator==(const Vec<T, NUM_COMPONENTS> &vtkmNotUsed(other)) const
{
return true;
}
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
bool operator!=(const Vec<T, NUM_COMPONENTS> &vtkmNotUsed(other)) const
{
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;
public:
VTKM_EXEC_CONT_EXPORT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { }
VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
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
// overload errors
// VTKM_EXEC_CONT_EXPORT
// VTKM_EXEC_CONT
// operator T() const
// {
// 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;
public:
VTKM_EXEC_CONT_EXPORT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { }
VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
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)
{
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;
public:
VTKM_EXEC_CONT_EXPORT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { }
VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
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)
{
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;
public:
VTKM_EXEC_CONT_EXPORT Vec() {}
VTKM_EXEC_CONT_EXPORT explicit Vec(const T& value) : Superclass(value) { }
VTKM_EXEC_CONT Vec() {}
VTKM_EXEC_CONT explicit Vec(const T& value) : Superclass(value) { }
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)
{
this->Components[0] = x;
@ -781,7 +781,7 @@ struct VecOrScalar<ComponentType, 1>
/// Initializes and returns a Vec of length 2.
///
template<typename T>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T,2> make_Vec(const T &x, const T &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.
///
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)
{
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.
///
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)
{
return vtkm::Vec<T,4>(x, y, z, w);
@ -811,7 +811,8 @@ template<typename U, typename V>
struct Pair;
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 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>
VTKM_EXEC_CONT_EXPORT
static inline
VTKM_EXEC_CONT
T dot(const vtkm::Vec<T,2> &a, const vtkm::Vec<T,2> &b)
{
return T((a[0]*b[0]) + (a[1]*b[1]));
}
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)
{
return T((a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]));
}
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)
{
return T((a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]));
}
template <typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, Size>& a)
{
T result = a[0];
@ -856,28 +860,28 @@ ReduceSum(const vtkm::Vec<T, Size>& a)
}
template <typename T>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, 2>& a)
{
return a[0] + a[1];
}
template <typename T>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, 3>& a)
{
return a[0] + a[1] + a[2];
}
template <typename T>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceSum(const vtkm::Vec<T, 4>& a)
{
return a[0] + a[1] + a[2] + a[3];
}
template <typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, Size>& a)
{
T result = a[0];
@ -889,21 +893,21 @@ ReduceProduct(const vtkm::Vec<T, Size>& a)
}
template <typename T>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, 2>& a)
{
return a[0] * a[1];
}
template <typename T>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, 3>& a)
{
return a[0] * a[1] * a[2];
}
template <typename T>
VTKM_EXEC_CONT_EXPORT T
VTKM_EXEC_CONT T
ReduceProduct(const vtkm::Vec<T, 4>& a)
{
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
// an integer when doing a multiplication.
#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); \
}
@ -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::UInt16)
#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; \
}
@ -937,7 +943,7 @@ VTK_M_SCALAR_DOT(vtkm::Float64)
// Declared outside of vtkm namespace so that the operator works with all code.
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)
{
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T, Size> operator*(const vtkm::Vec<T, Size> &vec, T scalar)
{
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T, Size>
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T, Size>
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64, Size>
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64, Size>
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T, Size> operator/(const vtkm::Vec<T, Size> &vec, T scalar)
{
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<T, Size>
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>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
vtkm::Vec<vtkm::Float64, Size>
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
// change this implementation to be more inclusive.
template<typename T, vtkm::IdComponent Size>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
typename std::enable_if<
(std::is_floating_point<T>::value || std::is_signed<T>::value),
vtkm::Vec<T,Size>
@ -1051,7 +1057,7 @@ operator-(const vtkm::Vec<T,Size> &x)
/// Helper function for printing out vectors during testing.
///
template<typename T, vtkm::IdComponent Size>
VTKM_CONT_EXPORT
VTKM_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Vec<T,Size> &vec)
{
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.
///
template<typename T, typename U>
VTKM_EXEC_CONT_EXPORT
VTKM_EXEC_CONT
std::ostream &operator<<(std::ostream &stream, const vtkm::Pair<T,U> &vec)
{
return stream << "[" << vec.first << "," << vec.second << "]";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -55,7 +55,7 @@ class CellSetSingleType :
public:
template<typename CellShapeTag>
VTKM_CONT_EXPORT
VTKM_CONT
CellSetSingleType(CellShapeTag, vtkm::Id numpoints, const std::string &name = std::string())
: Superclass(numpoints, name),
CellTypeAsId(CellShapeTag::Id)
@ -63,14 +63,14 @@ public:
}
template<typename CellShapeTag>
VTKM_CONT_EXPORT
VTKM_CONT
CellSetSingleType(CellShapeTag, const std::string &name = std::string())
: Superclass(0, name),
CellTypeAsId(CellShapeTag::Id)
{
}
VTKM_CONT_EXPORT
VTKM_CONT
CellSetSingleType(vtkm::Id numpoints,
const std::string &name = std::string())
: Superclass(numpoints, name),
@ -78,19 +78,19 @@ public:
{
}
VTKM_CONT_EXPORT
VTKM_CONT
CellSetSingleType(const std::string &name = std::string())
: Superclass(0, name),
CellTypeAsId(CellShapeTagEmpty::Id)
{
}
VTKM_CONT_EXPORT
VTKM_CONT
CellSetSingleType(const Thisclass &src)
: Superclass(src), CellTypeAsId(src.CellTypeAsId)
{ }
VTKM_CONT_EXPORT
VTKM_CONT
Thisclass &operator=(const Thisclass &src)
{
this->Superclass::operator=(src);
@ -101,7 +101,7 @@ public:
virtual ~CellSetSingleType() { }
/// First method to add cells -- one at a time.
VTKM_CONT_EXPORT
VTKM_CONT
void PrepareToAddCells(vtkm::Id numShapes, vtkm::Id connectivityMaxLen)
{
vtkm::IdComponent numberOfPointsPerCell = this->DetermineNumberOfPoints();
@ -124,7 +124,7 @@ public:
/// Second method to add cells -- one at a time.
template <vtkm::IdComponent ItemTupleLength>
VTKM_CONT_EXPORT
VTKM_CONT
void AddCell(vtkm::UInt8 vtkmNotUsed(cellType),
vtkm::IdComponent numVertices,
const vtkm::Vec<vtkm::Id,ItemTupleLength> &ids)
@ -139,7 +139,7 @@ public:
}
/// Third and final method to add cells -- one at a time.
VTKM_CONT_EXPORT
VTKM_CONT
void CompleteAddingCells()
{
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
VTKM_CONT_EXPORT
VTKM_CONT
void Fill(const vtkm::cont::ArrayHandle<vtkm::Id,
ConnectivityStorageTag> &connectivity)
{

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

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

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

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

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

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

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

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

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

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

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

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

@ -115,16 +115,16 @@ public:
/// Returns a portal to the array.
///
VTKM_CONT_EXPORT
VTKM_CONT
PortalType GetPortal();
/// Returns a portal to the array with immutable values.
///
VTKM_CONT_EXPORT
VTKM_CONT
PortalConstType GetPortalConst() const;
/// Retuns the number of entries allocated in the array.
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::Id GetNumberOfValues() const;
/// \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
/// array storage is read-only).
///
VTKM_CONT_EXPORT
VTKM_CONT
void Allocate(vtkm::Id numberOfValues);
/// \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
/// (returned from GetNumberOfValues). That is, this method can only be used
/// to shorten the array, not lengthen.
VTKM_CONT_EXPORT
VTKM_CONT
void Shrink(vtkm::Id numberOfValues);
/// \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
/// resources should also be released when the Storage class is
/// destroyed.
VTKM_CONT_EXPORT
VTKM_CONT
void ReleaseResources();
};
#endif // VTKM_DOXYGEN_ONLY

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

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

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

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

@ -45,7 +45,7 @@ struct Transport<vtkm::cont::arg::TransportTagArrayIn, ContObjectType, Device>
typedef typename ContObjectType::template ExecutionTypes<Device>::PortalConst
ExecObjectType;
VTKM_CONT_EXPORT
VTKM_CONT
ExecObjectType operator()(const ContObjectType &object, vtkm::Id) const
{
// 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
ExecObjectType;
VTKM_CONT_EXPORT
VTKM_CONT
ExecObjectType operator()(ContObjectType object, vtkm::Id size) const
{
if (object.GetNumberOfValues() != size)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -32,7 +32,7 @@ namespace internal {
struct Testing
{
public:
static VTKM_CONT_EXPORT int CheckCudaBeforeExit(int result)
static VTKM_CONT int CheckCudaBeforeExit(int result)
{
cudaError_t cudaError = cudaPeekAtLastError();
if (cudaError != cudaSuccess)
@ -49,7 +49,7 @@ public:
}
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);
return CheckCudaBeforeExit(result);

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

@ -76,13 +76,13 @@ public:
/// objects should be avoided (copy references or pointers only). The
/// reference can also, of course, be ignored.
///
VTKM_CONT_EXPORT
VTKM_CONT
ArrayManagerExecution(vtkm::cont::internal::Storage<T,StorageTag> &storage);
/// Returns the number of values stored in the array. Results are undefined
/// if data has not been loaded or allocated.
///
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::Id GetNumberOfValues() const;
/// 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.
///
VTKM_CONT_EXPORT
VTKM_CONT
PortalConstExecution PrepareForInput(bool updateData);
/// 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.
///
VTKM_CONT_EXPORT
VTKM_CONT
PortalExecution LoadDataForInPlace(bool updateData);
/// 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.
///
VTKM_CONT_EXPORT
VTKM_CONT
PortalExecution PrepareForOutput(vtkm::Id numberOfValues);
/// 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
/// called.
///
VTKM_CONT_EXPORT
VTKM_CONT
void RetrieveOutputData(
vtkm::cont::internal::Storage<T,StorageTag>* storage) const;
@ -131,7 +131,7 @@ public:
/// and exeuction have seperate memory spaces).
///
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.
///
@ -142,13 +142,13 @@ public:
/// (returned from GetNumberOfValues). That is, this method can only be used
/// to shorten the array, not lengthen.
///
VTKM_CONT_EXPORT
VTKM_CONT
void Shrink(vtkm::Id numberOfValues);
/// Frees any resources (i.e. memory) allocated for the exeuction
/// environment, if any.
///
VTKM_CONT_EXPORT
VTKM_CONT
void ReleaseResources();
};
#else // VTKM_DOXGEN_ONLY

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

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

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

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