mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-12 01:10:17 +00:00
* SWDEV-535598 - remove usage of 'warpSize' variable as it has been deprecated. Ideally get_warp_size() should not be constexpr but this is just a workaround * SWDEV-535598 - remove comment from get_warp_size as constexpr is required for this repo --------- Co-authored-by: Gerardo Hernandez <gerardo.hernandez@amd.com>
32 lines
770 B
C++
32 lines
770 B
C++
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ck/ck.hpp"
|
|
|
|
namespace ck {
|
|
|
|
__host__ __device__ constexpr index_t get_warp_size()
|
|
{
|
|
#if defined(__GFX9__) || !defined(__HIP_DEVICE_COMPILE__)
|
|
return 64;
|
|
#else
|
|
return 32;
|
|
#endif
|
|
}
|
|
|
|
__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
|