get_id.hpp 574 Bytes
Newer Older
1
#pragma once
Chao Liu's avatar
Chao Liu committed
2
3
#include "config.hpp"

4
namespace ck {
Chao Liu's avatar
Chao Liu committed
5

Chao Liu's avatar
Chao Liu committed
6
7
__device__ constexpr index_t get_wave_size() { return CK_GPU_WAVE_SIZE; }

Chao Liu's avatar
Chao Liu committed
8
__device__ index_t get_thread_local_1d_id() { return threadIdx.x; }
Chao Liu's avatar
Chao Liu committed
9

rocking's avatar
rocking committed
10
11
__device__ index_t get_thread_global_1d_id() { return blockIdx.x * blockDim.x + threadIdx.x; }

Chao Liu's avatar
Chao Liu committed
12
13
__device__ index_t get_wave_local_1d_id() { return threadIdx.x / get_wave_size(); }

Chao Liu's avatar
Chao Liu committed
14
__device__ index_t get_block_1d_id() { return blockIdx.x; }
Chao Liu's avatar
Chao Liu committed
15

Jianfeng Yan's avatar
Jianfeng Yan committed
16
17
__device__ index_t get_grid_size() { return gridDim.x; }

rocking's avatar
rocking committed
18
19
__device__ index_t get_block_size() { return blockDim.x; }

Chao Liu's avatar
Chao Liu committed
20
} // namespace ck