Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:11

0001 /**
0002  * traccc library, part of the ACTS project (R&D line)
0003  *
0004  * (c) 2024-2025 CERN for the benefit of the ACTS project
0005  *
0006  * Mozilla Public License Version 2.0
0007  */
0008 
0009 #pragma once
0010 
0011 // Project include(s).
0012 #include "traccc/device/concepts/thread_id.hpp"
0013 
0014 namespace traccc::cuda::details {
0015 
0016 /// A CUDA thread identifier type
0017 struct thread_id1 {
0018   __device__ thread_id1() {}
0019 
0020   inline unsigned int __device__ getLocalThreadId() const {
0021     return threadIdx.x;
0022   }
0023 
0024   inline unsigned int __device__ getLocalThreadIdX() const {
0025     return threadIdx.x;
0026   }
0027 
0028   inline unsigned int __device__ getGlobalThreadId() const {
0029     return threadIdx.x + blockIdx.x * blockDim.x;
0030   }
0031 
0032   inline unsigned int __device__ getGlobalThreadIdX() const {
0033     return threadIdx.x + blockIdx.x * blockDim.x;
0034   }
0035 
0036   inline unsigned int __device__ getBlockIdX() const { return blockIdx.x; }
0037 
0038   inline unsigned int __device__ getBlockDimX() const { return blockDim.x; }
0039 
0040   inline unsigned int __device__ getGridDimX() const { return gridDim.x; }
0041 
0042 };  // struct thread_id1
0043 
0044 /// Verify that @c traccc::cuda::details::thread_id1 fulfills the
0045 /// @c traccc::device::concepts::thread_id1 concept.
0046 static_assert(traccc::device::concepts::thread_id1<thread_id1>);
0047 
0048 }  // namespace traccc::cuda::details