mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +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,
|
||||
ExecObjectType>
|
||||
{
|
||||
using ValueType = typename ExecObjectType::ValueType;
|
||||
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
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.
|
||||
using ValueType = typename ExecObjectType::ValueType;
|
||||
return ValueType();
|
||||
}
|
||||
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
VTKM_EXEC
|
||||
void Store(const ThreadIndicesType& indices,
|
||||
const ExecObjectType& arrayPortal,
|
||||
const ValueType& value) const
|
||||
template <typename T>
|
||||
VTKM_EXEC void Store(const ThreadIndicesType& indices,
|
||||
const ExecObjectType& arrayPortal,
|
||||
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 FetchType$(param_index) = typename FetchInfo$(param_index)::type;
|
||||
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));
|
||||
$endfor\
|
||||
|
||||
@ -217,7 +217,7 @@ $endfor\
|
||||
// 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 $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))\
|
||||
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 FetchType$(param_index) = typename FetchInfo$(param_index)::type;
|
||||
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));
|
||||
$endfor\
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user