relax ThreadIndicesType requirements for WorkletInvokeFunctorDetail

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
This commit is contained in:
Vicente Adolfo Bolea Sanchez 2020-04-10 11:22:06 -04:00
parent b605c3bd8a
commit 6c7855aed8
3 changed files with 452 additions and 451 deletions

@ -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\