2015-09-23 19:38:49 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2015-09-23 19:38:49 +00:00
|
|
|
// 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_exec_arg_testing_ThreadIndicesTesting_h
|
|
|
|
#define vtk_m_exec_arg_testing_ThreadIndicesTesting_h
|
|
|
|
|
|
|
|
#include <vtkm/Types.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace exec
|
|
|
|
{
|
|
|
|
namespace arg
|
|
|
|
{
|
2015-09-23 19:38:49 +00:00
|
|
|
|
|
|
|
/// \brief Simplified version of ThreadIndices for unit testing purposes
|
|
|
|
///
|
|
|
|
class ThreadIndicesTesting
|
|
|
|
{
|
|
|
|
public:
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2015-09-23 19:38:49 +00:00
|
|
|
ThreadIndicesTesting(vtkm::Id index)
|
2017-05-18 14:29:41 +00:00
|
|
|
: InputIndex(index)
|
|
|
|
, OutputIndex(index)
|
|
|
|
, VisitIndex(0)
|
|
|
|
{
|
|
|
|
}
|
2015-09-23 19:38:49 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
ThreadIndicesTesting(vtkm::Id inputIndex, vtkm::Id outputIndex, vtkm::IdComponent visitIndex)
|
|
|
|
: InputIndex(inputIndex)
|
|
|
|
, OutputIndex(outputIndex)
|
|
|
|
, VisitIndex(visitIndex)
|
|
|
|
{
|
|
|
|
}
|
2015-09-23 19:38:49 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2015-09-23 19:38:49 +00:00
|
|
|
vtkm::Id GetInputIndex() const { return this->InputIndex; }
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
vtkm::Id3 GetInputIndex3D() const { return vtkm::Id3(this->GetInputIndex(), 0, 0); }
|
2015-09-23 19:38:49 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2015-09-23 19:38:49 +00:00
|
|
|
vtkm::Id GetOutputIndex() const { return this->OutputIndex; }
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2015-09-23 19:38:49 +00:00
|
|
|
vtkm::IdComponent GetVisitIndex() const { return this->VisitIndex; }
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_EXEC_CONT
|
2020-03-23 20:27:00 +00:00
|
|
|
vtkm::Id GetThreadIndex() const { return this->OutputIndex; }
|
2016-08-18 03:33:04 +00:00
|
|
|
|
2015-09-23 19:38:49 +00:00
|
|
|
private:
|
|
|
|
vtkm::Id InputIndex;
|
|
|
|
vtkm::Id OutputIndex;
|
|
|
|
vtkm::IdComponent VisitIndex;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::exec::arg
|
|
|
|
|
|
|
|
#endif //vtk_m_exec_arg_testing_ThreadIndicesTesting_h
|