MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / index_3d

Function index_3d

crates/cuda_std/src/thread.rs:242–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240
241#[inline(always)]
242pub fn index_3d() -> Vec3<u32> {
243 let i = thread_idx_x() + block_idx_x() * block_dim_x();
244 let j = thread_idx_y() + block_idx_y() * block_dim_y();
245 let k = thread_idx_z() + block_idx_z() * block_dim_z();
246 Vec3::new(i, j, k)
247}
248
249/// Whether this is the first thread (not the first thread to be executing). This function is guaranteed
250/// to only return true in a single thread that is invoking it. This is useful for only doing something

Callers

nothing calls this directly

Calls 10

thread_idx_xFunction · 0.85
block_idx_xFunction · 0.85
block_dim_xFunction · 0.85
thread_idx_yFunction · 0.85
block_idx_yFunction · 0.85
block_dim_yFunction · 0.85
thread_idx_zFunction · 0.85
block_idx_zFunction · 0.85
block_dim_zFunction · 0.85
newFunction · 0.85

Tested by

no test coverage detected