Commit a1ea509f authored by Robert Maynard's avatar Robert Maynard

All scatter types now inherit from a common base

This is required for vtkm::worklet::Invoker to launch worklets
with a non default scatter type.
parent 77378993
......@@ -10,6 +10,7 @@
#ifndef vtk_m_worklet_ScatterCounting_h
#define vtk_m_worklet_ScatterCounting_h
#include <vtkm/worklet/internal/ScatterBase.h>
#include <vtkm/worklet/vtkm_worklet_export.h>
#include <vtkm/cont/VariantArrayHandle.h>
......@@ -40,7 +41,7 @@ struct ScatterCountingBuilder;
/// taken in the constructor and the index arrays are derived from that. So
/// changing the counts after the scatter is created will have no effect.
///
struct VTKM_WORKLET_EXPORT ScatterCounting
struct VTKM_WORKLET_EXPORT ScatterCounting : internal::ScatterBase
{
struct CountTypes : vtkm::ListTagBase<vtkm::Int64,
vtkm::Int32,
......
......@@ -12,6 +12,7 @@
#include <vtkm/cont/ArrayHandleConstant.h>
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/worklet/internal/ScatterBase.h>
namespace vtkm
{
......@@ -26,7 +27,7 @@ namespace worklet
/// element generates one output element associated with it. This is the
/// default for basic maps.
///
struct ScatterIdentity
struct ScatterIdentity : internal::ScatterBase
{
using OutputToInputMapType = vtkm::cont::ArrayHandleIndex;
VTKM_CONT
......
......@@ -12,6 +12,7 @@
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleConstant.h>
#include <vtkm/worklet/internal/ScatterBase.h>
namespace vtkm
{
......@@ -28,7 +29,7 @@ namespace worklet
/// can be duplicates. Note that even with duplicates the VistIndex is always 0.
///
template <typename PermutationStorage = VTKM_DEFAULT_STORAGE_TAG>
class ScatterPermutation
class ScatterPermutation : public internal::ScatterBase
{
private:
using PermutationArrayHandle = vtkm::cont::ArrayHandle<vtkm::Id, PermutationStorage>;
......
......@@ -13,6 +13,7 @@
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleCounting.h>
#include <vtkm/cont/ArrayHandleImplicit.h>
#include <vtkm/worklet/internal/ScatterBase.h>
namespace vtkm
{
......@@ -49,7 +50,7 @@ struct FunctorDiv
/// elements are grouped by the input associated.
///
template <vtkm::IdComponent NumOutputsPerInput>
struct ScatterUniform
struct ScatterUniform : internal::ScatterBase
{
VTKM_CONT ScatterUniform() = default;
......
......@@ -10,6 +10,7 @@
set(headers
DispatcherBase.h
ScatterBase.h
TriangulateTables.h
WorkletBase.h
)
......
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_worklet_internal_ScatterBase_h
#define vtk_m_worklet_internal_ScatterBase_h
#include <vtkm/internal/ExportMacros.h>
namespace vtkm
{
namespace worklet
{
namespace internal
{
/// Base class for all scatter classes.
///
/// This allows VTK-m to determine when a parameter
/// is a scatter type instead of a worklet parameter.
///
struct VTKM_ALWAYS_EXPORT ScatterBase
{
};
}
}
}
#endif
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