From a2ab460f5de3694576f2f7a0aa764b13951342e5 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Thu, 12 Aug 2021 14:48:39 -0600 Subject: [PATCH] Compile more sources without device compiler We have been doing a better job at hiding device code (and moving code into libraries). Smoke out source that no longer needs to be compiled by device compilers. --- vtkm/cont/CMakeLists.txt | 36 +++++++------- .../CellLocatorBoundingIntervalHierarchy.cxx | 2 + .../CellLocatorBoundingIntervalHierarchy.h | 2 - vtkm/cont/CellLocatorUniformGrid.cxx | 1 - vtkm/cont/ColorTable.cxx | 1 - vtkm/cont/ColorTableMap.h | 1 - vtkm/cont/DataSet.h | 1 - vtkm/cont/FieldRangeCompute.cxx | 4 +- vtkm/cont/PartitionedDataSet.cxx | 2 - vtkm/cont/PartitionedDataSet.h | 1 - vtkm/cont/PointLocatorSparseGrid.cxx | 10 +++- vtkm/cont/PointLocatorSparseGrid.h | 6 --- vtkm/cont/testing/CMakeLists.txt | 1 - .../testing/TestingPointLocatorSparseGrid.h | 3 +- vtkm/exec/PointLocatorSparseGrid.h | 2 - vtkm/io/ImageUtils.cxx | 4 +- vtkm/io/testing/CMakeLists.txt | 2 +- vtkm/rendering/CMakeLists.txt | 49 ++++++++++--------- vtkm/rendering/LineRenderer.cxx | 2 - vtkm/rendering/TextRenderer.cxx | 2 - vtkm/rendering/Texture2D.h | 3 +- vtkm/rendering/raytracing/Ray.h | 2 - .../rendering/raytracing/ShapeIntersector.cxx | 2 +- .../UnitTestBoundingIntervalHierarchy.cxx | 2 + 24 files changed, 66 insertions(+), 75 deletions(-) diff --git a/vtkm/cont/CMakeLists.txt b/vtkm/cont/CMakeLists.txt index 4002e9a75..e62f10c35 100644 --- a/vtkm/cont/CMakeLists.txt +++ b/vtkm/cont/CMakeLists.txt @@ -141,12 +141,28 @@ set(sources ArrayHandleSOA.cxx ArrayHandleStride.cxx ArrayHandleUniformPointCoordinates.cxx + AssignerPartitionedDataSet.cxx BitField.cxx + BoundsCompute.cxx + BoundsGlobalCompute.cxx + CellLocatorGeneral.cxx + CellLocatorRectilinearGrid.cxx + CellLocatorUniformGrid.cxx + CellSet.cxx + CellSetStructured.cxx ColorTablePresets.cxx + CoordinateSystem.cxx + DataSet.cxx + DataSetBuilderCurvilinear.cxx + DataSetBuilderExplicit.cxx + DataSetBuilderRectilinear.cxx + DataSetBuilderUniform.cxx DeviceAdapterTag.cxx EnvironmentTracker.cxx ErrorBadDevice.cxx ErrorBadType.cxx + FieldRangeCompute.cxx + FieldRangeGlobalCompute.cxx internal/Buffer.cxx internal/DeviceAdapterMemoryManager.cxx internal/DeviceAdapterMemoryManagerShared.cxx @@ -156,9 +172,11 @@ set(sources Initialize.cxx Logging.cxx RuntimeDeviceTracker.cxx + PartitionedDataSet.cxx Storage.cxx Token.cxx TryExecute.cxx + UnknownArrayHandle.cxx UnknownCellSet.cxx ) @@ -168,35 +186,17 @@ set(device_sources ArrayCopy.cxx ArrayGetValues.cxx ArrayRangeCompute.cxx - AssignerPartitionedDataSet.cxx - BoundsCompute.cxx - BoundsGlobalCompute.cxx CellLocatorBoundingIntervalHierarchy.cxx - CellLocatorGeneral.cxx - CellLocatorRectilinearGrid.cxx CellLocatorTwoLevel.cxx - CellLocatorUniformGrid.cxx - CellSet.cxx CellSetExplicit.cxx CellSetExtrude.cxx - CellSetStructured.cxx ColorTable.cxx ConvertNumComponentsToOffsets.cxx - CoordinateSystem.cxx - DataSet.cxx - DataSetBuilderCurvilinear.cxx - DataSetBuilderExplicit.cxx - DataSetBuilderRectilinear.cxx - DataSetBuilderUniform.cxx Field.cxx - FieldRangeCompute.cxx - FieldRangeGlobalCompute.cxx MergePartitionedDataSet.cxx - PartitionedDataSet.cxx PointLocatorSparseGrid.cxx RuntimeDeviceInformation.cxx Timer.cxx - UnknownArrayHandle.cxx ) if (NOT VTKm_NO_DEPRECATED_VIRTUAL) diff --git a/vtkm/cont/CellLocatorBoundingIntervalHierarchy.cxx b/vtkm/cont/CellLocatorBoundingIntervalHierarchy.cxx index cb343059b..17f3238a4 100644 --- a/vtkm/cont/CellLocatorBoundingIntervalHierarchy.cxx +++ b/vtkm/cont/CellLocatorBoundingIntervalHierarchy.cxx @@ -27,6 +27,8 @@ #include #include +#include + namespace vtkm { namespace cont diff --git a/vtkm/cont/CellLocatorBoundingIntervalHierarchy.h b/vtkm/cont/CellLocatorBoundingIntervalHierarchy.h index d7fccd4ea..3eb3c070c 100644 --- a/vtkm/cont/CellLocatorBoundingIntervalHierarchy.h +++ b/vtkm/cont/CellLocatorBoundingIntervalHierarchy.h @@ -22,8 +22,6 @@ #include #include -#include - namespace vtkm { namespace cont diff --git a/vtkm/cont/CellLocatorUniformGrid.cxx b/vtkm/cont/CellLocatorUniformGrid.cxx index c2c11bce1..fd5ebb6b5 100644 --- a/vtkm/cont/CellLocatorUniformGrid.cxx +++ b/vtkm/cont/CellLocatorUniformGrid.cxx @@ -8,7 +8,6 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ -#include #include #include #include diff --git a/vtkm/cont/ColorTable.cxx b/vtkm/cont/ColorTable.cxx index e9bdf690d..4095ba8a3 100644 --- a/vtkm/cont/ColorTable.cxx +++ b/vtkm/cont/ColorTable.cxx @@ -14,7 +14,6 @@ #include #include #include -#include namespace diff --git a/vtkm/cont/ColorTableMap.h b/vtkm/cont/ColorTableMap.h index 0800a9868..faf558598 100644 --- a/vtkm/cont/ColorTableMap.h +++ b/vtkm/cont/ColorTableMap.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/vtkm/cont/DataSet.h b/vtkm/cont/DataSet.h index 4683d993b..b41a2cbe1 100644 --- a/vtkm/cont/DataSet.h +++ b/vtkm/cont/DataSet.h @@ -14,7 +14,6 @@ #include #include -#include #include #include #include diff --git a/vtkm/cont/FieldRangeCompute.cxx b/vtkm/cont/FieldRangeCompute.cxx index e124c8076..38c7b48fe 100644 --- a/vtkm/cont/FieldRangeCompute.cxx +++ b/vtkm/cont/FieldRangeCompute.cxx @@ -9,7 +9,9 @@ //============================================================================ #include -#include +#include +#include +#include namespace vtkm { diff --git a/vtkm/cont/PartitionedDataSet.cxx b/vtkm/cont/PartitionedDataSet.cxx index a573876d5..9dbcb6e0d 100644 --- a/vtkm/cont/PartitionedDataSet.cxx +++ b/vtkm/cont/PartitionedDataSet.cxx @@ -9,10 +9,8 @@ //============================================================================ #include -#include #include #include -#include #include #include #include diff --git a/vtkm/cont/PartitionedDataSet.h b/vtkm/cont/PartitionedDataSet.h index c1bb9c464..7152939ac 100644 --- a/vtkm/cont/PartitionedDataSet.h +++ b/vtkm/cont/PartitionedDataSet.h @@ -14,7 +14,6 @@ #include #include -#include #include namespace vtkm diff --git a/vtkm/cont/PointLocatorSparseGrid.cxx b/vtkm/cont/PointLocatorSparseGrid.cxx index 555bb4601..342d3c4a5 100644 --- a/vtkm/cont/PointLocatorSparseGrid.cxx +++ b/vtkm/cont/PointLocatorSparseGrid.cxx @@ -19,6 +19,12 @@ //============================================================================ #include +#include +#include +#include +#include +#include + namespace vtkm { namespace cont @@ -85,8 +91,8 @@ void PointLocatorSparseGrid::Build() // bin points into cells and give each of them the cell id. vtkm::cont::ArrayHandle cellIds; BinPointsWorklet cellIdWorklet(rmin, rmax, this->Dims); - vtkm::worklet::DispatcherMapField dispatchCellId(cellIdWorklet); - dispatchCellId.Invoke(this->GetCoordinates(), cellIds); + vtkm::cont::Invoker invoke; + invoke(cellIdWorklet, this->GetCoordinates(), cellIds); // Group points of the same cell together by sorting them according to the cell ids vtkm::cont::Algorithm::SortByKey(cellIds, this->PointIds); diff --git a/vtkm/cont/PointLocatorSparseGrid.h b/vtkm/cont/PointLocatorSparseGrid.h index c106fccbf..2e72387ee 100644 --- a/vtkm/cont/PointLocatorSparseGrid.h +++ b/vtkm/cont/PointLocatorSparseGrid.h @@ -10,12 +10,6 @@ #ifndef vtk_m_cont_PointLocatorSparseGrid_h #define vtk_m_cont_PointLocatorSparseGrid_h -#include -#include -#include -#include -#include - #include #include diff --git a/vtkm/cont/testing/CMakeLists.txt b/vtkm/cont/testing/CMakeLists.txt index 218a231b6..263aef6b7 100644 --- a/vtkm/cont/testing/CMakeLists.txt +++ b/vtkm/cont/testing/CMakeLists.txt @@ -104,7 +104,6 @@ set(library_sources ) set(library_sources_device - TestEqualArrayHandles.cxx # Really doesn't need device, but currently includes device headers ) vtkm_library( diff --git a/vtkm/cont/testing/TestingPointLocatorSparseGrid.h b/vtkm/cont/testing/TestingPointLocatorSparseGrid.h index 62bf10e13..6e4902f3e 100644 --- a/vtkm/cont/testing/TestingPointLocatorSparseGrid.h +++ b/vtkm/cont/testing/TestingPointLocatorSparseGrid.h @@ -17,6 +17,8 @@ #include +#include + ////brute force method ///// template VTKM_EXEC_CONT vtkm::Id NNSVerify3D(CoordiVecT qc, CoordiPortalT coordiPortal, CoordiT& dis2) @@ -91,7 +93,6 @@ template class TestingPointLocatorSparseGrid { public: - using Algorithm = vtkm::cont::DeviceAdapterAlgorithm; void TestTest() const { vtkm::Int32 nTrainingPoints = 5; diff --git a/vtkm/exec/PointLocatorSparseGrid.h b/vtkm/exec/PointLocatorSparseGrid.h index 7e3c7691e..8409ad427 100644 --- a/vtkm/exec/PointLocatorSparseGrid.h +++ b/vtkm/exec/PointLocatorSparseGrid.h @@ -11,8 +11,6 @@ #define vtk_m_exec_PointLocatorSparseGrid_h #include -#include -#include #include #include diff --git a/vtkm/io/ImageUtils.cxx b/vtkm/io/ImageUtils.cxx index 1c8bd847b..97eab135f 100644 --- a/vtkm/io/ImageUtils.cxx +++ b/vtkm/io/ImageUtils.cxx @@ -19,6 +19,8 @@ #include #include +#include + #include namespace vtkm @@ -48,7 +50,7 @@ vtkm::cont::DataSet ReadImageFile(const std::string& fullPath, const std::string std::ifstream check(fullPath.c_str()); if (!check.good()) { - throw vtkm::cont::ErrorExecution("File does not exist: " + fullPath); + throw vtkm::cont::ErrorBadValue("File does not exist: " + fullPath); } std::unique_ptr reader; diff --git a/vtkm/io/testing/CMakeLists.txt b/vtkm/io/testing/CMakeLists.txt index 584a20a6a..23c5f19f2 100644 --- a/vtkm/io/testing/CMakeLists.txt +++ b/vtkm/io/testing/CMakeLists.txt @@ -31,4 +31,4 @@ if(VTKm_ENABLE_RENDERING) list(APPEND unit_test_libraries vtkm_rendering) endif() -vtkm_unit_tests(SOURCES ${unit_tests} ALL_BACKENDS LIBRARIES ${unit_test_libraries}) +vtkm_unit_tests(SOURCES ${unit_tests} LIBRARIES ${unit_test_libraries}) diff --git a/vtkm/rendering/CMakeLists.txt b/vtkm/rendering/CMakeLists.txt index 09df80f46..a74418509 100644 --- a/vtkm/rendering/CMakeLists.txt +++ b/vtkm/rendering/CMakeLists.txt @@ -65,31 +65,43 @@ set(headers ) set(sources + Actor.cxx + AxisAnnotation.cxx + AxisAnnotation2D.cxx + AxisAnnotation3D.cxx BitmapFont.cxx BitmapFontFactory.cxx - + BoundingBoxAnnotation.cxx Camera.cxx Color.cxx + ColorBarAnnotation.cxx + ColorLegendAnnotation.cxx + LineRenderer.cxx + Mapper.cxx + MapperConnectivity.cxx + Scene.cxx + TextAnnotation.cxx + TextAnnotationBillboard.cxx + TextAnnotationScreen.cxx + TextRenderer.cxx + View.cxx + View1D.cxx + View2D.cxx + View3D.cxx + WorldAnnotator.cxx + raytracing/Logger.cxx + raytracing/MeshConnectivityContainers.cxx + raytracing/TriangleExtractor.cxx ) # This list of sources has code that uses devices and so might need to be # compiled with a device-specific compiler (like CUDA). set(device_sources - Actor.cxx - AxisAnnotation.cxx - AxisAnnotation2D.cxx - AxisAnnotation3D.cxx - BoundingBoxAnnotation.cxx Canvas.cxx CanvasRayTracer.cxx - ColorBarAnnotation.cxx - ColorLegendAnnotation.cxx ConnectivityProxy.cxx - LineRenderer.cxx LineRendererBatcher.cxx - Mapper.cxx - MapperConnectivity.cxx MapperCylinder.cxx MapperPoint.cxx MapperQuad.cxx @@ -97,19 +109,10 @@ set(device_sources MapperVolume.cxx MapperWireframer.cxx ScalarRenderer.cxx - Scene.cxx - TextAnnotation.cxx - TextAnnotationBillboard.cxx - TextAnnotationScreen.cxx - TextRenderer.cxx TextRendererBatcher.cxx - View.cxx - View1D.cxx - View2D.cxx - View3D.cxx - WorldAnnotator.cxx internal/RunTriangulator.cxx + raytracing/BoundingVolumeHierarchy.cxx raytracing/Camera.cxx raytracing/ChannelBuffer.cxx @@ -117,16 +120,14 @@ set(device_sources raytracing/CylinderExtractor.cxx raytracing/CylinderIntersector.cxx raytracing/MeshConnectivityBuilder.cxx - raytracing/MeshConnectivityContainers.cxx raytracing/QuadExtractor.cxx raytracing/QuadIntersector.cxx - raytracing/RayTracer.cxx raytracing/RayOperations.cxx + raytracing/RayTracer.cxx raytracing/ScalarRenderer.cxx raytracing/ShapeIntersector.cxx raytracing/SphereExtractor.cxx raytracing/SphereIntersector.cxx - raytracing/TriangleExtractor.cxx raytracing/TriangleIntersector.cxx raytracing/VolumeRendererStructured.cxx ) diff --git a/vtkm/rendering/LineRenderer.cxx b/vtkm/rendering/LineRenderer.cxx index 0ccbb22a2..e98fa6399 100644 --- a/vtkm/rendering/LineRenderer.cxx +++ b/vtkm/rendering/LineRenderer.cxx @@ -13,8 +13,6 @@ #include #include #include -#include -#include namespace vtkm { diff --git a/vtkm/rendering/TextRenderer.cxx b/vtkm/rendering/TextRenderer.cxx index 587396bbd..7b284c51b 100644 --- a/vtkm/rendering/TextRenderer.cxx +++ b/vtkm/rendering/TextRenderer.cxx @@ -13,8 +13,6 @@ #include #include #include -#include -#include namespace vtkm { diff --git a/vtkm/rendering/Texture2D.h b/vtkm/rendering/Texture2D.h index 27f72732c..d37d33746 100644 --- a/vtkm/rendering/Texture2D.h +++ b/vtkm/rendering/Texture2D.h @@ -11,7 +11,6 @@ #ifndef vtk_m_rendering_Texture2D_h #define vtk_m_rendering_Texture2D_h -#include #include #include @@ -65,7 +64,7 @@ public: // We do not know the lifetime of the underlying data source of input `data`. Since it might // be from a shallow copy of the data source, we make a deep copy of the input data and keep // it's portal. The copy operation is very fast. - vtkm::cont::Algorithm::Copy(data, Data); + this->Data.DeepCopyFrom(data); } VTKM_CONT diff --git a/vtkm/rendering/raytracing/Ray.h b/vtkm/rendering/raytracing/Ray.h index 7e178faa0..82b627ee8 100644 --- a/vtkm/rendering/raytracing/Ray.h +++ b/vtkm/rendering/raytracing/Ray.h @@ -13,9 +13,7 @@ #include #include #include -#include #include -#include #include diff --git a/vtkm/rendering/raytracing/ShapeIntersector.cxx b/vtkm/rendering/raytracing/ShapeIntersector.cxx index ee649554d..97c77f9d3 100644 --- a/vtkm/rendering/raytracing/ShapeIntersector.cxx +++ b/vtkm/rendering/raytracing/ShapeIntersector.cxx @@ -8,7 +8,7 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ #include -#include +#include namespace vtkm { diff --git a/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx b/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx index 257cd3ad3..3bf8f107f 100644 --- a/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx +++ b/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx @@ -20,6 +20,8 @@ #include #include #include +#include +#include namespace {