8 #if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
9 #ifndef CK_DONT_USE_HIP_RUNTIME_HEADERS
10 #include "hip/hip_runtime.h"
11 #include "hip/hip_fp16.h"
16 #ifndef CK_TIME_KERNEL
17 #define CK_TIME_KERNEL 1
22 #define CK_CONSTANT_ADDRESS_SPACE __attribute__((address_space(4)))
25 #define CK_USE_LAUNCH_BOUNDS 1
27 #ifdef CK_USE_LAUNCH_BOUNDS
29 #define CK_MAX_THREAD_PER_BLOCK 256
30 #define CK_MIN_BLOCK_PER_CU 2
33 #define CK_WAVELET_MAX_THREAD_PER_BLOCK 512
34 #define CK_WAVELET_MIN_BLOCK_PER_CU 2
38 #ifdef CK_USE_WAVES_PER_EU
40 #ifndef CK_MIN_WAVES_PER_EU
41 #define CK_MIN_WAVES_PER_EU 0
44 #ifndef CK_MAX_WAVES_PER_EU
45 #define CK_MAX_WAVES_PER_EU 0
49 #define CK_USE_WAVES_PER_EU 0
53 #if defined(__gfx908__) || defined(__gfx90a__) || defined(__gfx942__) || defined(__gfx950__) || \
54 defined(__gfx9_4_generic__)
57 #if defined(__gfx942__) || defined(__gfx950__) || defined(__gfx9_4_generic__)
60 #if defined(__gfx1010__) || defined(__gfx1011__) || defined(__gfx1012__)
63 #if defined(__gfx1030__) || defined(__gfx1031__) || defined(__gfx1032__) || \
64 defined(__gfx1034__) || defined(__gfx1035__) || defined(__gfx1036__) || \
65 defined(__gfx10_3_generic__)
68 #if defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__) || \
69 defined(__gfx1103__) || defined(__gfx1150__) || defined(__gfx1151__) || \
70 defined(__gfx1152__) || defined(__gfx11_generic__)
73 #if defined(__gfx1200__) || defined(__gfx1201__) || defined(__gfx12_generic__)
78 #ifndef __HIP_DEVICE_COMPILE__
79 #define CK_BUFFER_RESOURCE_3RD_DWORD -1
80 #elif defined(__gfx803__) || defined(__gfx900__) || defined(__gfx906__) || defined(__gfx9__)
81 #define CK_BUFFER_RESOURCE_3RD_DWORD 0x00020000
82 #elif defined(__gfx103__)
83 #define CK_BUFFER_RESOURCE_3RD_DWORD 0x31014000
84 #elif defined(__gfx11__) || defined(__gfx12__)
85 #define CK_BUFFER_RESOURCE_3RD_DWORD 0x31004000
89 #ifndef __HIP_DEVICE_COMPILE__
90 #elif defined(__gfx803__) || defined(__gfx900__)
91 #define CK_USE_AMD_V_MAC_F32
92 #elif defined(__gfx906__) || defined(__gfx9__) || defined(__gfx103__)
93 #define CK_USE_AMD_V_FMAC_F32
94 #define CK_USE_AMD_V_DOT2_F32_F16
95 #define CK_USE_AMD_V_DOT4_I32_I8
96 #elif defined(__gfx11__) || defined(__gfx12__)
97 #define CK_USE_AMD_V_FMAC_F32
98 #define CK_USE_AMD_V_DOT2_F32_F16
99 #define CK_USE_AMD_V_DOT4_I32_I8_GFX11
103 #ifndef __HIP_DEVICE_COMPILE__
104 #define CK_USE_AMD_MFMA
105 #elif defined(__gfx9__)
106 #define CK_USE_AMD_MFMA
109 #if(defined(__gfx90a__) || defined(__gfx94__))
110 #define CK_USE_AMD_MFMA_BF16_1K_OP
113 #if defined(__gfx94__)
114 #define CK_USE_AMD_MFMA_GFX940
118 #define CK_USE_AMD_BUFFER_LOAD 1
121 #define CK_USE_AMD_BUFFER_STORE 1
124 #define CK_USE_AMD_BUFFER_ATOMIC_ADD_INTEGER 1
127 #ifndef __HIP_DEVICE_COMPILE__
128 #define CK_USE_AMD_BUFFER_ATOMIC_ADD_FLOAT 1
129 #elif defined(__gfx9__) || defined(__gfx12__)
130 #define CK_USE_AMD_BUFFER_ATOMIC_ADD_FLOAT 1
132 #define CK_USE_AMD_BUFFER_ATOMIC_ADD_FLOAT 0
135 #if(defined(__gfx90a__) || defined(__gfx94__))
136 #define CK_USE_AMD_BUFFER_ATOMIC_MAX_FLOAT64 1
138 #define CK_USE_AMD_BUFFER_ATOMIC_MAX_FLOAT64 0
142 #define CK_USE_AMD_INLINE_ASM 1
145 #define CK_USE_AMD_V_MAC_INLINE_ASM 1
149 #define CK_USE_AMD_V_DOT_INLINE_ASM 0
152 #define CK_USE_AMD_V_DOT_DPP8_INLINE_ASM 1
155 #define CK_USE_AMD_LDS_DIRECT_LOAD_INLINE_ASM 0
158 #define CK_USE_RNE_BF16_CONVERSION 1
161 #define CK_USE_SR_F8_CONVERSION 0
164 #define CK_USE_SR_F6_CONVERSION 0
167 #define CK_USE_SR_F4_CONVERSION 0
171 #define CK_USE_PK4_LAYOUT_SHUFFLE 1
174 #define CK_EXPERIMENTAL_BLOCK_SYNC_LDS_WITHOUT_SYNC_VMEM 1
177 #define CK_EXPERIMENTAL_USE_DYNAMICALLY_INDEXED_MULTI_INDEX 0
180 #define CK_EXPERIMENTAL_STATIC_TENSOR_DESCRIPTOR 0
186 #ifndef CK_EXPERIMENTAL_USE_BUFFER_LOAD_OOB_CHECK_OFFSET_TRICK
187 #define CK_EXPERIMENTAL_USE_BUFFER_LOAD_OOB_CHECK_OFFSET_TRICK 0
189 #define CK_EXPERIMENTAL_USE_BUFFER_STORE_OOB_CHECK_OFFSET_TRICK 1
190 #define CK_EXPERIMENTAL_USE_BUFFER_ATOMIC_ADD_OOB_CHECK_OFFSET_TRICK 1
191 #define CK_EXPERIMENTAL_USE_BUFFER_ATOMIC_MAX_OOB_CHECK_OFFSET_TRICK 1
194 #define CK_EXPERIMENTAL_USE_IN_REGISTER_SUB_DWORD_TRANSPOSE 1
197 #define CK_EXPERIMENTAL_MERGE_USE_MAGIC_DIVISION 1
201 #define CK_EXPERIMENTAL_USE_MEMCPY_FOR_VECTOR_ACCESS 0
204 #define CK_EXPERIMENTAL_USE_MEMCPY_FOR_BIT_CAST 1
207 #define CK_EXPERIMENTAL_INTER_WAVE_SCHEDULING 1
208 #define CK_EXPERIMENTAL_INTER_WAVE_SCHEDULING_MAC_CLUSTERS 1
210 #define CK_EXPERIMENTAL_DEFAULT_TO_INTER_WAVE_SCHEDULING 0
212 #define CK_EXPERIMENTAL_INTER_WAVE_INSTANCES 1
214 #define CK_EXPERIMENTAL_PIPELINE_V2_INSTANCES 1
216 #ifndef CK_EXPERIMENTAL_PIPELINE_V2_IGLP_OPT
217 #define CK_EXPERIMENTAL_PIPELINE_V2_IGLP_OPT 0
224 #define CK_HACK_MERGE_CALCULATE_IDX_DIFF_LOW_CONST_USE_AMD_GCN_READ_FIRST_LANE 0
227 #define CK_WORKAROUND_SWDEV_275126 1
230 #define CK_WORKAROUND_SWDEV_XXXXXX_INT8_BUFFER_LOAD_STORE_ISSUE 1
233 #define CK_WORKAROUND_SWDEV_XXXXXX_INT8_DS_WRITE_ISSUE 1
237 #define CK_WORKAROUND_SWDEV_325164 0
240 #define CK_WORKAROUND_SWDEV_383542 1
243 #define CK_WORKAROUND_SWDEV_388832 1
246 #define CK_WORKAROUND_FP16_TO_FP8_CONVERSION 1
249 #define CK_WORKAROUND_BF16_TO_FP8_CONVERSION 1
252 #ifndef CK_GFX90A_DENORM_WORKAROUND
253 #define CK_GFX90A_DENORM_WORKAROUND 0
256 #if defined(__gfx90a__)
257 #if CK_GFX90A_DENORM_WORKAROUND
258 #define CK_GFX90A_DENORM_WORKAROUND 1
261 #define CK_GFX90A_DENORM_WORKAROUND 0
265 #define CK_BUILD_DEPRECATED 1
269 #if defined(__GFX9__) || !defined(__HIP_DEVICE_COMPILE__)
270 __device__
static constexpr
int WarpSize = 64;
272 __device__
static constexpr
int WarpSize = 32;
287 static constexpr
int mSize =
sizeof...(Is);
InMemoryDataOperationEnum
Definition: ck.hpp:276
int64_t long_index_t
Definition: ck.hpp:299
long int64_t
Definition: data_type.hpp:461
int32_t index_t
Definition: ck.hpp:298
signed int int32_t
Definition: stdint.h:123
__host__ static constexpr __device__ InMemoryDataOperationEnum At(int I)
Definition: ck.hpp:289
static constexpr int mSize
Definition: ck.hpp:287