utility.hpp 402 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
2
#ifndef CK_UTILITY_HPP
#define CK_UTILITY_HPP
3

Chao Liu's avatar
Chao Liu committed
4
5
#include "config.hpp"

6
namespace ck {
Chao Liu's avatar
Chao Liu committed
7

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

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

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

Chao Liu's avatar
Chao Liu committed
16
} // namespace ck
17
18

#endif