...
 
Commits (527)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

[submodule "VTK-m"]
path = ThirdParty/vtkm/vtk-m
path = ThirdParty/vtkm/vtkvtkm/vtk-m
url = https://gitlab.kitware.com/vtk/vtk-m.git
......@@ -14,136 +14,80 @@
##
##=============================================================================
#ensure we link against our dependencies
include(module.cmake)
vtk_module_dep_includes(vtkVTKm)
list(APPEND CMAKE_MODULE_PATH "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtk-m/CMake")
set(lib_srcs
vtkmlib/PolyDataConverter.cxx
vtkmlib/UnstructuredGridConverter.cxx
vtkmlib/ArrayConverters.cxx
vtkmlib/CellSetConverters.cxx
vtkmlib/ImageDataConverter.cxx
vtkmlib/Storage.cxx
list(INSERT 0 CMAKE_MODULE_PATH
"${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake")
set(sources)
set(headers)
set(private_headers
vtkmlib/DataSetConverters.h
vtkmlib/Portals.hxx
vtkmlib/PortalTraits.h
vtkmlib/Storage.hxx)
set(impl_classes
vtkmAverageToCells
vtkmAverageToPoints
vtkmCellSetExplicit
vtkmCellSetSingleType
vtkmCleanGrid
vtkmClip
vtkmConnectivityExec
vtkmContour
vtkmCoordinateSystemTransform
vtkmExternalFaces
vtkmExtractVOI
vtkmGradient
vtkmHistogram
vtkmLevelOfDetail
vtkmNDHistogram
vtkmPointElevation
vtkmPointTransform
vtkmPolyDataNormals
vtkmProbe
vtkmThreshold
vtkmTriangleMeshPointNormals
vtkmWarpScalar
vtkmWarpVector
)
#needed to properly setup language wrappers
set(headers
vtkmAverageToCells.h
vtkmAverageToPoints.h
vtkmCleanGrid.h
vtkmClip.h
vtkmContour.h
vtkmCoordinateSystemTransform.h
vtkmExternalFaces.h
vtkmExtractVOI.h
vtkmGradient.h
vtkmHistogram.h
vtkmLevelOfDetail.h
vtkmNDHistogram.h
vtkmPointElevation.h
vtkmPointTransform.h
vtkmPolyDataNormals.h
vtkmProbe.h
vtkmThreshold.h
vtkmTriangleMeshPointNormals.h
vtkmWarpScalar.h
vtkmWarpVector.h
)
#implementation of the algorithms for cpu accelerators
set(cpu_accelerator_srcs
vtkmAverageToCells.cxx
vtkmAverageToPoints.cxx
vtkmCellSetExplicit.cxx
vtkmCellSetSingleType.cxx
vtkmCleanGrid.cxx
vtkmClip.cxx
vtkmConnectivityExec.cxx
vtkmContour.cxx
vtkmCoordinateSystemTransform.cxx
vtkmExternalFaces.cxx
vtkmExtractVOI.cxx
vtkmGradient.cxx
vtkmHistogram.cxx
vtkmLevelOfDetail.cxx
vtkmNDHistogram.cxx
vtkmPointElevation.cxx
vtkmPointTransform.cxx
vtkmPolyDataNormals.cxx
vtkmProbe.cxx
vtkmThreshold.cxx
vtkmTriangleMeshPointNormals.cxx
vtkmWarpScalar.cxx
vtkmWarpVector.cxx
vtkmlib/DataSetConverters.cxx
vtkmlib/Portals.cxx
vtkmlib/ImplicitFunctionConverter.cxx
)
#implementation of the algorithms for gpu accelerators
set(cuda_accelerator_srcs
vtkmAverageToCells.cu
vtkmAverageToPoints.cu
vtkmCellSetExplicit.cu
vtkmCellSetSingleType.cu
vtkmCleanGrid.cu
vtkmClip.cu
vtkmConnectivityExec.cu
vtkmContour.cu
vtkmCoordinateSystemTransform.cu
vtkmExternalFaces.cu
vtkmExtractVOI.cu
vtkmGradient.cu
vtkmHistogram.cu
vtkmLevelOfDetail.cu
vtkmNDHistogram.cu
vtkmPointElevation.cu
vtkmPointTransform.cu
vtkmPolyDataNormals.cu
vtkmProbe.cu
vtkmThreshold.cu
vtkmTriangleMeshPointNormals.cu
vtkmWarpScalar.cu
vtkmWarpVector.cu
vtkmlib/DataSetConverters.cu
vtkmlib/Portals.cu
vtkmlib/ImplicitFunctionConverter.cu
)
set(VTKM_FILTER_INCLUDE_AOS ${VTK_DISPATCH_AOS_ARRAYS})
set(VTKM_FILTER_INCLUDE_SOA ${VTK_DISPATCH_SOA_ARRAYS})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vtkmConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/vtkmConfig.h" @ONLY)
# ====================
# Important for wrapping and install rules for vtkmlib
# - SKIP_HEADER_INSTALL is enabled as we need to install these headers
# to the vtkmlib directory and not the root include directory as vtk
# normally does
# ====================
set_source_files_properties(
vtkmlib/PolyDataConverter
vtkmlib/UnstructuredGridConverter
set(private_impl_classes
vtkmlib/ArrayConverters
vtkmlib/CellSetConverters
vtkmlib/DataSetConverters
vtkmlib/ImageDataConverter
vtkmlib/PolyDataConverter
vtkmlib/Storage
vtkmlib/Portals
vtkmlib/UnstructuredGridConverter
vtkmlib/DataSetConverters
vtkmlib/ImplicitFunctionConverter
PROPERTIES
SKIP_HEADER_INSTALL 1
)
vtkmlib/Portals)
set(${vtk-module}_HDRS
vtkmTags.h
vtkmFilterPolicy.h
${CMAKE_CURRENT_BINARY_DIR}/vtkmConfig.h
)
foreach (class IN LISTS impl_classes)
list(APPEND sources "${class}.cxx")
list(APPEND headers "${class}.h")
endforeach ()
foreach (class IN LISTS private_impl_classes)
list(APPEND sources "${class}.cxx")
list(APPEND private_headers "${class}.h")
endforeach ()
if (TARGET vtkm::cuda)
set_source_files_properties(${sources} PROPERTIES LANGUAGE "CUDA")
#The vtkmlib/CellSetConverters need to be built always as CXX
#as the worklets used by them require access to vtk classes
set_source_files_properties(vtkmlib/CellSetConverters.cxx PROPERTIES LANGUAGE "CXX")
endif ()
set(VTKM_FILTER_INCLUDE_AOS ${VTK_DISPATCH_AOS_ARRAYS})
set(VTKM_FILTER_INCLUDE_SOA ${VTK_DISPATCH_SOA_ARRAYS})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/vtkmConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/vtkmConfig.h"
@ONLY)
list(APPEND headers
"${CMAKE_CURRENT_BINARY_DIR}/vtkmConfig.h")
# The VTK-m project uses large amounts of memory to compile as it does lots
# of template expansion. To reduce the amount of tension on the machine when
......@@ -154,69 +98,61 @@ set(${vtk-module}_HDRS
# 2GB of memory.
cmake_host_system_information(RESULT vtkm_mem_ QUERY TOTAL_PHYSICAL_MEMORY)
math(EXPR vtkm_pool_size "(${vtkm_mem_}/2)/2048")
if(vtkm_pool_size EQUAL 0)
if (vtkm_pool_size EQUAL 0)
set(vtkm_pool_size 1)
endif()
set_property(GLOBAL APPEND PROPERTY JOB_POOLS vtkm_pool=${vtkm_pool_size})
endif ()
set_property(GLOBAL APPEND
PROPERTY
JOB_POOLS vtkm_pool=${vtkm_pool_size})
if(TARGET vtkm::cuda)
#we are building with CUDA support
cmake_minimum_required(VERSION 3.9...3.12 FATAL_ERROR)
if (TARGET vtkm::cuda)
enable_language(CUDA)
# Workaround cmake issue #7519 which causes the c++11 flag set for VTK-m using
# target_compile_features to not work.
# XXX(cmake#7519): Workaround for CMake which causes the c++11 flag set for
# VTK-m using target_compile_features to not work.
if (CMAKE_VERSION VERSION_LESS 3.11)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED True)
endif()
get_target_property(arch_flags vtkm::cuda VTKm_CUDA_Architecture_Flags)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${arch_flags}")
get_property(arch_flags
TARGET vtkm::cuda
PROPERTY VTKm_CUDA_Architecture_Flags)
string(APPEND CMAKE_CUDA_FLAGS " ${arch_flags}")
# Temporarily suppress "has address taken but no possible call to it" warnings,
# until we figure out its implications.
# We are disabling all warnings as nvlink has no known way to suppress
# individual warning types.
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xnvlink -w")
vtk_module_library(vtkAcceleratorsVTKm
${headers}
${lib_srcs}
${cuda_accelerator_srcs}
)
set_target_properties(vtkAcceleratorsVTKm PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_compile_options(vtkAcceleratorsVTKm
PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe --diag_suppress=extra_semicolon>)
else()
vtk_module_library(vtkAcceleratorsVTKm
${headers}
${lib_srcs}
${cpu_accelerator_srcs}
)
endif()
set_property(TARGET vtkAcceleratorsVTKm PROPERTY JOB_POOL_COMPILE vtkm_pool)
target_link_libraries(vtkAcceleratorsVTKm PRIVATE vtkVTKm)
string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w")
endif ()
vtk_module_add_module(VTK::AcceleratorsVTKm
SOURCES ${sources}
HEADERS ${headers}
PRIVATE_HEADERS ${private_headers})
vtk_module_set_property(VTK::AcceleratorsVTKm
PROPERTY JOB_POOL_COMPILE
VALUE vtkm_pool)
if (TARGET vtkm::cuda)
vtk_module_set_property(VTK::AcceleratorsVTKm
PROPERTY CUDA_SEPARABLE_COMPILATION
VALUE ON)
vtk_module_compile_options(VTK::AcceleratorsVTKm
PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe --diag_suppress=extra_semicolon>)
endif ()
if (MSVC)
#C4702 Generates numerous false positives with template code about
# unreachable code
#C4512 Generates numerous warning that implicit assignment operators can't
# be constructed. This is understood and we don't care.
#C4510 Generates numerous warning that implicit constructors can't
# be constructed. This is understood and we don't care.
target_compile_options(vtkAcceleratorsVTKm PRIVATE -wd4702 -wd4512 -wd4510)
endif()
#install the required headers to make your own vtkm-vtk filter
if(NOT VTK_INSTALL_NO_DEVELOPMENT)
install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/vtkmlib
DESTINATION ${VTK_INSTALL_INCLUDE_DIR}
COMPONENT Development
FILES_MATCHING PATTERN "*.h*"
)
endif()
vtk_module_compile_options(VTK::AcceleratorsVTKm
PRIVATE
# Generates numerous false positives with template code about unreachable
# code
/wd4702
# Generates numerous warning that implicit assignment operators can't be
# constructed. This is understood and we don't care.
/wd4512
# Generates numerous warning that implicit constructors can't be
# constructed. This is understood and we don't care.
/wd4510)
endif ()
vtk_module_test_data(
Data/SampleStructGrid.vtk
Data/cow.vtp)
add_subdirectory(Cxx)
if (VTK_WRAP_PYTHON)
add_subdirectory(Python)
endif ()
vtk_add_test_cxx(vtkAcceleratorsVtkmCxxTests tests
if(NOT TARGET vtkm::cuda)
set(conditional_tests
TestVTKMLevelOfDetail.cxx
)
endif()
vtk_add_test_cxx(vtkAcceleratorsVTKmCxxTests tests
TestVTKMCleanGrid.cxx
TestVTKMCoordinateSystemTransform.cxx,NO_VALID
TestVTKMClip.cxx
......@@ -8,7 +16,6 @@ vtk_add_test_cxx(vtkAcceleratorsVtkmCxxTests tests
TestVTKMGradient.cxx,NO_VALID
TestVTKMGradientAndVorticity.cxx,NO_VALID
TestVTKMHistogram.cxx,NO_VALID
TestVTKMLevelOfDetail.cxx
TestVTKMMarchingCubes.cxx
TestVTKMMarchingCubes2.cxx
TestVTKMNDHistogram.cxx,NO_VALID
......@@ -21,7 +28,21 @@ vtk_add_test_cxx(vtkAcceleratorsVtkmCxxTests tests
TestVTKMTriangleMeshPointNormals.cxx
TestVTKMWarpScalar.cxx
TestVTKMWarpVector.cxx
${conditional_tests}
)
vtk_test_cxx_executable(vtkAcceleratorsVtkmCxxTests tests
if (TARGET vtkm::cuda)
#the enable_language call is scoped! so we have to re-enable
#cuda in the test directory
enable_language(CUDA)
foreach(src IN LISTS tests)
set_source_files_properties(${src}.cxx PROPERTIES LANGUAGE "CUDA")
endforeach()
endif()
vtk_test_cxx_executable(vtkAcceleratorsVTKmCxxTests tests
RENDERING_FACTORY
)
......@@ -462,7 +462,7 @@ int TestVTKMLevelOfDetail(int argc, char *argv[])
// Load file and make only triangles
//---------------------------------------------------
char* fname =
vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/cow.vtp");
vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/cow.vtp");
vtkNew<vtkXMLPolyDataReader> reader;
reader->SetFileName(fname);
delete[] fname;
......@@ -482,8 +482,8 @@ int TestVTKMLevelOfDetail(int argc, char *argv[])
std::vector< vtkNew<vtkPolyDataMapper> > mappers(4);
std::vector< vtkNew<vtkActor> > actors(4);
for(int i=0; i < 4; ++i)
{
for (int i=0; i < 4; ++i)
{
levelOfDetails[i]->SetInputConnection(clean->GetOutputPort());
//subdivision levels of 16, 32, 48, 64
levelOfDetails[i]->SetNumberOfXDivisions( ((i+1) * 16) );
......@@ -495,23 +495,23 @@ int TestVTKMLevelOfDetail(int argc, char *argv[])
mappers[i]->SetInputConnection(surfaces[i]->GetOutputPort());
actors[i]->SetMapper(mappers[i]);
actors[i]->SetPosition( i * 10, 0, 0);
actors[i]->SetPosition((i % 2) * 10, -(i / 2) * 10, 0);
ren->AddActor(actors[i]);
}
}
ren->SetBackground(0.1, 0.2, 0.4);
ren->ResetCamera();
ren->GetActiveCamera()->Zoom(6.);
renWin->SetSize(1600, 250);
ren->GetActiveCamera()->Zoom(1.3);
renWin->SetSize(600, 600);
renWin->Render();
int retVal = vtkRegressionTestImage(renWin);
if(retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
retVal = vtkRegressionTester::PASSED;
iren->Start();
retVal = vtkRegressionTester::PASSED;
}
return (!retVal);
}
e96dee63440b556807076219866d4172cc562ed42fd8c0291527a2724ebac10953e229dc9e29001c57689328c8965883700753e0e3f0776381e4eba07a31fe02
b763cc14592591f805136b8d1d28e18c50caa4291ad771b25b8a91b87be67414ddaf3e66961533af096ce6662c35cc2c16e5df9d17a5a293feeada64a05b5b11
vtk_module(vtkAcceleratorsVTKm
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersGeneral
vtkFiltersGeometry
vtkImagingCore
vtkVTKm
TEST_DEPENDS
vtkTestingCore
vtkTestingRendering
vtkRenderingOpenGL2
vtkRenderingVolumeOpenGL2
vtkRenderingFreeType
vtkIOLegacy
vtkIOPLY
vtkIOXML
vtkImagingHybrid
vtkImagingSources
vtkInteractionStyle
EXCLUDE_FROM_ALL
)
NAME
VTK::AcceleratorsVTKm
LIBRARY_NAME
vtkAcceleratorsVTKm
DESCRIPTION
VTKm filters and algorithms
CONDITION
NOT CMAKE_VERSION VERSION_LESS "3.9.0"
DEPENDS
VTK::CommonCore
VTK::CommonDataModel
VTK::CommonExecutionModel
VTK::FiltersGeneral
VTK::FiltersGeometry
VTK::ImagingCore
VTK::vtkm
TEST_DEPENDS
VTK::CommonSystem
VTK::FiltersSources
VTK::IOImage
VTK::IOLegacy
VTK::IOPLY
VTK::IOXML
VTK::ImagingHybrid
VTK::ImagingSources
VTK::InteractionStyle
VTK::RenderingFreeType
VTK::RenderingOpenGL2
VTK::RenderingVolumeOpenGL2
VTK::TestingCore
VTK::TestingRendering
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.