mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 18:08:59 +00:00
5ecf2d1187
Visual Studio default toolset uses 32bit executables for compiling which means that if it uses more than 4GB of memory per instance it crashes. By moving the ConnectivityTracer into a separate compilation unit we can help out the compiler. This also improved compilation times and library size: Old: build time (j8): 48.62 real lib size: 6.2MB New: build time (j8): 41.31 real lib size: 5.0MB
77 lines
2.6 KiB
C++
77 lines
2.6 KiB
C++
//============================================================================
|
|
// 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 2015 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
|
// Copyright 2015 UT-Battelle, LLC.
|
|
// Copyright 2015 Los Alamos National Security.
|
|
//
|
|
// Under the terms of Contract DE-NA0003525 with NTESS,
|
|
// the U.S. Government retains certain rights in this software.
|
|
//
|
|
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
|
// Laboratory (LANL), the U.S. Government retains certain rights in
|
|
// this software.
|
|
//============================================================================
|
|
#define vtk_m_rendering_raytracing_ConnectivityTracer_cxx
|
|
|
|
#include <vtkm/rendering/raytracing/ConnectivityTracer.h>
|
|
#include <vtkm/rendering/raytracing/ConnectivityTracer.hxx>
|
|
|
|
namespace vtkm
|
|
{
|
|
namespace rendering
|
|
{
|
|
namespace raytracing
|
|
{
|
|
|
|
namespace detail
|
|
{
|
|
struct RenderFunctor
|
|
{
|
|
template <typename Device, typename Tracer, typename Rays>
|
|
bool operator()(Device device, Tracer&& tracer, Rays&& rays) const
|
|
{
|
|
tracer.RenderOnDevice(rays, device);
|
|
return true;
|
|
}
|
|
};
|
|
} //namespace detail
|
|
|
|
|
|
template <vtkm::Int32 CellType, typename ConnectivityType>
|
|
void ConnectivityTracer<CellType, ConnectivityType>::Trace(Ray<vtkm::Float32>& rays)
|
|
{
|
|
detail::RenderFunctor functor;
|
|
vtkm::cont::TryExecute(functor, *this, rays);
|
|
}
|
|
|
|
template <vtkm::Int32 CellType, typename ConnectivityType>
|
|
void ConnectivityTracer<CellType, ConnectivityType>::Trace(Ray<vtkm::Float64>& rays)
|
|
{
|
|
detail::RenderFunctor functor;
|
|
vtkm::cont::TryExecute(functor, *this, rays);
|
|
}
|
|
|
|
//explicit construct all valid forms ofConnectivityTracer
|
|
template class detail::RayTracking<float>;
|
|
template class detail::RayTracking<double>;
|
|
|
|
template class VTKM_RENDERING_TEMPLATE_EXPORT
|
|
ConnectivityTracer<CELL_SHAPE_ZOO, UnstructuredMeshConn>;
|
|
template class VTKM_RENDERING_TEMPLATE_EXPORT
|
|
ConnectivityTracer<CELL_SHAPE_HEXAHEDRON, UnstructuredMeshConnSingleType>;
|
|
template class VTKM_RENDERING_TEMPLATE_EXPORT
|
|
ConnectivityTracer<CELL_SHAPE_WEDGE, UnstructuredMeshConnSingleType>;
|
|
template class VTKM_RENDERING_TEMPLATE_EXPORT
|
|
ConnectivityTracer<CELL_SHAPE_TETRA, UnstructuredMeshConnSingleType>;
|
|
template class VTKM_RENDERING_TEMPLATE_EXPORT
|
|
ConnectivityTracer<CELL_SHAPE_STRUCTURED, StructuredMeshConn>;
|
|
}
|
|
}
|
|
} // namespace vtkm::rendering::raytracing
|