mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Merge topic 'refactor-workletinvokerfunctordetail-generalize-returntypes'
6c7855aed relax ThreadIndicesType requirements for WorkletInvokeFunctorDetail Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !2035
This commit is contained in:
commit
a2c51a3dc7
@ -36,23 +36,24 @@ struct Fetch<vtkm::exec::arg::FetchTagArrayDirectOut,
|
|||||||
ThreadIndicesType,
|
ThreadIndicesType,
|
||||||
ExecObjectType>
|
ExecObjectType>
|
||||||
{
|
{
|
||||||
using ValueType = typename ExecObjectType::ValueType;
|
|
||||||
|
|
||||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC
|
VTKM_EXEC
|
||||||
ValueType Load(const ThreadIndicesType&, const ExecObjectType&) const
|
auto Load(const ThreadIndicesType&, const ExecObjectType&) ->
|
||||||
|
typename ExecObjectType::ValueType const
|
||||||
{
|
{
|
||||||
// Load is a no-op for this fetch.
|
// Load is a no-op for this fetch.
|
||||||
|
using ValueType = typename ExecObjectType::ValueType;
|
||||||
return ValueType();
|
return ValueType();
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC
|
template <typename T>
|
||||||
void Store(const ThreadIndicesType& indices,
|
VTKM_EXEC void Store(const ThreadIndicesType& indices,
|
||||||
const ExecObjectType& arrayPortal,
|
const ExecObjectType& arrayPortal,
|
||||||
const ValueType& value) const
|
const T& value) const
|
||||||
{
|
{
|
||||||
arrayPortal.Set(indices.GetOutputIndex(), value);
|
using ValueType = typename ExecObjectType::ValueType;
|
||||||
|
arrayPortal.Set(indices.GetOutputIndex(), static_cast<ValueType>(value));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -201,7 +201,7 @@ $for(param_index in range(1, num_params+1))\
|
|||||||
using FetchInfo$(param_index) = InvocationToFetch<ThreadIndicesType, Invocation, $(param_index)>;
|
using FetchInfo$(param_index) = InvocationToFetch<ThreadIndicesType, Invocation, $(param_index)>;
|
||||||
using FetchType$(param_index) = typename FetchInfo$(param_index)::type;
|
using FetchType$(param_index) = typename FetchInfo$(param_index)::type;
|
||||||
FetchType$(param_index) fetch$(param_index);
|
FetchType$(param_index) fetch$(param_index);
|
||||||
typename FetchType$(param_index)::ValueType $pname(param_index) =
|
auto $pname(param_index) =
|
||||||
fetch$(param_index).Load(threadIndices, FetchInfo$(param_index)::GetParameter(invocation));
|
fetch$(param_index).Load(threadIndices, FetchInfo$(param_index)::GetParameter(invocation));
|
||||||
$endfor\
|
$endfor\
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ $endfor\
|
|||||||
// that the types of the worklet operator() parameters match those in the
|
// that the types of the worklet operator() parameters match those in the
|
||||||
// ExecutionSignature. The compiler error might help you narrow down which
|
// ExecutionSignature. The compiler error might help you narrow down which
|
||||||
// parameter is wrong and the types that did not match.
|
// parameter is wrong and the types that did not match.
|
||||||
auto $pname(0) = typename ReturnFetchType::ValueType(worklet($arg_list(num_params)));
|
auto $pname(0) = worklet($arg_list(num_params));
|
||||||
|
|
||||||
$for(param_index in range(1, num_params+1))\
|
$for(param_index in range(1, num_params+1))\
|
||||||
fetch$(param_index).Store(threadIndices, FetchInfo$(param_index)::GetParameter(invocation), $pname(param_index));
|
fetch$(param_index).Store(threadIndices, FetchInfo$(param_index)::GetParameter(invocation), $pname(param_index));
|
||||||
@ -262,7 +262,7 @@ $for(param_index in range(1, num_params+1))\
|
|||||||
using FetchInfo$(param_index) = InvocationToFetch<ThreadIndicesType, Invocation, $(param_index)>;
|
using FetchInfo$(param_index) = InvocationToFetch<ThreadIndicesType, Invocation, $(param_index)>;
|
||||||
using FetchType$(param_index) = typename FetchInfo$(param_index)::type;
|
using FetchType$(param_index) = typename FetchInfo$(param_index)::type;
|
||||||
FetchType$(param_index) fetch$(param_index);
|
FetchType$(param_index) fetch$(param_index);
|
||||||
typename FetchType$(param_index)::ValueType $pname(param_index) =
|
auto $pname(param_index) =
|
||||||
fetch$(param_index).Load(threadIndices, FetchInfo$(param_index)::GetParameter(invocation));
|
fetch$(param_index).Load(threadIndices, FetchInfo$(param_index)::GetParameter(invocation));
|
||||||
$endfor\
|
$endfor\
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user