diff --git a/vtkm/cont/Algorithm.h b/vtkm/cont/Algorithm.h index ac61d6d9f..a8ca86d0c 100644 --- a/vtkm/cont/Algorithm.h +++ b/vtkm/cont/Algorithm.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -26,15 +27,16 @@ namespace cont namespace detail { template -inline auto DoPrepareArgForExec(T&& object, std::true_type) +inline auto DoPrepareArgForExec(T&& object, vtkm::cont::Token& token, std::true_type) -> decltype(std::declval().PrepareForExecution(Device())) { VTKM_IS_EXECUTION_OBJECT(T); + return vtkm::cont::internal::CallPrepareForExecution(object, Device{}, token); return object.PrepareForExecution(Device{}); } template -inline T&& DoPrepareArgForExec(T&& object, std::false_type) +inline T&& DoPrepareArgForExec(T&& object, vtkm::cont::Token&, std::false_type) { static_assert(!vtkm::cont::internal::IsExecutionObjectBase::value, "Internal error: failed to detect execution object."); @@ -42,12 +44,13 @@ inline T&& DoPrepareArgForExec(T&& object, std::false_type) } template -auto PrepareArgForExec(T&& object) +auto PrepareArgForExec(T&& object, vtkm::cont::Token& token) -> decltype(DoPrepareArgForExec(std::forward(object), + token, vtkm::cont::internal::IsExecutionObjectBase{})) { - return DoPrepareArgForExec(std::forward(object), - vtkm::cont::internal::IsExecutionObjectBase{}); + return DoPrepareArgForExec( + std::forward(object), token, vtkm::cont::internal::IsExecutionObjectBase{}); } struct BitFieldToUnorderedSetFunctor @@ -58,8 +61,9 @@ struct BitFieldToUnorderedSetFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; this->Result = vtkm::cont::DeviceAdapterAlgorithm::BitFieldToUnorderedSet( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -70,8 +74,9 @@ struct CopyFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::Copy( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -83,8 +88,9 @@ struct CopyIfFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::CopyIf( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -102,8 +108,9 @@ struct CopySubRangeFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; valid = vtkm::cont::DeviceAdapterAlgorithm::CopySubRange( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -115,8 +122,10 @@ struct CountSetBitsFunctor template VTKM_CONT bool operator()(Device, Args&&... args) { + VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; this->PopCount = vtkm::cont::DeviceAdapterAlgorithm::CountSetBits( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -126,8 +135,10 @@ struct FillFunctor template VTKM_CONT bool operator()(Device, Args&&... args) { + VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::Fill( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -139,8 +150,9 @@ struct LowerBoundsFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::LowerBounds( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -159,8 +171,9 @@ struct ReduceFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; result = vtkm::cont::DeviceAdapterAlgorithm::Reduce( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -171,8 +184,9 @@ struct ReduceByKeyFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::ReduceByKey( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -191,8 +205,9 @@ struct ScanInclusiveResultFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; result = vtkm::cont::DeviceAdapterAlgorithm::ScanInclusive( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -275,8 +290,9 @@ struct ScanInclusiveByKeyFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::ScanInclusiveByKey( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -295,8 +311,9 @@ struct ScanExclusiveFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; result = vtkm::cont::DeviceAdapterAlgorithm::ScanExclusive( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -309,8 +326,9 @@ struct ScanExclusiveByKeyFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::ScanExclusiveByKey( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -322,8 +340,9 @@ struct ScanExtendedFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::ScanExtended( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -334,8 +353,9 @@ struct ScheduleFunctor VTKM_CONT bool operator()(Device, Args&&... args) { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::Schedule( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -346,8 +366,9 @@ struct SortFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::Sort( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -358,8 +379,9 @@ struct SortByKeyFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::SortByKey( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -381,8 +403,9 @@ struct TransformFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::Transform( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -393,8 +416,9 @@ struct UniqueFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::Unique( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; @@ -405,8 +429,9 @@ struct UpperBoundsFunctor VTKM_CONT bool operator()(Device, Args&&... args) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); + vtkm::cont::Token token; vtkm::cont::DeviceAdapterAlgorithm::UpperBounds( - PrepareArgForExec(std::forward(args))...); + PrepareArgForExec(std::forward(args), token)...); return true; } }; diff --git a/vtkm/cont/ArrayHandle.hxx b/vtkm/cont/ArrayHandle.hxx index 06ac728e5..3b03c9cc3 100644 --- a/vtkm/cont/ArrayHandle.hxx +++ b/vtkm/cont/ArrayHandle.hxx @@ -235,7 +235,7 @@ ArrayHandle::PrepareForInput(DeviceAdapterTag device, vtkm::cont::Token& t this->PrepareForDevice(lock, device); auto portal = this->Internals->GetExecutionArray(lock)->PrepareForInput( - !this->Internals->IsExecutionArrayValid(lock), device); + !this->Internals->IsExecutionArrayValid(lock), device, token); this->Internals->SetExecutionArrayValid(lock, true); @@ -263,7 +263,8 @@ ArrayHandle::PrepareForOutput(vtkm::Id numberOfValues, this->Internals->SetControlArrayValid(lock, false); this->PrepareForDevice(lock, device); - auto portal = this->Internals->GetExecutionArray(lock)->PrepareForOutput(numberOfValues, device); + auto portal = + this->Internals->GetExecutionArray(lock)->PrepareForOutput(numberOfValues, device, token); // We are assuming that the calling code will fill the array using the // iterators we are returning, so go ahead and mark the execution array as @@ -302,7 +303,7 @@ ArrayHandle::PrepareForInPlace(DeviceAdapterTag device, vtkm::cont::Token& this->PrepareForDevice(lock, device); auto portal = this->Internals->GetExecutionArray(lock)->PrepareForInPlace( - !this->Internals->IsExecutionArrayValid(lock), device); + !this->Internals->IsExecutionArrayValid(lock), device, token); this->Internals->SetExecutionArrayValid(lock, true); diff --git a/vtkm/cont/ArrayHandleBitField.h b/vtkm/cont/ArrayHandleBitField.h index 2676afe89..bf02db63d 100644 --- a/vtkm/cont/ArrayHandleBitField.h +++ b/vtkm/cont/ArrayHandleBitField.h @@ -129,21 +129,21 @@ public: vtkm::Id GetNumberOfValues() const { return this->Data.GetNumberOfBits(); } VTKM_CONT - PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) + PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData), vtkm::cont::Token& token) { - return PortalConstExecution{ this->Data.PrepareForInput(Device{}) }; + return PortalConstExecution{ this->Data.PrepareForInput(Device{}, token) }; } VTKM_CONT - PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) + PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData), vtkm::cont::Token& token) { - return PortalExecution{ this->Data.PrepareForInPlace(Device{}) }; + return PortalExecution{ this->Data.PrepareForInPlace(Device{}, token) }; } VTKM_CONT - PortalExecution PrepareForOutput(vtkm::Id numberOfValues) + PortalExecution PrepareForOutput(vtkm::Id numberOfValues, vtkm::cont::Token& token) { - return PortalExecution{ this->Data.PrepareForOutput(numberOfValues, Device{}) }; + return PortalExecution{ this->Data.PrepareForOutput(numberOfValues, Device{}, token) }; } VTKM_CONT diff --git a/vtkm/cont/ArrayHandleCartesianProduct.h b/vtkm/cont/ArrayHandleCartesianProduct.h index 9c6d84b6d..27b9f034e 100644 --- a/vtkm/cont/ArrayHandleCartesianProduct.h +++ b/vtkm/cont/ArrayHandleCartesianProduct.h @@ -14,6 +14,7 @@ #include #include +#include namespace vtkm { @@ -336,7 +337,7 @@ public: } VTKM_CONT - PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) + PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData), vtkm::cont::Token&) { return PortalConstExecution(this->FirstArray.PrepareForInput(Device()), this->SecondArray.PrepareForInput(Device()), @@ -344,7 +345,7 @@ public: } VTKM_CONT - PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) + PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData), vtkm::cont::Token&) { throw vtkm::cont::ErrorBadAllocation( "Cannot write to an ArrayHandleCartesianProduct. It does not make " @@ -352,7 +353,7 @@ public: } VTKM_CONT - PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) + PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues), vtkm::cont::Token&) { throw vtkm::cont::ErrorBadAllocation( "Cannot write to an ArrayHandleCartesianProduct. It does not make " diff --git a/vtkm/cont/ArrayHandleCompositeVector.h b/vtkm/cont/ArrayHandleCompositeVector.h index 72e652165..3aaf0e970 100644 --- a/vtkm/cont/ArrayHandleCompositeVector.h +++ b/vtkm/cont/ArrayHandleCompositeVector.h @@ -132,27 +132,33 @@ struct ArrayTupleForEach } template - VTKM_CONT static void PrepareForInput(const ArrayTuple& arrays, PortalTuple& portals) + VTKM_CONT static void PrepareForInput(const ArrayTuple& arrays, + PortalTuple& portals, + vtkm::cont::Token& token) { - vtkmstd::get(portals) = vtkmstd::get(arrays).PrepareForInput(DeviceTag()); - Next::template PrepareForInput(arrays, portals); + vtkmstd::get(portals) = vtkmstd::get(arrays).PrepareForInput(DeviceTag(), token); + Next::template PrepareForInput(arrays, portals, token); } template - VTKM_CONT static void PrepareForInPlace(ArrayTuple& arrays, PortalTuple& portals) + VTKM_CONT static void PrepareForInPlace(ArrayTuple& arrays, + PortalTuple& portals, + vtkm::cont::Token& token) { - vtkmstd::get(portals) = vtkmstd::get(arrays).PrepareForInPlace(DeviceTag()); - Next::template PrepareForInPlace(arrays, portals); + vtkmstd::get(portals) = + vtkmstd::get(arrays).PrepareForInPlace(DeviceTag(), token); + Next::template PrepareForInPlace(arrays, portals, token); } template VTKM_CONT static void PrepareForOutput(ArrayTuple& arrays, PortalTuple& portals, - vtkm::Id numValues) + vtkm::Id numValues, + vtkm::cont::Token& token) { vtkmstd::get(portals) = - vtkmstd::get(arrays).PrepareForOutput(numValues, DeviceTag()); - Next::template PrepareForOutput(arrays, portals, numValues); + vtkmstd::get(arrays).PrepareForOutput(numValues, DeviceTag(), token); + Next::template PrepareForOutput(arrays, portals, numValues, token); } VTKM_CONT @@ -191,17 +197,17 @@ struct ArrayTupleForEach } template - VTKM_CONT static void PrepareForInput(const ArrayTuple&, PortalTuple&) + VTKM_CONT static void PrepareForInput(const ArrayTuple&, PortalTuple&, vtkm::cont::Token&) { } template - VTKM_CONT static void PrepareForInPlace(ArrayTuple&, PortalTuple&) + VTKM_CONT static void PrepareForInPlace(ArrayTuple&, PortalTuple&, vtkm::cont::Token&) { } template - VTKM_CONT static void PrepareForOutput(ArrayTuple&, PortalTuple&, vtkm::Id) + VTKM_CONT static void PrepareForOutput(ArrayTuple&, PortalTuple&, vtkm::Id, vtkm::cont::Token&) { } @@ -302,29 +308,30 @@ public: template VTKM_CONT static const typename ExecutionTypes::PortalConstTuple PrepareForInput( - const ArrayTuple& arrays) + const ArrayTuple& arrays, + vtkm::cont::Token& token) { typename ExecutionTypes::PortalConstTuple portals; - ForEachArray::template PrepareForInput(arrays, portals); + ForEachArray::template PrepareForInput(arrays, portals, token); return portals; } template VTKM_CONT static const typename ExecutionTypes::PortalTuple PrepareForInPlace( - ArrayTuple& arrays) + ArrayTuple& arrays, + vtkm::cont::Token& token) { typename ExecutionTypes::PortalTuple portals; - ForEachArray::template PrepareForInPlace(arrays, portals); + ForEachArray::template PrepareForInPlace(arrays, portals, token); return portals; } template - VTKM_CONT static const typename ExecutionTypes::PortalTuple PrepareForOutput( - ArrayTuple& arrays, - vtkm::Id numValues) + VTKM_CONT static const typename ExecutionTypes::PortalTuple + PrepareForOutput(ArrayTuple& arrays, vtkm::Id numValues, vtkm::cont::Token& token) { typename ExecutionTypes::PortalTuple portals; - ForEachArray::template PrepareForOutput(arrays, portals, numValues); + ForEachArray::template PrepareForOutput(arrays, portals, numValues, token); return portals; } }; @@ -671,24 +678,24 @@ public: vtkm::Id GetNumberOfValues() const { return this->Storage->GetNumberOfValues(); } VTKM_CONT - PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) const + PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData), vtkm::cont::Token& token) const { return PortalConstExecution( - ControlTraits::template PrepareForInput(this->GetArrayTuple())); + ControlTraits::template PrepareForInput(this->GetArrayTuple(), token)); } VTKM_CONT - PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) + PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData), vtkm::cont::Token& token) { return PortalExecution( - ControlTraits::template PrepareForInPlace(this->GetArrayTuple())); + ControlTraits::template PrepareForInPlace(this->GetArrayTuple(), token)); } VTKM_CONT - PortalExecution PrepareForOutput(vtkm::Id numValues) + PortalExecution PrepareForOutput(vtkm::Id numValues, vtkm::cont::Token& token) { return PortalExecution( - ControlTraits::template PrepareForOutput(this->GetArrayTuple(), numValues)); + ControlTraits::template PrepareForOutput(this->GetArrayTuple(), numValues, token)); } VTKM_CONT diff --git a/vtkm/cont/ArrayHandleConcatenate.h b/vtkm/cont/ArrayHandleConcatenate.h index 4093217fb..d9e887910 100644 --- a/vtkm/cont/ArrayHandleConcatenate.h +++ b/vtkm/cont/ArrayHandleConcatenate.h @@ -283,21 +283,21 @@ public: } VTKM_CONT - PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData)) + PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData), vtkm::cont::Token& token) { - return PortalConstExecution(this->array1.PrepareForInput(Device()), - this->array2.PrepareForInput(Device())); + return PortalConstExecution(this->array1.PrepareForInput(Device(), token), + this->array2.PrepareForInput(Device(), token)); } VTKM_CONT - PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData)) + PortalExecution PrepareForInPlace(bool vtkmNotUsed(updateData), vtkm::cont::Token& token) { - return PortalExecution(this->array1.PrepareForInPlace(Device()), - this->array2.PrepareForInPlace(Device())); + return PortalExecution(this->array1.PrepareForInPlace(Device(), token), + this->array2.PrepareForInPlace(Device(), token)); } VTKM_CONT - PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues)) + PortalExecution PrepareForOutput(vtkm::Id vtkmNotUsed(numberOfValues), vtkm::cont::Token&) { throw vtkm::cont::ErrorInternal("ArrayHandleConcatenate is derived and read-only. "); } diff --git a/vtkm/cont/ArrayHandleDecorator.h b/vtkm/cont/ArrayHandleDecorator.h index 7abd8d859..caa7fa01e 100644 --- a/vtkm/cont/ArrayHandleDecorator.h +++ b/vtkm/cont/ArrayHandleDecorator.h @@ -226,34 +226,34 @@ typename std::decay::type::PortalConstControl GetPortalControlImpl(std:: template typename std::decay::type::template ExecutionTypes::Portal -GetPortalInPlaceImpl(std::true_type, ArrayT&& array, Device) +GetPortalInPlaceImpl(std::true_type, ArrayT&& array, Device, vtkm::cont::Token& token) { - return array.PrepareForInPlace(Device{}); + return array.PrepareForInPlace(Device{}, token); } template typename std::decay::type::template ExecutionTypes::PortalConst -GetPortalInPlaceImpl(std::false_type, ArrayT&& array, Device) +GetPortalInPlaceImpl(std::false_type, ArrayT&& array, Device, vtkm::cont::Token& token) { // ArrayT is read-only -- prepare for input instead. - return array.PrepareForInput(Device{}); + return array.PrepareForInput(Device{}, token); } template typename std::decay::type::template ExecutionTypes::Portal -GetPortalOutputImpl(std::true_type, ArrayT&& array, Device) +GetPortalOutputImpl(std::true_type, ArrayT&& array, Device, vtkm::cont::Token& token) { // Prepare these for inplace usage instead -- we'll likely need to read // from these in addition to writing. - return array.PrepareForInPlace(Device{}); + return array.PrepareForInPlace(Device{}, token); } template typename std::decay::type::template ExecutionTypes::PortalConst -GetPortalOutputImpl(std::false_type, ArrayT&& array, Device) +GetPortalOutputImpl(std::false_type, ArrayT&& array, Device, vtkm::cont::Token& token) { // ArrayT is read-only -- prepare for input instead. - return array.PrepareForInput(Device{}); + return array.PrepareForInput(Device{}, token); } } // namespace detail @@ -302,27 +302,26 @@ GetPortalConstControlType::type> GetPortalConstContr } template -GetPortalConstExecutionType::type, Device> GetPortalInput( - const ArrayT& array, - Device) +GetPortalConstExecutionType::type, Device> +GetPortalInput(const ArrayT& array, Device, vtkm::cont::Token& token) { - return array.PrepareForInput(Device{}); + return array.PrepareForInput(Device{}, token); } template -GetPortalExecutionType::type, Device> GetPortalInPlace(ArrayT&& array, - Device) +GetPortalExecutionType::type, Device> +GetPortalInPlace(ArrayT&& array, Device, vtkm::cont::Token& token) { return detail::GetPortalInPlaceImpl( - IsWritableArrayHandle{}, std::forward(array), Device{}); + IsWritableArrayHandle{}, std::forward(array), Device{}, token); } template -GetPortalExecutionType::type, Device> GetPortalOutput(ArrayT&& array, - Device) +GetPortalExecutionType::type, Device> +GetPortalOutput(ArrayT&& array, Device, vtkm::cont::Token& token) { return detail::GetPortalOutputImpl( - IsWritableArrayHandle{}, std::forward(array), Device{}); + IsWritableArrayHandle{}, std::forward(array), Device{}, token); } // Equivalent to std::true_type if *any* portal in PortalList can be written to. @@ -381,16 +380,16 @@ using GetPortalConstControlList = brigand::list())))...>; template -using GetPortalConstExecutionList = - brigand::list(), Device{})))...>; +using GetPortalConstExecutionList = brigand::list(), Device{}, std::declval())))...>; template using GetPortalControlList = brigand::list())))...>; template -using GetPortalExecutionList = - brigand::list(), Device{})))...>; +using GetPortalExecutionList = brigand::list(), Device{}, std::declval())))...>; template struct DecoratorStorageTraits @@ -576,14 +575,15 @@ struct DecoratorStorageTraits const ArrayTupleType& arrays, vtkm::Id numValues, List, - Device dev) + Device dev, + vtkm::cont::Token& token) { return CreatePortalDecorator>( numValues, impl, // Don't touch the following line unless you really, really have to. See // note in MakePortalControl. - GetPortalInput(vtkmstd::get(arrays), dev)...); + GetPortalInput(vtkmstd::get(arrays), dev, token)...); } template