thread_group.hpp Source File

thread_group.hpp Source File#

Composable Kernel: thread_group.hpp Source File
thread_group.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
3
4#pragma once
5
6#include "get_id.hpp"
7
8namespace ck {
9
10template <index_t ThreadPerBlock>
12{
13 static constexpr index_t kNumThread_ = ThreadPerBlock;
14
15 __device__ static constexpr index_t GetNumOfThread() { return kNumThread_; }
16
17 __device__ static constexpr bool IsBelong() { return true; }
18
19 __device__ static index_t GetThreadId() { return get_thread_local_1d_id(); }
20};
21
22} // namespace ck
Definition ck.hpp:268
int32_t index_t
Definition ck.hpp:299
__device__ index_t get_thread_local_1d_id()
Definition get_id.hpp:41
Definition thread_group.hpp:12
static __device__ constexpr index_t GetNumOfThread()
Definition thread_group.hpp:15
static __device__ constexpr bool IsBelong()
Definition thread_group.hpp:17
static __device__ index_t GetThreadId()
Definition thread_group.hpp:19
static constexpr index_t kNumThread_
Definition thread_group.hpp:13