Commit d706250a authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'namespace_vtk_9_1_0'

ed07dc5f Release note for vtk-abi-namespace.
95ff3e54 Add name mangling module test.
4befee82 Add namespace header test for all public headers.
65fc526a Put VTK symbols inside ABI namespace macros.
9519ee65

 Add options for enabling ABI mangling namespace.

Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Rejected-by: buildbot's avatarbuildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !8993
parents b08faffd ed07dc5f
......@@ -12,8 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef vtkConfigCore_h
#define vtkConfigCore_h
#ifndef vtkmConfigCore_h
#define vtkmConfigCore_h
/*--------------------------------------------------------------------------*/
/* Other Configuration Options */
......@@ -52,4 +52,4 @@
#endif
#endif // vtkConfigCore_h
#endif // vtkmConfigCore_h
......@@ -21,6 +21,7 @@
#include "vtkmDataArray.h"
VTK_ABI_NAMESPACE_BEGIN
template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<char>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<double>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<float>;
......@@ -34,3 +35,4 @@ template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<unsigned int>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<unsigned long>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<unsigned long long>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkmDataArray<unsigned short>;
VTK_ABI_NAMESPACE_END
......@@ -34,12 +34,15 @@
namespace internal
{
VTK_ABI_NAMESPACE_BEGIN
template <typename T>
class ArrayHandleWrapperBase;
VTK_ABI_NAMESPACE_END
} // internal
VTK_ABI_NAMESPACE_BEGIN
template <typename T>
class vtkmDataArray : public vtkGenericDataArray<vtkmDataArray<T>, T>
{
......@@ -116,6 +119,7 @@ extern template class VTKACCELERATORSVTKMCORE_TEMPLATE_EXPORT vtkmDataArray<unsi
extern template class VTKACCELERATORSVTKMCORE_TEMPLATE_EXPORT vtkmDataArray<unsigned short>;
#endif // vtkmDataArray_cxx
VTK_ABI_NAMESPACE_END
#endif // vtkmDataArray_h
#include "vtkmlib/vtkmDataArray.hxx"
......
......@@ -30,6 +30,7 @@
#include <vtkm/filter/PolicyDefault.h>
//------------------------------------------------------------------------------
VTK_ABI_NAMESPACE_BEGIN
class vtkmOutputFilterPolicy : public vtkm::filter::PolicyBase<vtkmOutputFilterPolicy>
{
public:
......@@ -40,5 +41,6 @@ public:
using AllCellSetList = tovtkm::CellListAllOutVTK;
};
VTK_ABI_NAMESPACE_END
#endif
// VTK-HeaderTest-Exclude: vtkmFilterPolicy.h
......@@ -28,6 +28,7 @@
namespace fromvtkm
{
VTK_ABI_NAMESPACE_BEGIN
namespace
{
......@@ -212,4 +213,5 @@ vtkPoints* Convert(const vtkm::cont::CoordinateSystem& input)
return points;
}
VTK_ABI_NAMESPACE_END
}
......@@ -29,9 +29,6 @@
#include <type_traits> // for std::underlying_type
class vtkDataArray;
class vtkPoints;
namespace vtkm
{
namespace cont
......@@ -40,8 +37,14 @@ class CoordinateSystem;
}
}
VTK_ABI_NAMESPACE_BEGIN
class vtkDataArray;
class vtkPoints;
VTK_ABI_NAMESPACE_END
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
/// Temporary name for arrays converted from VTK that do not have a name.
/// Unnamed arrays seem to be supported by VTK, but VTK-m requires all fields to have a name.
......@@ -114,10 +117,12 @@ enum class FieldsFlag
PointsAndCells = Points | Cells
};
VTK_ABI_NAMESPACE_END
}
namespace fromvtkm
{
VTK_ABI_NAMESPACE_BEGIN
VTKACCELERATORSVTKMCORE_EXPORT
vtkDataArray* Convert(const vtkm::cont::Field& input);
......@@ -128,8 +133,10 @@ vtkDataArray* Convert(const vtkm::cont::UnknownArrayHandle& input, const char* n
VTKACCELERATORSVTKMCORE_EXPORT
vtkPoints* Convert(const vtkm::cont::CoordinateSystem& input);
VTK_ABI_NAMESPACE_END
}
VTK_ABI_NAMESPACE_BEGIN
inline tovtkm::FieldsFlag operator&(const tovtkm::FieldsFlag& a, const tovtkm::FieldsFlag& b)
{
using T = std::underlying_type<tovtkm::FieldsFlag>::type;
......@@ -141,5 +148,7 @@ inline tovtkm::FieldsFlag operator|(const tovtkm::FieldsFlag& a, const tovtkm::F
using T = std::underlying_type<tovtkm::FieldsFlag>::type;
return static_cast<tovtkm::FieldsFlag>(static_cast<T>(a) | static_cast<T>(b));
}
VTK_ABI_NAMESPACE_END
#endif // vtkmlib_ArrayConverters_h
/* VTK-HeaderTest-Exclude: DataArrayConverters.h */
......@@ -25,6 +25,7 @@
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
template <typename DataArrayType>
vtkm::cont::UnknownArrayHandle vtkDataArrayToUnknownArrayHandle(DataArrayType* input)
......@@ -82,5 +83,6 @@ vtkm::cont::Field ConvertCellField(DataArrayType* input)
return vtkm::cont::make_FieldCell(name, vhandle);
}
VTK_ABI_NAMESPACE_END
} // tovtkm
#endif
......@@ -26,6 +26,7 @@
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
struct vtkPortalOfVecOfVecValues;
struct vtkPortalOfVecOfValues;
......@@ -142,6 +143,7 @@ struct vtkPortalTraits<const vtkm::Vec<vtkm::Vec<T, N>, M>>
}
};
VTK_ABI_NAMESPACE_END
} // namespace vtkmlib
#endif // vtkmlib_PortalsTraits_h
......@@ -21,9 +21,11 @@
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
// T extern template instantiations
template class VTKACCELERATORSVTKMCORE_EXPORT vtkPointsPortal<vtkm::Vec<vtkm::Float32, 3> const>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkPointsPortal<vtkm::Vec<vtkm::Float64, 3> const>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkPointsPortal<vtkm::Vec<vtkm::Float32, 3>>;
template class VTKACCELERATORSVTKMCORE_EXPORT vtkPointsPortal<vtkm::Vec<vtkm::Float64, 3>>;
VTK_ABI_NAMESPACE_END
}
......@@ -21,13 +21,16 @@
#include "vtkAcceleratorsVTKmCoreModule.h"
#include "vtkmConfigCore.h" //required for general vtkm setup
VTK_ABI_NAMESPACE_BEGIN
class vtkDataArray;
class vtkPoints;
VTK_ABI_NAMESPACE_END
#include <vtkm/cont/internal/IteratorFromArrayPortal.h>
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
template <typename Type, typename VTKDataArrayType_>
class VTKM_ALWAYS_EXPORT vtkArrayPortal
......@@ -116,12 +119,14 @@ private:
ComponentType* Array;
vtkm::Id Size;
};
VTK_ABI_NAMESPACE_END
}
#ifndef vtkmlib_Portals_cxx
#include <vtkm/cont/internal/ArrayPortalFromIterators.h>
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
// T extern template instantiations
extern template class VTKACCELERATORSVTKMCORE_TEMPLATE_EXPORT
vtkPointsPortal<vtkm::Vec<vtkm::Float32, 3> const>;
......@@ -131,9 +136,11 @@ extern template class VTKACCELERATORSVTKMCORE_TEMPLATE_EXPORT
vtkPointsPortal<vtkm::Vec<vtkm::Float32, 3>>;
extern template class VTKACCELERATORSVTKMCORE_TEMPLATE_EXPORT
vtkPointsPortal<vtkm::Vec<vtkm::Float64, 3>>;
VTK_ABI_NAMESPACE_END
}
#endif // defined vtkmlib_Portals_cxx
#include "Portals.hxx"
#endif // vtkmlib_Portals_h
/* VTK-HeaderTest-Exclude: Portals.h */
......@@ -52,6 +52,7 @@ struct fillComponents<1>
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
//------------------------------------------------------------------------------
template <typename VType, typename VTKDataArrayType>
......@@ -136,6 +137,7 @@ VTKM_EXEC void vtkPointsPortal<Type>::Set(vtkm::Id index, const ValueType& value
// use template magic to auto unroll insertion
fillComponents<NUM_COMPONENTS>()(rawArray, value);
}
VTK_ABI_NAMESPACE_END
}
#endif // vtkmlib_Portals_hxx
......@@ -31,6 +31,7 @@
namespace internal
{
VTK_ABI_NAMESPACE_BEGIN
//=============================================================================
template <typename T>
class ArrayHandleWrapperBase
......@@ -408,8 +409,10 @@ ArrayHandleWrapperBase<T>* MakeArrayHandleWrapper(vtkIdType numberOfTuples, int
}
}
VTK_ABI_NAMESPACE_END
} // internal
VTK_ABI_NAMESPACE_BEGIN
//=============================================================================
template <typename T>
vtkmDataArray<T>::vtkmDataArray() = default;
......@@ -504,4 +507,5 @@ bool vtkmDataArray<T>::ReallocateTuples(vtkIdType numTuples)
return true;
}
VTK_ABI_NAMESPACE_END
#endif // vtkmDataArray_hxx
......@@ -17,6 +17,7 @@
#include "vtkmInitializer.h"
#include <vtkm/cont/Initialize.h>
VTK_ABI_NAMESPACE_BEGIN
void InitializeVTKm()
{
// Only Kokkos HIP backend needs to be initialized
......@@ -36,3 +37,4 @@ vtkmInitializer::vtkmInitializer()
{
(void)InitializeVTKm();
}
VTK_ABI_NAMESPACE_END
......@@ -19,9 +19,11 @@
#include "vtkAcceleratorsVTKmCoreModule.h"
VTK_ABI_NAMESPACE_BEGIN
struct VTKACCELERATORSVTKMCORE_EXPORT vtkmInitializer
{
vtkmInitializer();
};
VTK_ABI_NAMESPACE_END
#endif
......@@ -12,8 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef vtkConfigDataModel_h
#define vtkConfigDataModel_h
#ifndef vtkmConfigDataModel_h
#define vtkmConfigDataModel_h
/*--------------------------------------------------------------------------*/
/* Other Configuration Options */
......@@ -52,4 +52,4 @@
#endif
#endif // vtkConfigDataModel_h
#endif // vtkmConfigDataModel_h
......@@ -40,6 +40,7 @@
#include <mutex>
VTK_ABI_NAMESPACE_BEGIN
namespace
{
......@@ -437,3 +438,4 @@ void vtkmDataSet::DeepCopy(vtkDataObject* src)
}
}
}
VTK_ABI_NAMESPACE_END
......@@ -36,6 +36,8 @@ class DataSet;
}
} // vtkm::cont
VTK_ABI_NAMESPACE_BEGIN
class vtkPoints;
class vtkCell;
class vtkGenericCell;
......@@ -195,4 +197,5 @@ private:
vtkmInitializer Initializer;
};
VTK_ABI_NAMESPACE_END
#endif // vtkmDataSet_h
......@@ -30,6 +30,7 @@
#include <vtkm/filter/PolicyDefault.h>
//------------------------------------------------------------------------------
VTK_ABI_NAMESPACE_BEGIN
class vtkmOutputFilterPolicy : public vtkm::filter::PolicyBase<vtkmOutputFilterPolicy>
{
public:
......@@ -40,5 +41,6 @@ public:
using AllCellSetList = tovtkm::CellListAllOutVTK;
};
VTK_ABI_NAMESPACE_END
#endif
// VTK-HeaderTest-Exclude: vtkmFilterPolicy.h
......@@ -32,6 +32,7 @@
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
void ProcessFields(vtkDataSet* input, vtkm::cont::DataSet& dataset, tovtkm::FieldsFlag fields)
{
if ((fields & tovtkm::FieldsFlag::Points) != tovtkm::FieldsFlag::None)
......@@ -125,10 +126,12 @@ vtkm::cont::Field Convert(vtkDataArray* input, int association)
}
return field;
}
VTK_ABI_NAMESPACE_END
} // namespace tovtkm
namespace fromvtkm
{
VTK_ABI_NAMESPACE_BEGIN
bool ConvertArrays(const vtkm::cont::DataSet& input, vtkDataSet* output)
{
......@@ -157,4 +160,5 @@ bool ConvertArrays(const vtkm::cont::DataSet& input, vtkDataSet* output)
}
return true;
}
VTK_ABI_NAMESPACE_END
} // namespace fromvtkm
......@@ -30,10 +30,6 @@
#include <type_traits> // for std::underlying_type
class vtkDataArray;
class vtkDataSet;
class vtkPoints;
namespace vtkm
{
namespace cont
......@@ -43,8 +39,15 @@ class CoordinateSystem;
}
}
VTK_ABI_NAMESPACE_BEGIN
class vtkDataArray;
class vtkDataSet;
class vtkPoints;
VTK_ABI_NAMESPACE_END
namespace tovtkm
{
VTK_ABI_NAMESPACE_BEGIN
VTKACCELERATORSVTKMDATAMODEL_EXPORT
void ProcessFields(vtkDataSet* input, vtkm::cont::DataSet& dataset, tovtkm::FieldsFlag fields);
......@@ -52,13 +55,16 @@ void ProcessFields(vtkDataSet* input, vtkm::cont::DataSet& dataset, tovtkm::Fiel
// determine the type and call the proper Convert routine
VTKACCELERATORSVTKMDATAMODEL_EXPORT
vtkm::cont::Field Convert(vtkDataArray* input, int association);
VTK_ABI_NAMESPACE_END
}
namespace fromvtkm
{
VTK_ABI_NAMESPACE_BEGIN
VTKACCELERATORSVTKMDATAMODEL_EXPORT
bool ConvertArrays(const vtkm::cont::DataSet& input, vtkDataSet* output);
VTK_ABI_NAMESPACE_END
}
#endif // vtkmlib_ArrayConverters_h
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment