Commit d1d61b9e authored by Robert Maynard's avatar Robert Maynard

vtkm::filter::Filter passes filter policies by value

It now follows the same pattern that all filter implementations use
parent 4ff021b0
......@@ -243,7 +243,7 @@ public:
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet Execute(const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
vtkm::filter::PolicyBase<DerivedPolicy> policy);
//@}
//@{
......@@ -253,9 +253,8 @@ public:
VTKM_CONT vtkm::cont::PartitionedDataSet Execute(const vtkm::cont::PartitionedDataSet& input);
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::PartitionedDataSet Execute(
const vtkm::cont::PartitionedDataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::PartitionedDataSet Execute(const vtkm::cont::PartitionedDataSet& input,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
//@}
/// Map fields from input dataset to output.
......@@ -264,7 +263,7 @@ public:
template <typename DerivedPolicy>
VTKM_CONT void MapFieldsToPass(const vtkm::cont::DataSet& input,
vtkm::cont::DataSet& output,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
vtkm::filter::PolicyBase<DerivedPolicy> policy);
/// Specify the vtkm::cont::Invoker to be used to execute worklets by
/// this filter instance. Overriding the default allows callers to control
......
......@@ -147,7 +147,7 @@ template <typename Derived, typename DerivedPolicy>
void CallMapFieldOntoOutput(Derived* self,
const vtkm::cont::DataSet& input,
vtkm::cont::DataSet& output,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
using call_supported_t = typename SupportsMapFieldOntoOutput<Derived, DerivedPolicy>::type;
CallMapFieldOntoOutputInternal(call_supported_t(), self, input, output, policy);
......@@ -266,7 +266,7 @@ template <typename Derived>
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet Filter<Derived>::Execute(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
VTKM_LOG_SCOPE(
vtkm::cont::LogLevel::Perf, "Filter: '%s'", vtkm::cont::TypeToString<Derived>().c_str());
......@@ -286,7 +286,7 @@ template <typename Derived>
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::PartitionedDataSet Filter<Derived>::Execute(
const vtkm::cont::PartitionedDataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
VTKM_LOG_SCOPE(vtkm::cont::LogLevel::Perf,
"Filter (PartitionedDataSet): '%s'",
......@@ -311,7 +311,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT void Filter<Derived>::MapFieldsToPass(
const vtkm::cont::DataSet& input,
vtkm::cont::DataSet& output,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
Derived* self = static_cast<Derived*>(this);
for (vtkm::IdComponent cc = 0; cc < input.GetNumberOfFields(); ++cc)
......
......@@ -51,12 +51,11 @@ public:
template <typename DerivedPolicy>
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
vtkm::filter::PolicyBase<DerivedPolicy> policy);
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
private:
vtkm::Id CoordinateSystemIndex;
......
......@@ -38,7 +38,7 @@ template <typename Derived>
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterDataSet<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
return (static_cast<Derived*>(this))->DoExecute(input, policy);
}
......@@ -49,7 +49,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT bool FilterDataSet<Derived>::MapFieldOntoOutput(
vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
bool valid = false;
......
......@@ -77,26 +77,23 @@ public:
template <typename DerivedPolicy>
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
vtkm::filter::PolicyBase<DerivedPolicy> policy);
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
private:
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
const vtkm::cont::Field& field,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
//How do we specify float/double coordinate types?
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::CoordinateSystem& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
const vtkm::cont::CoordinateSystem& field,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
std::string OutputFieldName;
vtkm::Id CoordinateSystemIndex;
......
......@@ -49,7 +49,7 @@ template <typename Derived>
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterDataSetWithField<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
if (this->UseCoordinateSystemAsField)
{
......@@ -70,7 +70,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterDataSetWithField<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
vtkm::filter::FieldMetadata metaData(field);
vtkm::cont::DataSet result;
......@@ -92,7 +92,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterDataSetWithField<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::CoordinateSystem& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
//We have a special signature just for CoordinateSystem, so that we can ask
//the policy for the storage types and value types just for coordinate systems
......@@ -122,7 +122,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT bool FilterDataSetWithField<Derived>::MapFieldOntoOutput(
vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
bool valid = false;
......
......@@ -83,21 +83,18 @@ public:
//@{
/// These are provided to satisfy the Filter API requirements.
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
const vtkm::cont::Field& field,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
template <typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::CoordinateSystem& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
VTKM_CONT vtkm::cont::DataSet PrepareForExecution(const vtkm::cont::DataSet& input,
const vtkm::cont::CoordinateSystem& field,
vtkm::filter::PolicyBase<DerivedPolicy> policy);
//@}
protected:
......
......@@ -48,7 +48,7 @@ template <typename Derived>
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterField<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
if (this->UseCoordinateSystemAsField)
{
......@@ -70,7 +70,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterField<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::Field& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
vtkm::filter::FieldMetadata metaData(field);
vtkm::cont::DataSet result;
......@@ -92,7 +92,7 @@ template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet FilterField<Derived>::PrepareForExecution(
const vtkm::cont::DataSet& input,
const vtkm::cont::CoordinateSystem& field,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
//We have a special signature just for CoordinateSystem, so that we can ask
//the policy for the storage types and value types just for coordinate systems
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment