Add new file change-execution-object-creation.md

This commit is contained in:
Matthew Letter 2018-07-19 16:26:52 -04:00
parent 8a44d0a5ae
commit 47f317943a

@ -0,0 +1,27 @@
Here is what I plan to put in the change log
Changed how Execution objects are created and passed from the cont environment to the execution environment. See chapter 13.9 on worklets in the user manual for details.
----
Example of new execution object:
```cpp
template <typename Device>
struct ExecutionObject
{
vtkm::Int32 Number;
};
struct TestExecutionObject : public vtkm::cont::ExecutionObjectBase
{
vtkm::Int32 Number;
template <typename Device>
VTKM_CONT ExecutionObject<Device> PrepareForExecution(Device) const
{
ExecutionObject<Device> object;
object.Number = this->Number;
return object;
}
};
```
Instead we will now fill out a class and call prepareForExecution() and create the execution object for the execution environment from this function. This way we do not have to template the class that extends `vtkm::cont::ExecutionObjectBase` on the device.