Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-13 11:00:02

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright VecGeom contributors: see top-level LICENSE file for details
0003 // SPDX-License-Identifier: Apache-2.0
0004 //---------------------------------------------------------------------------//
0005 //! \file VecGeom/base/MemSpace.h
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "Macros.h"
0010 #include <type_traits>
0011 
0012 namespace vecgeom {
0013 
0014 //! Memory location of data
0015 enum class MemSpace {
0016   host,   //!< CPU memory
0017   device, //!< GPU memory
0018   mapped, //!< Unified virtual address space (both host and device)
0019   size_,
0020 #if VECGEOM_DEVICE_SOURCE
0021   native = device, //!< When compiling CUDA files, \c device else \c host
0022 #else
0023   native = host,
0024 #endif
0025 };
0026 
0027 //! Switch between host or device type based on memspace
0028 template <MemSpace M, class HT, class DT>
0029 using MemSpaceCond_t = std::conditional_t<M == MemSpace::host, HT, std::conditional_t<M == MemSpace::device, DT, void>>;
0030 
0031 } // namespace vecgeom