Skip to content

Draft: FiltersInstantiator: Automation of filters instantiations

RATIONALE

In the pasts months we have been able to reduce compilation time using fine grain instatiation TUs of our heavy templatized filters module.

This ad-hoc fixes have been populating the filters module source code in a effective but obscure manner using tools such as pyexpander. While for some of the developers included myself working with these instantiation is just a trivial and mechanic task, we feared that new developers would be terribly confused about this.

In this MR I attempt to reduce the introduced complexity with these recent instantiation files by adding a instantiation code generator and its corresponding API.

API

class VTKM_FILTER_GRADIENT_EXPORT VTKm_FILTER(Gradient)
  : public vtkm::filter::FilterField<Gradient>
{
  VTKm_INSTANTIATE_METHOD_DOEXECUTE;
  VTKm_INSTANTIATE_TYPES(vtkm::Float32, vtkm::Float64, vtkm::Vec3f_32, vtkm::Vec3f_64);
  VTKm_INSTANTIATE_TU_NUM(2);

The introduced code generator will generate its corresponding instantiation files during the configured phase of CMAKE and place those instantiation files under vtkm/filter/instantiations.

Later on during compilation time those files will be added to the vtkm_filters library source

PROGRESS

  • Create API
  • Create Code generator
  • Automatized instantiations selection with CMake

Signed-off-by: Vicente Adolfo Bolea Sanchez vicente.bolea@kitware.com

Edited by Vicente Bolea

Merge request reports

Loading