Commit d9c51d65 authored by Matthew Letter's avatar Matthew Letter
Browse files

increased the number of arguments to worklets

increase the number of arguments to worklets that we support to 10 from 20.
parent 96c22747
......@@ -38,7 +38,7 @@
#include <vtkm/exec/arg/Fetch.h>
#if VTKM_MAX_FUNCTION_PARAMETERS != 10
#if VTKM_MAX_FUNCTION_PARAMETERS != 20
#error Mismatch of maximum parameters between FunctionInterfaceDatailPre.h.in and WorkletInvokeFunctorDetail.h.in
#endif
......@@ -2133,6 +2133,4256 @@ VTKM_EXEC void DoWorkletInvokeFunctor(
p10);
}
template <typename WorkletType,
typename ParameterInterface,
typename ControlInterface,
vtkm::IdComponent InputDomainIndex,
typename OutputToInputMapType,
typename VisitArrayType,
typename ThreadIndicesType,
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
VTKM_EXEC void DoWorkletInvokeFunctor(
const WorkletType& worklet,
const vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>& invocation,
const ThreadIndicesType& threadIndices)
{
using Invocation = vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>;
using FetchInfo1 = InvocationToFetch<ThreadIndicesType, Invocation, 1>;
using FetchType1 = typename FetchInfo1::type;
FetchType1 fetch1;
typename FetchType1::ValueType p1 =
fetch1.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>());
using FetchInfo2 = InvocationToFetch<ThreadIndicesType, Invocation, 2>;
using FetchType2 = typename FetchInfo2::type;
FetchType2 fetch2;
typename FetchType2::ValueType p2 =
fetch2.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>());
using FetchInfo3 = InvocationToFetch<ThreadIndicesType, Invocation, 3>;
using FetchType3 = typename FetchInfo3::type;
FetchType3 fetch3;
typename FetchType3::ValueType p3 =
fetch3.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex>());
using FetchInfo4 = InvocationToFetch<ThreadIndicesType, Invocation, 4>;
using FetchType4 = typename FetchInfo4::type;
FetchType4 fetch4;
typename FetchType4::ValueType p4 =
fetch4.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo4::ControlParameterIndex>());
using FetchInfo5 = InvocationToFetch<ThreadIndicesType, Invocation, 5>;
using FetchType5 = typename FetchInfo5::type;
FetchType5 fetch5;
typename FetchType5::ValueType p5 =
fetch5.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo5::ControlParameterIndex>());
using FetchInfo6 = InvocationToFetch<ThreadIndicesType, Invocation, 6>;
using FetchType6 = typename FetchInfo6::type;
FetchType6 fetch6;
typename FetchType6::ValueType p6 =
fetch6.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo6::ControlParameterIndex>());
using FetchInfo7 = InvocationToFetch<ThreadIndicesType, Invocation, 7>;
using FetchType7 = typename FetchInfo7::type;
FetchType7 fetch7;
typename FetchType7::ValueType p7 =
fetch7.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo7::ControlParameterIndex>());
using FetchInfo8 = InvocationToFetch<ThreadIndicesType, Invocation, 8>;
using FetchType8 = typename FetchInfo8::type;
FetchType8 fetch8;
typename FetchType8::ValueType p8 =
fetch8.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo8::ControlParameterIndex>());
using FetchInfo9 = InvocationToFetch<ThreadIndicesType, Invocation, 9>;
using FetchType9 = typename FetchInfo9::type;
FetchType9 fetch9;
typename FetchType9::ValueType p9 =
fetch9.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo9::ControlParameterIndex>());
using FetchInfo10 = InvocationToFetch<ThreadIndicesType, Invocation, 10>;
using FetchType10 = typename FetchInfo10::type;
FetchType10 fetch10;
typename FetchType10::ValueType p10 =
fetch10.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo10::ControlParameterIndex>());
using FetchInfo11 = InvocationToFetch<ThreadIndicesType, Invocation, 11>;
using FetchType11 = typename FetchInfo11::type;
FetchType11 fetch11;
typename FetchType11::ValueType p11 =
fetch11.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo11::ControlParameterIndex>());
using FetchInfo0 = InvocationToFetch<ThreadIndicesType, Invocation, 0>;
using ReturnFetchType = typename FetchInfo0::type;
ReturnFetchType returnFetch;
// If you got a compile error on the following line, it probably means that
// the operator() of a worklet does not match the definition expected. One
// common problem is that the operator() method must be declared const. Check
// to make sure the "const" keyword is after parameters. Another common
// problem is that the type of one or more parameters is incompatible with
// the actual type that VTK-m creates in the execution environment. Make sure
// that the types of the worklet operator() parameters match those in the
// ExecutionSignature. The compiler error might help you narrow down which
// parameter is wrong and the types that did not match.
auto r = typename ReturnFetchType::ValueType(worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11));
returnFetch.Store(
threadIndices,
invocation.Parameters.template GetParameter<FetchInfo0::ControlParameterIndex>(),
r);
fetch1.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>(),
p1);
fetch2.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>(),
p2);
fetch3.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex>(),
p3);
fetch4.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo4::ControlParameterIndex>(),
p4);
fetch5.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo5::ControlParameterIndex>(),
p5);
fetch6.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo6::ControlParameterIndex>(),
p6);
fetch7.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo7::ControlParameterIndex>(),
p7);
fetch8.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo8::ControlParameterIndex>(),
p8);
fetch9.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo9::ControlParameterIndex>(),
p9);
fetch10.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo10::ControlParameterIndex>(),
p10);
fetch11.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo11::ControlParameterIndex>(),
p11);
}
template <typename WorkletType,
typename ParameterInterface,
typename ControlInterface,
vtkm::IdComponent InputDomainIndex,
typename OutputToInputMapType,
typename VisitArrayType,
typename ThreadIndicesType,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
VTKM_EXEC void DoWorkletInvokeFunctor(
const WorkletType& worklet,
const vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<void(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>& invocation,
const ThreadIndicesType& threadIndices)
{
typedef vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<void(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>
Invocation;
using FetchInfo1 = InvocationToFetch<ThreadIndicesType, Invocation, 1>;
using FetchType1 = typename FetchInfo1::type;
FetchType1 fetch1;
typename FetchType1::ValueType p1 =
fetch1.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>());
using FetchInfo2 = InvocationToFetch<ThreadIndicesType, Invocation, 2>;
using FetchType2 = typename FetchInfo2::type;
FetchType2 fetch2;
typename FetchType2::ValueType p2 =
fetch2.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>());
using FetchInfo3 = InvocationToFetch<ThreadIndicesType, Invocation, 3>;
using FetchType3 = typename FetchInfo3::type;
FetchType3 fetch3;
typename FetchType3::ValueType p3 =
fetch3.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex>());
using FetchInfo4 = InvocationToFetch<ThreadIndicesType, Invocation, 4>;
using FetchType4 = typename FetchInfo4::type;
FetchType4 fetch4;
typename FetchType4::ValueType p4 =
fetch4.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo4::ControlParameterIndex>());
using FetchInfo5 = InvocationToFetch<ThreadIndicesType, Invocation, 5>;
using FetchType5 = typename FetchInfo5::type;
FetchType5 fetch5;
typename FetchType5::ValueType p5 =
fetch5.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo5::ControlParameterIndex>());
using FetchInfo6 = InvocationToFetch<ThreadIndicesType, Invocation, 6>;
using FetchType6 = typename FetchInfo6::type;
FetchType6 fetch6;
typename FetchType6::ValueType p6 =
fetch6.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo6::ControlParameterIndex>());
using FetchInfo7 = InvocationToFetch<ThreadIndicesType, Invocation, 7>;
using FetchType7 = typename FetchInfo7::type;
FetchType7 fetch7;
typename FetchType7::ValueType p7 =
fetch7.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo7::ControlParameterIndex>());
using FetchInfo8 = InvocationToFetch<ThreadIndicesType, Invocation, 8>;
using FetchType8 = typename FetchInfo8::type;
FetchType8 fetch8;
typename FetchType8::ValueType p8 =
fetch8.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo8::ControlParameterIndex>());
using FetchInfo9 = InvocationToFetch<ThreadIndicesType, Invocation, 9>;
using FetchType9 = typename FetchInfo9::type;
FetchType9 fetch9;
typename FetchType9::ValueType p9 =
fetch9.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo9::ControlParameterIndex>());
using FetchInfo10 = InvocationToFetch<ThreadIndicesType, Invocation, 10>;
using FetchType10 = typename FetchInfo10::type;
FetchType10 fetch10;
typename FetchType10::ValueType p10 =
fetch10.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo10::ControlParameterIndex>());
using FetchInfo11 = InvocationToFetch<ThreadIndicesType, Invocation, 11>;
using FetchType11 = typename FetchInfo11::type;
FetchType11 fetch11;
typename FetchType11::ValueType p11 =
fetch11.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo11::ControlParameterIndex>());
// If you got a compile error on the following line, it probably means that
// the operator() of a worklet does not match the definition expected. One
// common problem is that the operator() method must be declared const. Check
// to make sure the "const" keyword is after parameters. Another common
// problem is that the type of one or more parameters is incompatible with
// the actual type that VTK-m creates in the execution environment. Make sure
// that the types of the worklet operator() parameters match those in the
// ExecutionSignature. The compiler error might help you narrow down which
// parameter is wrong and the types that did not match.
worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
fetch1.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>(),
p1);
fetch2.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>(),
p2);
fetch3.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex>(),
p3);
fetch4.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo4::ControlParameterIndex>(),
p4);
fetch5.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo5::ControlParameterIndex>(),
p5);
fetch6.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo6::ControlParameterIndex>(),
p6);
fetch7.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo7::ControlParameterIndex>(),
p7);
fetch8.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo8::ControlParameterIndex>(),
p8);
fetch9.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo9::ControlParameterIndex>(),
p9);
fetch10.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo10::ControlParameterIndex>(),
p10);
fetch11.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo11::ControlParameterIndex>(),
p11);
}
template <typename WorkletType,
typename ParameterInterface,
typename ControlInterface,
vtkm::IdComponent InputDomainIndex,
typename OutputToInputMapType,
typename VisitArrayType,
typename ThreadIndicesType,
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
VTKM_EXEC void DoWorkletInvokeFunctor(
const WorkletType& worklet,
const vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>& invocation,
const ThreadIndicesType& threadIndices)
{
using Invocation = vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>;
using FetchInfo1 = InvocationToFetch<ThreadIndicesType, Invocation, 1>;
using FetchType1 = typename FetchInfo1::type;
FetchType1 fetch1;
typename FetchType1::ValueType p1 =
fetch1.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>());
using FetchInfo2 = InvocationToFetch<ThreadIndicesType, Invocation, 2>;
using FetchType2 = typename FetchInfo2::type;
FetchType2 fetch2;
typename FetchType2::ValueType p2 =
fetch2.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>());
using FetchInfo3 = InvocationToFetch<ThreadIndicesType, Invocation, 3>;
using FetchType3 = typename FetchInfo3::type;
FetchType3 fetch3;
typename FetchType3::ValueType p3 =
fetch3.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex>());
using FetchInfo4 = InvocationToFetch<ThreadIndicesType, Invocation, 4>;
using FetchType4 = typename FetchInfo4::type;
FetchType4 fetch4;
typename FetchType4::ValueType p4 =
fetch4.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo4::ControlParameterIndex>());
using FetchInfo5 = InvocationToFetch<ThreadIndicesType, Invocation, 5>;
using FetchType5 = typename FetchInfo5::type;
FetchType5 fetch5;
typename FetchType5::ValueType p5 =
fetch5.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo5::ControlParameterIndex>());
using FetchInfo6 = InvocationToFetch<ThreadIndicesType, Invocation, 6>;
using FetchType6 = typename FetchInfo6::type;
FetchType6 fetch6;
typename FetchType6::ValueType p6 =
fetch6.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo6::ControlParameterIndex>());
using FetchInfo7 = InvocationToFetch<ThreadIndicesType, Invocation, 7>;
using FetchType7 = typename FetchInfo7::type;
FetchType7 fetch7;
typename FetchType7::ValueType p7 =
fetch7.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo7::ControlParameterIndex>());
using FetchInfo8 = InvocationToFetch<ThreadIndicesType, Invocation, 8>;
using FetchType8 = typename FetchInfo8::type;
FetchType8 fetch8;
typename FetchType8::ValueType p8 =
fetch8.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo8::ControlParameterIndex>());
using FetchInfo9 = InvocationToFetch<ThreadIndicesType, Invocation, 9>;
using FetchType9 = typename FetchInfo9::type;
FetchType9 fetch9;
typename FetchType9::ValueType p9 =
fetch9.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo9::ControlParameterIndex>());
using FetchInfo10 = InvocationToFetch<ThreadIndicesType, Invocation, 10>;
using FetchType10 = typename FetchInfo10::type;
FetchType10 fetch10;
typename FetchType10::ValueType p10 =
fetch10.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo10::ControlParameterIndex>());
using FetchInfo11 = InvocationToFetch<ThreadIndicesType, Invocation, 11>;
using FetchType11 = typename FetchInfo11::type;
FetchType11 fetch11;
typename FetchType11::ValueType p11 =
fetch11.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo11::ControlParameterIndex>());
using FetchInfo12 = InvocationToFetch<ThreadIndicesType, Invocation, 12>;
using FetchType12 = typename FetchInfo12::type;
FetchType12 fetch12;
typename FetchType12::ValueType p12 =
fetch12.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo12::ControlParameterIndex>());
using FetchInfo0 = InvocationToFetch<ThreadIndicesType, Invocation, 0>;
using ReturnFetchType = typename FetchInfo0::type;
ReturnFetchType returnFetch;
// If you got a compile error on the following line, it probably means that
// the operator() of a worklet does not match the definition expected. One
// common problem is that the operator() method must be declared const. Check
// to make sure the "const" keyword is after parameters. Another common
// problem is that the type of one or more parameters is incompatible with
// the actual type that VTK-m creates in the execution environment. Make sure
// that the types of the worklet operator() parameters match those in the
// ExecutionSignature. The compiler error might help you narrow down which
// parameter is wrong and the types that did not match.
auto r = typename ReturnFetchType::ValueType(worklet(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12));
returnFetch.Store(
threadIndices,
invocation.Parameters.template GetParameter<FetchInfo0::ControlParameterIndex>(),
r);
fetch1.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>(),
p1);
fetch2.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>(),
p2);
fetch3.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex>(),
p3);
fetch4.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo4::ControlParameterIndex>(),
p4);
fetch5.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo5::ControlParameterIndex>(),
p5);
fetch6.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo6::ControlParameterIndex>(),
p6);
fetch7.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo7::ControlParameterIndex>(),
p7);
fetch8.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo8::ControlParameterIndex>(),
p8);
fetch9.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo9::ControlParameterIndex>(),
p9);
fetch10.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo10::ControlParameterIndex>(),
p10);
fetch11.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo11::ControlParameterIndex>(),
p11);
fetch12.Store(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo12::ControlParameterIndex>(),
p12);
}
template <typename WorkletType,
typename ParameterInterface,
typename ControlInterface,
vtkm::IdComponent InputDomainIndex,
typename OutputToInputMapType,
typename VisitArrayType,
typename ThreadIndicesType,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
VTKM_EXEC void DoWorkletInvokeFunctor(
const WorkletType& worklet,
const vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<void(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>& invocation,
const ThreadIndicesType& threadIndices)
{
typedef vtkm::internal::Invocation<ParameterInterface,
ControlInterface,
vtkm::internal::FunctionInterface<void(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12)>,
InputDomainIndex,
OutputToInputMapType,
VisitArrayType>
Invocation;
using FetchInfo1 = InvocationToFetch<ThreadIndicesType, Invocation, 1>;
using FetchType1 = typename FetchInfo1::type;
FetchType1 fetch1;
typename FetchType1::ValueType p1 =
fetch1.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo1::ControlParameterIndex>());
using FetchInfo2 = InvocationToFetch<ThreadIndicesType, Invocation, 2>;
using FetchType2 = typename FetchInfo2::type;
FetchType2 fetch2;
typename FetchType2::ValueType p2 =
fetch2.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo2::ControlParameterIndex>());
using FetchInfo3 = InvocationToFetch<ThreadIndicesType, Invocation, 3>;
using FetchType3 = typename FetchInfo3::type;
FetchType3 fetch3;
typename FetchType3::ValueType p3 =
fetch3.Load(threadIndices,
invocation.Parameters.template GetParameter<FetchInfo3::ControlParameterIndex