Changed how worklets do device execution object creation
note vtkm task: - change in worklet - execution object in worklet 13.9 chpater in the user manual ExecObejct usd in a control signature
take an in the control environment and starts execution on it
if you have a plane old data type then thats fine like an interpolater function like less than, but for more complicated type (see user guid example for construction and execution obejct). templated on the device adapter because it access the arrays table. currently you have to know what device you are using in order to pass it to the worklet. we want to change it so that it iterates through the devices until it finds one that it likes, instead of giving it the execution object we need to give it a special method that will create the execution object for each specific device.
currently:
template<typename Device>
Class MyexecutionObj: public vtkm::exec::ExecutionObjectBase
instead:
class Foo: public vtkm::cont::ExecBbjectFactorBase{
public:
template<typename Device>
VTKM_CONT MyExecObj<Device> prepareForExecution(Device);(might be able to do a decel type since cpp 11)
(arrayhandle does something like this for getting the type)
template<typename Device>
using ExecObj = MyExecObj<Device>
}
ExecObject in workletbase.h is a rubric for determining how to do 3 things
typecheck
transport
fetch
control signature base is a promise for the tags
use using for new code not typedef
chapter 21 worklet arguments: go and change the typecheck from ExecObjectBase in the end delete or overwrite and have ExecObjectFactoryBase be the new check
template <typename ContObjectType, typename Device>
struct Transport<vtkm::cont::arg::TransportTagExecObject, ContObjectType, Device>
{
// If you get a compile error here, it means you tried to use an object that
// is not an execution object as an argument that is expected to be one. All
// execution objects are expected to inherit from
// vtkm::exec::ExecutionObjectFactoryBase.
VTKM_STATIC_ASSERT_MSG(
(std::is_base_of<vtkm::cont::ExecutionObjectFactoryBase, ContObjectType>::value),
"All execution objects are expected to inherit from vtkm::cont::ExecutionObjectFactoryBase");
using ExecObjectType = ContObjectType;
template <typename InputDomainType>
VTKM_CONT ExecObjectType
operator()(const ContObjectType& object, const InputDomainType&, vtkm::Id, vtkm::Id) const
{
return object;
// return object.prepareForExecution(Device);
}
};
see if you can potentially check for templated func(prepareForExecution) and compare compile times
chapter 21.x Transport argument: instead of returning the object we return the object with the device base on the prepareForExecution() function
fetch argument: returns itself ignore aspecttagdefault execobjecttype is what is retured from transport propbably wont have to change this
change exec object to take factorues