Separate templated and non-template code in DistributedClostetPointImpl
This PR is a refactoring
It does the following:
Break up DistributedClosestPointImpl into a non-templated base class and the derived class DistributedClosestPointExec templated on DIM and ExecSpace.
Makes minor fixes to the CMake test set-up.
The refactoring simplifies the code and follows the separation of template and non-template code used in the marching cubes implementation. It helps the optimization I'm implementing in DistributedClosestPointImpl.
Motivation
Before this re-factoring, DistributedClosestPointImpl is templated on DIM and has BVH objects that are templated on DIM and ExecSpace. We had separate pointers for all possible dimensions and execution spaces. There was a lot of trivial-yet-clunky code to pick the correct pointers.
After the refactoring, DistributedClosestPointImpl contains no templated code. Its template code has been pushed down to the new class DistributedClosestPointExec, which is templated on dimension and execution space. The templated class has just one BVH, which is instantiated for the same dimension and execution space. We don't need separate pointers for all the cases--just a pointer to the base class DistributedClosesePointImpl. We only look at the dimension and execution space when allocating the DistributedClosestPointExec object.
Separate templated and non-template code in DistributedClostetPointImpl
DistributedClosestPointImpl
into a non-templated base class and the derived classDistributedClosestPointExec
templated onDIM
andExecSpace
.The refactoring simplifies the code and follows the separation of template and non-template code used in the marching cubes implementation. It helps the optimization I'm implementing in
DistributedClosestPointImpl
.Motivation
Before this re-factoring,
DistributedClosestPointImpl
is templated onDIM
and has BVH objects that are templated on DIM andExecSpace
. We had separate pointers for all possible dimensions and execution spaces. There was a lot of trivial-yet-clunky code to pick the correct pointers.After the refactoring,
DistributedClosestPointImpl
contains no templated code. Its template code has been pushed down to the new classDistributedClosestPointExec
, which is templated on dimension and execution space. The templated class has just one BVH, which is instantiated for the same dimension and execution space. We don't need separate pointers for all the cases--just a pointer to the base classDistributedClosesePointImpl
. We only look at the dimension and execution space when allocating theDistributedClosestPointExec
object.