/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/utility/thread_group.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/utility/thread_group.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/utility/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 
8 namespace ck {
9 
10 template <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:267
int32_t index_t
Definition: ck.hpp:298
__device__ index_t get_thread_local_1d_id()
Definition: get_id.hpp:52
Definition: thread_group.hpp:12
static __device__ index_t GetThreadId()
Definition: thread_group.hpp:19
static constexpr index_t kNumThread_
Definition: thread_group.hpp:13
static constexpr __device__ bool IsBelong()
Definition: thread_group.hpp:17
static constexpr __device__ index_t GetNumOfThread()
Definition: thread_group.hpp:15