Commit 5fc10b0c authored by Robert Maynard's avatar Robert Maynard

VTK-m Accelerator make sure we build all filters and tests with cuda.

With the new module system we can simplify the logic for
building the VTK-m accelerator. Additionally we can now
make sure we build all the tests with the CUDA compiler
when applicable.
parent 9e27cc92
......@@ -19,28 +19,11 @@ list(INSERT 0 CMAKE_MODULE_PATH
set(sources)
set(headers)
set(private_headers)
set(lib_classes
vtkmlib/ArrayConverters
vtkmlib/CellSetConverters
vtkmlib/ImageDataConverter
vtkmlib/PolyDataConverter
vtkmlib/Storage
vtkmlib/UnstructuredGridConverter)
foreach (class IN LISTS lib_classes)
list(APPEND sources
"${class}.cxx")
list(APPEND private_headers
"${class}.h")
endforeach ()
if (TARGET vtkm::cuda)
set(vtkm_impl_extension "cu")
else ()
set(vtkm_impl_extension "cxx")
endif ()
set(private_headers
vtkmlib/DataSetConverters.h
vtkmlib/Portals.hxx
vtkmlib/PortalTraits.h
vtkmlib/Storage.hxx)
set(impl_classes
vtkmAverageToCells
......@@ -65,32 +48,36 @@ set(impl_classes
vtkmThreshold
vtkmTriangleMeshPointNormals
vtkmWarpScalar
vtkmWarpVector)
foreach (class IN LISTS impl_classes)
list(APPEND sources
"${class}.${vtkm_impl_extension}")
list(APPEND headers
"${class}.h")
endforeach ()
vtkmWarpVector
)
set(private_impl_classes
vtkmlib/ArrayConverters
vtkmlib/CellSetConverters
vtkmlib/ImageDataConverter
vtkmlib/PolyDataConverter
vtkmlib/Storage
vtkmlib/UnstructuredGridConverter
vtkmlib/DataSetConverters
vtkmlib/ImplicitFunctionConverter
vtkmlib/Portals)
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}.${vtkm_impl_extension}")
list(APPEND private_headers
"${class}.h")
list(APPEND sources "${class}.cxx")
list(APPEND private_headers "${class}.h")
endforeach ()
list(APPEND private_headers
vtkmlib/DataSetConverters.h
vtkmlib/Portals.hxx
vtkmlib/PortalTraits.h
vtkmlib/Storage.hxx)
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})
......@@ -153,7 +140,7 @@ if (TARGET vtkm::cuda)
PROPERTY CUDA_SEPARABLE_COMPILATION
VALUE ON)
vtk_module_compile_options(VTK::AcceleratorsVTKm
PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe --diag_suppress=extra_semicolon>)
PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe --diag_suppress=extra_semicolon>)
endif ()
if (MSVC)
......
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
)
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmAverageToCells.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmAverageToPoints.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmCellSetExplicit.cxx"
namespace vtkm {
namespace cont {
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetExplicitAOS::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetExplicitAOS::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
}
}
......@@ -339,5 +339,16 @@ template VTKACCELERATORSVTKM_EXPORT
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#ifdef VTKM_ENABLE_CUDA
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetExplicitAOS::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetExplicitAOS::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
}
}
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmCellSetSingleType.cxx"
namespace vtkm {
namespace cont {
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
}
}
......@@ -28,6 +28,7 @@
namespace
{
// Converts [0, rconnSize) to [0, connSize), skipping cell length entries.
struct SingleTypeRConnToConn
{
......@@ -189,5 +190,17 @@ template VTKACCELERATORSVTKM_EXPORT
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagOpenMP,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#ifdef VTKM_ENABLE_CUDA
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagCuda>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagCuda,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
}
}
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmCleanGrid.cxx"
/*=========================================================================
Program: Visualization Toolkit
Module: vtkmClip.cu
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkmClip.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmConnectivityExec.cxx"
namespace vtkm {
namespace exec {
template class ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagCuda>;
template class ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagCuda>;
template class ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagCuda>;
}
}
......@@ -171,5 +171,10 @@ template class ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagOpenMP>;
template class ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagOpenMP>;
#endif
#ifdef VTKM_ENABLE_CUDA
template class ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagCuda>;
template class ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagCuda>;
template class ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagCuda>;
#endif
}
}
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmContour.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmCoordinateSystemTransform.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmExternalFaces.cxx"
/*=========================================================================
Program: Visualization Toolkit
Module: vtkExtractVOI.cu
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkmExtractVOI.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmGradient.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmHistogram.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmLevelOfDetail.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmNDHistogram.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmPointElevation.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmPointTransform.cxx"
/*=========================================================================
Program: Visualization Toolkit
Module: vtkmPolyDataNormals.cu
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkmPolyDataNormals.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmProbe.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmThreshold.cxx"
/*=========================================================================
Program: Visualization Toolkit
Module: vtkmTriangleMeshPointNormals.cu
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkmTriangleMeshPointNormals.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpScalar.cxx"
//=============================================================================
//
// 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.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpVector.cxx"
Markdown is supported
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