fixing comments and removing old worklet.

This commit is contained in:
Jeremy Meredith 2015-04-15 10:52:09 -04:00
parent d807c1d865
commit 75971e9abb
4 changed files with 2 additions and 198 deletions

@ -40,7 +40,7 @@ struct TransportTagArrayIn { };
template<typename ContObjectType, typename Device>
struct Transport<vtkm::cont::arg::TransportTagArrayIn, ContObjectType, Device>
{
///\todo: something like VTKM_IS_ARRAY_HANDLE(ContObjectType), but for topology
///\todo: something equivalent to VTKM_IS_ARRAY_HANDLE(ContObjectType);
typedef typename ContObjectType::template ExecutionTypes<Device>::PortalConst
ExecObjectType;

@ -40,7 +40,7 @@ struct TransportTagTopologyIn { };
template<typename ContObjectType, typename Device>
struct Transport<vtkm::cont::arg::TransportTagTopologyIn, ContObjectType, Device>
{
///\todo: something equivalent to VTKM_IS_ARRAY_HANDLE(ContObjectType);
///\todo: something like VTKM_IS_ARRAY_HANDLE(ContObjectType), but for topology
///\todo: actually figure out the execution object type from the control
typedef ContObjectType ExecObjectType;

@ -1,94 +0,0 @@
//============================================================================
// 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.
//
// Copyright 2014 Sandia Corporation.
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014. Los Alamos National Security
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_worklet_Dispatcher_MapCell_h
#define vtk_m_worklet_Dispatcher_MapCell_h
#include <vtkm/cont/DeviceAdapter.h>
#include <vtkm/worklet/WorkletMapCell.h>
#include <vtkm/worklet/internal/DispatcherBase.h>
namespace vtkm {
namespace worklet {
/// \brief Dispatcher for worklets that inherit from \c WorkletMapCell.
///
template<typename WorkletType,
typename Device = VTKM_DEFAULT_DEVICE_ADAPTER_TAG>
class DispatcherMapCell :
public vtkm::worklet::internal::DispatcherBase<
DispatcherMapCell<WorkletType,Device>,
WorkletType,
vtkm::worklet::WorkletMapCell,
Device>
{
typedef vtkm::worklet::internal::DispatcherBase<
DispatcherMapCell<WorkletType,Device>,
WorkletType,
vtkm::worklet::WorkletMapCell,
Device> Superclass;
public:
VTKM_CONT_EXPORT
DispatcherMapCell(const WorkletType &worklet = WorkletType())
: Superclass(worklet) { }
template<typename Invocation>
VTKM_CONT_EXPORT
void DoInvoke(const Invocation &invocation) const
{
// The parameter for the input domain is stored in the Invocation. (It is
// also in the worklet, but it is safer to get it from the Invocation
// in case some other dispatch operation had to modify it.)
static const vtkm::IdComponent InputDomainIndex =
Invocation::InputDomainIndex;
// ParameterInterface (from Invocation) is a FunctionInterface type
// containing types for all objects passed to the Invoke method (with
// some dynamic casting performed so objects like DynamicArrayHandle get
// cast to ArrayHandle).
typedef typename Invocation::ParameterInterface ParameterInterface;
// This is the type for the input domain (derived from the last two things
// we got from the Invocation).
typedef typename ParameterInterface::
template ParameterType<InputDomainIndex>::type InputDomainType;
// We can pull the input domain parameter (the data specifying the input
// domain) from the invocation object.
InputDomainType inputDomain =
invocation.Parameters.template GetParameter<InputDomainIndex>();
// For a DispatcherMapCell, the inputDomain must be an ArrayHandle (or
// a DynamicArrayHandle that gets cast to one). The size of the domain
// (number of threads/worklet instances) is equal to the size of the
// array.
///\todo: GetNumberOfCells
vtkm::Id numInstances = inputDomain.GetNumberOfElements();
///\todo:
this->BasicInvoke(invocation, numInstances);
}
};
}
} // namespace vtkm::worklet
#endif //vtk_m_worklet_Dispatcher_MapCell_h

@ -1,102 +0,0 @@
//============================================================================
// 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.
//
// Copyright 2014 Sandia Corporation.
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014. Los Alamos National Security
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_worklet_WorkletMapCell_h
#define vtk_m_worklet_WorkletMapCell_h
#include <vtkm/worklet/internal/WorkletBase.h>
#include <vtkm/TypeListTag.h>
#include <vtkm/cont/arg/ControlSignatureTagBase.h>
#include <vtkm/cont/arg/TransportTagArrayIn.h>
#include <vtkm/cont/arg/TransportTagArrayOut.h>
#include <vtkm/cont/arg/TransportTagTopologyIn.h>
#include <vtkm/cont/arg/TypeCheckTagArray.h>
#include <vtkm/cont/arg/TypeCheckTagTopology.h>
#include <vtkm/exec/arg/FetchTagArrayDirectIn.h>
#include <vtkm/exec/arg/FetchTagArrayDirectOut.h>
#include <vtkm/exec/arg/FetchTagTopologyIn.h>
#include <vtkm/exec/arg/FetchTagArrayTopologyMapIn.h>
namespace vtkm {
namespace worklet {
/// Base class for worklets that do a simple mapping of field arrays. All
/// inputs and outputs are on the same domain. That is, all the arrays are the
/// same size.
///
class WorkletMapCell : public vtkm::worklet::internal::WorkletBase
{
public:
/// \brief A control signature tag for input fields.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
///
template<typename TypeList = AllTypes>
struct FieldCellIn : vtkm::cont::arg::ControlSignatureTagBase {
typedef vtkm::cont::arg::TypeCheckTagArray<TypeList> TypeCheckTag;
typedef vtkm::cont::arg::TransportTagArrayIn TransportTag;
typedef vtkm::exec::arg::FetchTagArrayDirectIn FetchTag;
};
/// \brief A control signature tag for input connectivity.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
///
template<typename TypeList = AllTypes>
struct FieldNodeIn : vtkm::cont::arg::ControlSignatureTagBase {
typedef vtkm::cont::arg::TypeCheckTagArray<TypeList> TypeCheckTag;
typedef vtkm::cont::arg::TransportTagArrayIn TransportTag;
typedef vtkm::exec::arg::FetchTagArrayTopologyMapIn FetchTag;
};
/// \brief A control signature tag for input connectivity.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
///
template< vtkm::IdComponent ItemTupleLength>
struct TopologyIn : vtkm::cont::arg::ControlSignatureTagBase {
typedef vtkm::cont::arg::TypeCheckTagTopology TypeCheckTag;
typedef vtkm::cont::arg::TransportTagTopologyIn TransportTag;
typedef vtkm::exec::arg::FetchTagTopologyIn FetchTag;
static const int ITEM_TUPLE_LENGTH = ItemTupleLength;
};
/// \brief A control signature tag for output fields.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
///
template<typename TypeList = AllTypes>
struct FieldCellOut : vtkm::cont::arg::ControlSignatureTagBase {
typedef vtkm::cont::arg::TypeCheckTagArray<TypeList> TypeCheckTag;
typedef vtkm::cont::arg::TransportTagArrayOut TransportTag;
typedef vtkm::exec::arg::FetchTagArrayDirectOut FetchTag;
};
};
}
} // namespace vtkm::worklet
#endif //vtk_m_worklet_WorkletMapCell_h