From e0abb398104fc93881e6e633ec4ab12838d3c274 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Thu, 13 May 2021 07:51:41 -0600 Subject: [PATCH] Unify common storage types The list defining the common storage types was defined in DefaultTypes.h.in. The problem was that derived default types could not just add their own type. They had to redefine the whole list. Instead, move the list to StorageList.h. Also updated DefaultTypesVTK.h.in to use this list when using XGC. This enables ArrayHandleSOA for this case. --- vtkm/cont/DefaultTypes.h.in | 24 +----------------------- vtkm/cont/StorageList.h | 13 ++++++++++++- vtkm/cont/internal/DefaultTypesVTK.h.in | 14 +++----------- 3 files changed, 16 insertions(+), 35 deletions(-) diff --git a/vtkm/cont/DefaultTypes.h.in b/vtkm/cont/DefaultTypes.h.in index 161f15e41..2d1e61e11 100644 --- a/vtkm/cont/DefaultTypes.h.in +++ b/vtkm/cont/DefaultTypes.h.in @@ -46,30 +46,8 @@ #endif //VTKM_DEFAULT_TYPE_LIST #ifndef VTKM_DEFAULT_STORAGE_LIST -#include -#include -#include #include -namespace vtkm -{ -namespace cont -{ -namespace internal -{ - -using StorageListField = vtkm::ListAppend< - vtkm::cont::StorageListBasic, - vtkm::List< - vtkm::cont::StorageTagSOA, - vtkm::cont::StorageTagUniformPoints, - vtkm::cont::StorageTagCartesianProduct>>; -} -} -} // namespace vtkm::cont - -#define VTKM_DEFAULT_STORAGE_LIST ::vtkm::cont::internal::StorageListField +#define VTKM_DEFAULT_STORAGE_LIST ::vtkm::cont::StorageListCommon #endif // VTKM_FIELD_STORAGE_LIST #ifndef VTKM_DEFAULT_CELL_SET_LIST_STRUCTURED diff --git a/vtkm/cont/StorageList.h b/vtkm/cont/StorageList.h index dbe94a43f..09dcedf8c 100644 --- a/vtkm/cont/StorageList.h +++ b/vtkm/cont/StorageList.h @@ -13,7 +13,9 @@ #include #include -#include +#include +#include +#include namespace vtkm { @@ -21,6 +23,15 @@ namespace cont { using StorageListBasic = vtkm::List; + +using StorageListCommon = + vtkm::List>; + } } // namespace vtkm::cont diff --git a/vtkm/cont/internal/DefaultTypesVTK.h.in b/vtkm/cont/internal/DefaultTypesVTK.h.in index d48161643..8d15474f1 100644 --- a/vtkm/cont/internal/DefaultTypesVTK.h.in +++ b/vtkm/cont/internal/DefaultTypesVTK.h.in @@ -16,6 +16,7 @@ #include #include +#include #cmakedefine VTKM_ADD_XGC_DEFAULT_TYPES @@ -110,17 +111,8 @@ using CellListAllOutVTK = vtkm::ListAppend, - vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle>::StorageTag, - vtkm::cont::ArrayHandleCartesianProduct, - vtkm::cont::ArrayHandle, - vtkm::cont::ArrayHandle>::StorageTag, - vtkm::cont::StorageTagXGCCoordinates - >>; + vtkm::cont::StorageListCommon, + vtkm::List>; #endif } // end namespace tovtkm