gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
kernel_code.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015-2017 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef __GPU_COMPUTE_KERNEL_CODE_HH__
33#define __GPU_COMPUTE_KERNEL_CODE_HH__
34
35#include <bitset>
36#include <cstdint>
37
38namespace gem5
39{
40
71
79
84constexpr int KernargPreloadPktSize = 256;
85
86// Kernel code object based on the table on LLVM's website:
87// https://llvm.org/docs/AMDGPUUsage.html#code-object-v3-kernel-descriptor
88typedef struct GEM5_PACKED
89{
92 uint32_t kernarg_size;
93 uint8_t reserved0[4];
95 uint8_t reserved1[20];
96
97 // the 32b below here represent the fields of
98 // the COMPUTE_PGM_RSRC3 register for GFX90A, GFX940
99 uint32_t accum_offset : 6;
101 uint32_t tg_split : 1;
103 // end COMPUTE_PGM_RSRC3 register
104
105 // the 32b below here represent the fields of
106 // the COMPUTE_PGM_RSRC1 register
109 uint32_t priority : 2;
114 uint32_t priv : 1;
115 uint32_t enable_dx10_clamp : 1;
116 uint32_t debug_mode : 1;
117 uint32_t enable_ieee_mode : 1;
118 uint32_t bulky : 1;
119 uint32_t cdbg_user : 1;
120 uint32_t fp16_ovfl : 1;
122 uint32_t wgp_mode : 1;
123 uint32_t mem_ordered : 1;
124 uint32_t fwd_progress : 1;
125 // end COMPUTE_PGM_RSRC1 register
126
127 // the 32b below here represent the fields of
128 // the COMPUTE_PGM_RSRC2 register
130 uint32_t user_sgpr_count : 5;
148 // end COMPUTE_PGM_RSRC2
149
150 // the 32b below here represent the fields of
151 // KERNEL_CODE_PROPERTIES
161 uint32_t use_dynamic_stack : 1;
163 // end KERNEL_CODE_PROPERTIES
164
167 uint8_t reserved2[4];
169static_assert(sizeof(AMDKernelCode) == 64);
170
171} // namespace gem5
172
173#endif // __GPU_COMPUTE_KERNEL_CODE_HH__
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
struct gem5::GEM5_PACKED AMDKernelCode
constexpr int KernargPreloadPktSize
The number of bytes after the dispatch packet which contain kernel arguments that should be preloaded...
ScalarRegInitFields
these enums represent the indices into the initialRegState bitfields in HsaKernelInfo.
@ WorkgroupIdX
@ DispatchId
@ NumScalarInitFields
@ DispatchPtr
@ QueuePtr
@ PrivSegWaveByteOffset
@ PrivateSegBuf
@ WorkgroupIdY
@ PrivateSegSize
@ WorkgroupInfo
@ WorkgroupIdZ
@ FlatScratchInit
@ KernargPreload
@ KernargSegPtr
VectorRegInitFields
@ WorkitemIdX
@ WorkitemIdZ
@ NumVectorInitFields
@ WorkitemIdY
PM4 packets.
uint32_t enable_sgpr_flat_scratch_init
uint32_t enable_sgpr_queue_ptr
uint32_t enable_exception_memory
uint32_t enable_exception_fp_denormal_source
uint32_t enable_exception_address_watch
uint32_t enable_private_segment
uint32_t enable_sgpr_workgroup_id_y
uint32_t enable_exception_ieee_754_fp_inexact
uint32_t enable_ieee_mode
uint32_t group_segment_fixed_size
uint32_t float_mode_round_32
uint32_t enable_exception_int_divide_by_zero
uint32_t granulated_wavefront_sgpr_count
uint32_t kernel_code_properties_reserved2
uint32_t granulated_workitem_vgpr_count
uint32_t kernarg_preload_spec_length
uint32_t enable_sgpr_dispatch_ptr
uint32_t use_dynamic_stack
uint32_t granulated_lds_size
uint32_t float_mode_round_16_64
uint32_t float_mode_denorm_16_64
uint32_t float_mode_denorm_32
uint32_t kernarg_preload_spec_offset
uint32_t enable_sgpr_workgroup_id_z
uint32_t enable_sgpr_dispatch_id
uint32_t accum_offset
uint32_t compute_pgm_rsrc1_reserved
uint32_t user_sgpr_count
uint32_t enable_dx10_clamp
uint32_t kernel_code_properties_reserved1
uint32_t enable_exception_ieee_754_fp_overflow
uint32_t compute_pgm_rsrc3_reserved1
int64_t kernel_code_entry_byte_offset
uint32_t enable_exception_ieee_754_fp_underflow
uint32_t enable_vgpr_workitem_id
uint32_t kernarg_size
uint32_t enable_sgpr_private_segment_size
uint32_t enable_sgpr_kernarg_segment_ptr
uint32_t enable_sgpr_private_segment_buffer
uint32_t enable_sgpr_workgroup_id_x
uint32_t enable_exception_ieee_754_fp_division_by_zero
uint32_t private_segment_fixed_size
uint32_t compute_pgm_rsrc3_reserved2
uint32_t enable_trap_handler
uint32_t enable_sgpr_workgroup_info
uint32_t enable_exception_ieee_754_fp_invalid_operation
uint32_t enable_wavefront_size32
uint32_t compute_pgm_rsrc2_reserved

Generated on Mon May 26 2025 09:19:10 for gem5 by doxygen 1.13.2