2015-02-04 22:40:31 +00:00
|
|
|
//============================================================================
|
|
|
|
// 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.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
2015-02-04 22:40:31 +00:00
|
|
|
// Copyright 2014 UT-Battelle, LLC.
|
2015-06-03 19:06:43 +00:00
|
|
|
// Copyright 2014 Los Alamos National Security.
|
2015-02-04 22:40:31 +00:00
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Under the terms of Contract DE-NA0003525 with NTESS,
|
2015-02-04 22:40:31 +00:00
|
|
|
// 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.
|
|
|
|
//============================================================================
|
2015-08-03 16:06:59 +00:00
|
|
|
#ifndef vtk_m_exec_arg_FromCount_h
|
|
|
|
#define vtk_m_exec_arg_FromCount_h
|
2015-02-04 22:40:31 +00:00
|
|
|
|
|
|
|
#include <vtkm/exec/arg/ExecutionSignatureTagBase.h>
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/exec/arg/Fetch.h>
|
2015-10-07 18:14:00 +00:00
|
|
|
#include <vtkm/exec/arg/ThreadIndicesTopologyMap.h>
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace exec
|
|
|
|
{
|
|
|
|
namespace arg
|
|
|
|
{
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-08-03 16:06:59 +00:00
|
|
|
/// \brief Aspect tag to use for getting the from count.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2015-08-03 16:06:59 +00:00
|
|
|
/// The \c AspectTagFromCount aspect tag causes the \c Fetch class to obtain
|
|
|
|
/// the number of indices that map to the current topology element.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2017-05-18 14:29:41 +00:00
|
|
|
struct AspectTagFromCount
|
|
|
|
{
|
|
|
|
};
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-08-03 16:06:59 +00:00
|
|
|
/// \brief The \c ExecutionSignature tag to get the number of from elements.
|
2015-02-04 22:40:31 +00:00
|
|
|
///
|
2015-08-03 16:06:59 +00:00
|
|
|
/// In a topology map, there are \em from and \em to topology elements
|
|
|
|
/// specified. The scheduling occurs on the \em to elements, and for each \em
|
|
|
|
/// to element there is some number of incident \em from elements that are
|
|
|
|
/// accessible. This \c ExecutionSignature tag provides the number of these \em
|
|
|
|
/// from elements that are accessible.
|
|
|
|
///
|
|
|
|
struct FromCount : vtkm::exec::arg::ExecutionSignatureTagBase
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2018-02-27 14:25:25 +00:00
|
|
|
static constexpr vtkm::IdComponent INDEX = 1;
|
2017-08-16 15:34:21 +00:00
|
|
|
using AspectTag = vtkm::exec::arg::AspectTagFromCount;
|
2015-02-04 22:40:31 +00:00
|
|
|
};
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename FetchTag, typename ConnectivityType, typename ExecObjectType>
|
2017-05-26 17:53:28 +00:00
|
|
|
struct Fetch<FetchTag,
|
|
|
|
vtkm::exec::arg::AspectTagFromCount,
|
|
|
|
vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>,
|
|
|
|
ExecObjectType>
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2017-08-16 15:34:21 +00:00
|
|
|
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>;
|
2015-10-07 18:14:00 +00:00
|
|
|
|
2017-08-16 15:34:21 +00:00
|
|
|
using ValueType = vtkm::IdComponent;
|
2015-02-04 22:40:31 +00:00
|
|
|
|
2015-09-24 14:39:48 +00:00
|
|
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC
|
2017-05-18 14:29:41 +00:00
|
|
|
ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
2015-10-07 18:14:00 +00:00
|
|
|
return indices.GetIndicesFrom().GetNumberOfComponents();
|
2015-02-04 22:40:31 +00:00
|
|
|
}
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC
|
2017-05-18 14:29:41 +00:00
|
|
|
void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const
|
2015-02-04 22:40:31 +00:00
|
|
|
{
|
|
|
|
// Store is a no-op.
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::exec::arg
|
|
|
|
|
2015-08-03 16:06:59 +00:00
|
|
|
#endif //vtk_m_exec_arg_FromCount_h
|