mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-04 13:41:24 +00:00
29 lines
724 B
C++
29 lines
724 B
C++
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2018-2022, Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ck/ck.hpp"
|
|
|
|
namespace ck {
|
|
|
|
__host__ __device__ constexpr index_t get_warp_size()
|
|
{
|
|
// warpSize is defined by HIP
|
|
return warpSize;
|
|
}
|
|
|
|
__device__ index_t get_thread_local_1d_id() { return threadIdx.x; }
|
|
|
|
__device__ index_t get_thread_global_1d_id() { return blockIdx.x * blockDim.x + threadIdx.x; }
|
|
|
|
__device__ index_t get_warp_local_1d_id() { return threadIdx.x / get_warp_size(); }
|
|
|
|
__device__ index_t get_block_1d_id() { return blockIdx.x; }
|
|
|
|
__device__ index_t get_grid_size() { return gridDim.x; }
|
|
|
|
__device__ index_t get_block_size() { return blockDim.x; }
|
|
|
|
} // namespace ck
|