Commit 28b86692 authored by Kenneth Moreland's avatar Kenneth Moreland

Merge branch 'reduce-by-key-worklet' into 'master'

Reduce by Key Worklet Type

See merge request !645
parents 503bebda d6eb477a
......@@ -27,6 +27,11 @@ set(headers
TransportTagAtomicArray.h
TransportTagCellSetIn.h
TransportTagExecObject.h
TransportTagKeyedValuesIn.h
TransportTagKeyedValuesInOut.h
TransportTagKeyedValuesOut.h
TransportTagKeysIn.h
TransportTagReducedValuesIn.h
TransportTagTopologyFieldIn.h
TransportTagWholeArrayIn.h
TransportTagWholeArrayInOut.h
......@@ -36,6 +41,7 @@ set(headers
TypeCheckTagAtomicArray.h
TypeCheckTagCellSet.h
TypeCheckTagExecObject.h
TypeCheckTagKeys.h
)
vtkm_declare_headers(${headers})
......
//============================================================================
// 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 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_cont_arg_TransportTagKeyedValuesIn_h
#define vtk_m_cont_arg_TransportTagKeyedValuesIn_h
#include <vtkm/cont/arg/Transport.h>
namespace vtkm {
namespace cont {
namespace arg {
/// \brief \c Transport tag for input values in a reduce by key.
///
/// \c TransportTagKeyedValuesIn is a tag used with the \c Transport class to
/// transport \c ArrayHandle objects for input values. The values are
/// rearranged and grouped based on the keys they are associated with.
///
struct TransportTagKeyedValuesIn { };
// Specialization of Transport class for TransportTagKeyedValuesIn is
// implemented in vtkm/worklet/Keys.h. That class is not accessible from here
// due to VTK-m package dependencies.
}
}
}
#endif //vtk_m_cont_arg_TransportTagKeyedValuesIn_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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_cont_arg_TransportTagKeyedValuesInOut_h
#define vtk_m_cont_arg_TransportTagKeyedValuesInOut_h
#include <vtkm/cont/arg/Transport.h>
namespace vtkm {
namespace cont {
namespace arg {
/// \brief \c Transport tag for input values in a reduce by key.
///
/// \c TransportTagKeyedValuesInOut is a tag used with the \c Transport class
/// to transport \c ArrayHandle objects for input/output values. The values are
/// rearranged and grouped based on the keys they are associated with.
///
struct TransportTagKeyedValuesInOut { };
// Specialization of Transport class for TransportTagKeyedValuesInOut is
// implemented in vtkm/worklet/Keys.h. That class is not accessible from here
// due to VTK-m package dependencies.
}
}
}
#endif //vtk_m_cont_arg_TransportTagKeyedValuesInOut_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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_cont_arg_TransportTagKeyedValuesOut_h
#define vtk_m_cont_arg_TransportTagKeyedValuesOut_h
#include <vtkm/cont/arg/Transport.h>
namespace vtkm {
namespace cont {
namespace arg {
/// \brief \c Transport tag for input values in a reduce by key.
///
/// \c TransportTagKeyedValuesOut is a tag used with the \c Transport class
/// to transport \c ArrayHandle objects for output values. The values are
/// rearranged and grouped based on the keys they are associated with.
///
struct TransportTagKeyedValuesOut { };
// Specialization of Transport class for TransportTagKeyedValuesOut is
// implemented in vtkm/worklet/Keys.h. That class is not accessible from here
// due to VTK-m package dependencies.
}
}
}
#endif //vtk_m_cont_arg_TransportTagKeyedValuesOut_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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_cont_arg_TransportTagKeysIn_h
#define vtk_m_cont_arg_TransportTagKeysIn_h
#include <vtkm/cont/arg/Transport.h>
namespace vtkm {
namespace cont {
namespace arg {
/// \brief \c Transport tag for keys in a reduce by key.
///
/// \c TransportTagKeysIn is a tag used with the \c Transport class to
/// transport vtkm::worklet::Keys objects for the input domain of a
/// reduce by keys worklet.
///
struct TransportTagKeysIn { };
// Specialization of Transport class for TransportTagKeysIn is implemented in
// vtkm/worklet/Keys.h. That class is not accessible from here due to VTK-m
// package dependencies.
}
}
} // namespace vtkm::cont::arg
#endif //vtk_m_cont_arg_TransportTagKeysIn_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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_cont_arg_TransportTagReducedValuesIn_h
#define vtk_m_cont_arg_TransportTagReducedValuesIn_h
#include <vtkm/cont/arg/Transport.h>
namespace vtkm {
namespace cont {
namespace arg {
/// \brief \c Transport tag for input values in a reduce by key.
///
/// \c TransportTagReducedValuesIn is a tag used with the \c Transport class to
/// transport \c ArrayHandle objects for input values that correspond to arrays
/// of reduced values. The values are passed 1-to-1 to the worklet invocations.
///
struct TransportTagReducedValuesIn { };
// Specialization of Transport class for TransportTagReducedValuesIn is
// implemented in vtkm/worklet/Keys.h. That class is not accessible from here
// due to VTK-m package dependencies.
}
}
}
#endif //vtk_m_cont_arg_TransportTagReducedValuesIn_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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_cont_arg_TypeCheckTagKeys_h
#define vtk_m_cont_arg_TypeCheckTagKeys_h
#include <vtkm/cont/arg/TypeCheck.h>
namespace vtkm {
namespace cont {
namespace arg {
/// Check for a Keys object.
///
struct TypeCheckTagKeys
{
};
// A more specific specialization that actually checks for Keys types is
// implemented in vtkm/worklet/Keys.h. That class is not accessible from here
// due to VTK-m package dependencies.
template<typename Type>
struct TypeCheck<TypeCheckTagKeys, Type>
{
static const bool value = false;
};
}
}
} // namespace vtkm::cont::arg
#endif //vtk_m_cont_arg_TypeCheckTagKeys_h
......@@ -29,6 +29,7 @@ set(unit_tests
UnitTestTypeCheckArray.cxx
UnitTestTypeCheckCellSet.cxx
UnitTestTypeCheckExecObject.cxx
UnitTestTypeCheckKeys.cxx
)
vtkm_unit_tests(SOURCES ${unit_tests})
......@@ -32,7 +32,7 @@ struct TestNotCellSet { };
void TestCheckCellSet()
{
std::cout << "Checking reporting of type checking exec object." << std::endl;
std::cout << "Checking reporting of type checking cell set." << std::endl;
using vtkm::cont::arg::TypeCheck;
using vtkm::cont::arg::TypeCheckTagCellSet;
......
//============================================================================
// 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 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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.
//============================================================================
#include <vtkm/cont/arg/TypeCheckTagKeys.h>
#include <vtkm/worklet/Keys.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/testing/Testing.h>
namespace {
struct TestNotKeys { };
void TestCheckKeys()
{
std::cout << "Checking reporting of type checking keys." << std::endl;
using vtkm::cont::arg::TypeCheck;
using vtkm::cont::arg::TypeCheckTagKeys;
VTKM_TEST_ASSERT(
(TypeCheck<TypeCheckTagKeys, vtkm::worklet::Keys<vtkm::Id> >::value),
"Type check failed.");
VTKM_TEST_ASSERT(
(TypeCheck<TypeCheckTagKeys, vtkm::worklet::Keys<vtkm::Float32> >::value),
"Type check failed.");
VTKM_TEST_ASSERT(
(TypeCheck<TypeCheckTagKeys, vtkm::worklet::Keys<vtkm::Id3> >::value),
"Type check failed.");
VTKM_TEST_ASSERT(
!(TypeCheck<TypeCheckTagKeys, TestNotKeys>::value),
"Type check failed.");
VTKM_TEST_ASSERT(
!(TypeCheck<TypeCheckTagKeys, vtkm::Id>::value),
"Type check failed.");
VTKM_TEST_ASSERT(
!(TypeCheck<TypeCheckTagKeys, vtkm::cont::ArrayHandle<vtkm::Id> >::value),
"Type check failed.");
}
} // anonymous namespace
int UnitTestTypeCheckKeys(int, char*[])
{
return vtkm::cont::testing::Testing::Run(TestCheckKeys);
}
......@@ -30,12 +30,15 @@ set(headers
FetchTagArrayTopologyMapIn.h
FetchTagExecObject.h
FetchTagCellSetIn.h
FetchTagKeysIn.h
FetchTagWholeCellSetIn.h
FromCount.h
FromIndices.h
ThreadIndices.h
ThreadIndicesBasic.h
ThreadIndicesReduceByKey.h
ThreadIndicesTopologyMap.h
ValueCount.h
VisitIndex.h
WorkIndex.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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_exec_arg_FetchTagKeysIn_h
#define vtk_m_exec_arg_FetchTagKeysIn_h
#include <vtkm/exec/arg/AspectTagDefault.h>
#include <vtkm/exec/arg/Fetch.h>
#include <vtkm/exec/arg/ThreadIndicesReduceByKey.h>
#include <vtkm/exec/internal/ReduceByKeyLookup.h>
namespace vtkm {
namespace exec {
namespace arg {
/// \brief \c Fetch tag for getting key values in a reduce by key.
///
/// \c FetchTagKeysIn is a tag used with the \c Fetch class to retrieve keys
/// from the input domain of a reduce by keys worklet.
///
struct FetchTagKeysIn { };
template<typename KeyPortalType,
typename IdPortalType,
typename IdComponentPortalType>
struct Fetch<
vtkm::exec::arg::FetchTagKeysIn,
vtkm::exec::arg::AspectTagDefault,
vtkm::exec::arg::ThreadIndicesReduceByKey,
vtkm::exec::internal::ReduceByKeyLookup<
KeyPortalType,IdPortalType,IdComponentPortalType> >
{
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesReduceByKey;
using ExecObjectType =
vtkm::exec::internal::ReduceByKeyLookup<
KeyPortalType,IdPortalType,IdComponentPortalType>;
using ValueType = typename ExecObjectType::KeyType;
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC
ValueType Load(const ThreadIndicesType &indices,
const ExecObjectType &keys) const
{
return keys.UniqueKeys.Get(indices.GetInputIndex());
}
VTKM_EXEC
void Store(const ThreadIndicesType &,
const ExecObjectType &,
const ValueType &) const
{
// Store is a no-op for this fetch.
}
};
}
}
} // namespace vtkm::exec::arg
#endif //vtk_m_exec_arg_FetchTagKeysIn_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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_exec_arg_ThreadIndicesReduceByKey_h
#define vtk_m_exec_arg_ThreadIndicesReduceByKey_h
#include <vtkm/exec/arg/ThreadIndicesBasic.h>
#include <vtkm/exec/internal/ReduceByKeyLookup.h>
namespace vtkm {
namespace exec {
namespace arg {
/// \brief Container for thread indices in a reduce by key invocation.
///
/// This specialization of \c ThreadIndices adds extra indices that deal with a
/// reduce by key. In particular, it save the indices used to map from a unique
/// key index to the group of input values that has that key associated with
/// it.
///
class ThreadIndicesReduceByKey : public vtkm::exec::arg::ThreadIndicesBasic
{
using Superclass = vtkm::exec::arg::ThreadIndicesBasic;
public:
template<typename P1, typename P2, typename P3>
VTKM_EXEC
ThreadIndicesReduceByKey(
vtkm::Id threadIndex,
vtkm::Id inIndex,
vtkm::IdComponent visitIndex,
const vtkm::exec::internal::ReduceByKeyLookup<P1,P2,P3> &keyLookup,
vtkm::Id globalThreadIndexOffset=0)
: Superclass(threadIndex, inIndex, visitIndex, globalThreadIndexOffset),
ValueOffset(keyLookup.Offsets.Get(inIndex)),
NumberOfValues(keyLookup.Counts.Get(inIndex))
{ }
VTKM_EXEC
vtkm::Id GetValueOffset() const
{
return this->ValueOffset;
}
VTKM_EXEC
vtkm::IdComponent GetNumberOfValues() const
{
return this->NumberOfValues;
}
private:
vtkm::Id ValueOffset;
vtkm::IdComponent NumberOfValues;
};
}
}
} // namespace vtkm::exec::arg
#endif //vtk_m_exec_arg_ThreadIndicesReduceByKey_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.
//
// 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_exec_arg_ValueCount_h
#define vtk_m_exec_arg_ValueCount_h
#include <vtkm/exec/arg/Fetch.h>
#include <vtkm/exec/arg/ExecutionSignatureTagBase.h>
#include <vtkm/exec/arg/ThreadIndicesReduceByKey.h>
namespace vtkm {
namespace exec {
namespace arg {
/// \brief Aspect tag to use for getting the value count.
///
/// The \c AspectTagValueCount aspect tag causes the \c Fetch class to obtain
/// the number of values that map to the key.
///
struct AspectTagValueCount { };
/// \brief The \c ExecutionSignature tag to get the number of values.
///
/// A \c WorkletReduceByKey operates by collecting all values associated with
/// identical keys and then giving the worklet a Vec-like object containing all
/// values with a matching key. This \c ExecutionSignature tag provides the
/// number of values associated with the key and given in the Vec-like objects.
///
struct ValueCount : vtkm::exec::arg::ExecutionSignatureTagBase
{
static const vtkm::IdComponent INDEX = 1;
typedef vtkm::exec::arg::AspectTagValueCount AspectTag;
};
template<typename FetchTag,
typename ExecObjectType>
struct Fetch<FetchTag,
vtkm::exec::arg::AspectTagValueCount,
vtkm::exec::arg::ThreadIndicesReduceByKey,
ExecObjectType>
{
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesReduceByKey;
using ValueType = vtkm::IdComponent;
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC
ValueType Load(const ThreadIndicesType &indices, const ExecObjectType &) const
{
return indices.GetNumberOfValues();
}
VTKM_EXEC
void Store(const ThreadIndicesType &,
const ExecObjectType &,
const ValueType &) const
{
// Store is a no-op.
}
};
}
}
} // namespace vtkm::exec::arg
#endif //vtk_m_exec_arg_ValueCount_h
......@@ -20,6 +20,7 @@
set(headers
ErrorMessageBuffer.h
ReduceByKeyLookup.h
WorkletInvokeFunctor.h
WorkletInvokeFunctorDetail.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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 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_exec_internal_ReduceByKeyLookup_h
#define vtk_m_exec_internal_ReduceByKeyLookup_h
#include <vtkm/exec/ExecutionObjectBase.h>
#include <vtkm/StaticAssert.h>
#include <vtkm/Types.h>
#include <type_traits>
namespace vtkm {
namespace exec {
namespace internal {
/// \breif Execution object holding lookup info for reduce by key.
///
/// A WorkletReduceByKey needs several arrays to map the current output object
/// to the respective key and group of values. This execution object holds that
/// state.
///
template<typename KeyPortalType,
typename IdPortalType,
typename IdComponentPortalType>
struct ReduceByKeyLookup : vtkm::exec::ExecutionObjectBase
{
using KeyType = typename KeyPortalType::ValueType;
VTKM_STATIC_ASSERT(
(std::is_same<typename IdPortalType::ValueType, vtkm::Id>::value));
VTKM_STATIC_ASSERT(
(std::is_same<typename IdComponentPortalType::ValueType, vtkm::IdComponent>::value));
KeyPortalType UniqueKeys;
IdPortalType SortedValuesMap;
IdPortalType Offsets;
IdComponentPortalType Counts;
VTKM_EXEC_CONT
ReduceByKeyLookup(const KeyPortalType &uniqueKeys,
const IdPortalType &sortedValuesMap,
const IdPortalType &offsets,
const IdComponentPortalType &counts)
: UniqueKeys(uniqueKeys),
SortedValuesMap(sortedValuesMap),
Offsets(offsets),
Counts(counts)
{ }
VTKM_EXEC_CONT
ReduceByKeyLookup()
{ }
};
}
}
} // namespace vtkm::exec::internal
#endif //vtk_m_exec_internal_ReduceByKeyLookup_h
......@@ -541,7 +541,14 @@ template<typename T>
static inline VTKM_EXEC_CONT
T TestValue(vtkm::Id index, T, vtkm::TypeTraitsIntegerTag)
{
return T(index*100);
if (sizeof(T) > 2)
{
return T(index*100);
}
else
{
return T(index+100);