Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:59:58

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file geocel/vg/detail/VecgeomSetup.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Assert.hh"
0010 
0011 #include "VecgeomVersion.hh"
0012 
0013 #if defined(VECGEOM_USE_SURF) && !defined(__NVCC__)
0014 #    include <VecGeom/surfaces/BrepHelper.h>
0015 #endif
0016 
0017 namespace celeritas
0018 {
0019 namespace detail
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Pointers to device data, obtained from a kernel launch or from runtime.
0024  *
0025  * The \c kernel data is copied from inside a kernel to global heap memory, and
0026  * thence to this result. The \c symbol data is copied via \c
0027  * cudaMemcpyFromSymbol .
0028  */
0029 template<class T>
0030 struct CudaPointers
0031 {
0032     T* kernel{nullptr};
0033     T* symbol{nullptr};
0034 };
0035 
0036 //---------------------------------------------------------------------------//
0037 // Get pointers to the device BVH after setup, for consistency checking
0038 CudaPointers<detail::CudaBVH_t const> bvh_pointers_device();
0039 
0040 //---------------------------------------------------------------------------//
0041 #if defined(VECGEOM_USE_SURF) && !defined(__NVCC__)
0042 // Set up surface tracking
0043 void setup_surface_tracking_device(vgbrep::SurfData<vecgeom::Precision> const&);
0044 
0045 // Tear down surface tracking
0046 void teardown_surface_tracking_device();
0047 #endif
0048 
0049 //---------------------------------------------------------------------------//
0050 // INLINE DEFINITIONS
0051 //---------------------------------------------------------------------------//
0052 #ifndef VECGEOM_ENABLE_CUDA
0053 inline CudaPointers<detail::CudaBVH_t const> bvh_pointers_device()
0054 {
0055     CELER_ASSERT_UNREACHABLE();
0056 }
0057 
0058 #    if defined(VECGEOM_USE_SURF) && !defined(__NVCC__)
0059 inline void
0060 setup_surface_tracking_device(vgbrep::SurfData<vecgeom::Precision> const&)
0061 {
0062     CELER_ASSERT_UNREACHABLE();
0063 }
0064 
0065 inline void teardown_surface_tracking_device()
0066 {
0067     CELER_ASSERT_UNREACHABLE();
0068 }
0069 #    endif
0070 #endif
0071 //---------------------------------------------------------------------------//
0072 }  // namespace detail
0073 }  // namespace celeritas