gem5 v24.0.0.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
70
78
79// Kernel code object based on the table on LLVM's website:
80// https://llvm.org/docs/AMDGPUUsage.html#code-object-v3-kernel-descriptor
81typedef struct GEM5_PACKED
82{
85 uint32_t kernarg_size;
86 uint8_t reserved0[4];
88 uint8_t reserved1[20];
89
90 // the 32b below here represent the fields of
91 // the COMPUTE_PGM_RSRC3 register for GFX90A, GFX940
92 uint32_t accum_offset : 6;
94 uint32_t tg_split : 1;
96 // end COMPUTE_PGM_RSRC3 register
97
98 // the 32b below here represent the fields of
99 // the COMPUTE_PGM_RSRC1 register
102 uint32_t priority : 2;
107 uint32_t priv : 1;
108 uint32_t enable_dx10_clamp : 1;
109 uint32_t debug_mode : 1;
110 uint32_t enable_ieee_mode : 1;
111 uint32_t bulky : 1;
112 uint32_t cdbg_user : 1;
113 uint32_t fp16_ovfl : 1;
115 uint32_t wgp_mode : 1;
116 uint32_t mem_ordered : 1;
117 uint32_t fwd_progress : 1;
118 // end COMPUTE_PGM_RSRC1 register
119
120 // the 32b below here represent the fields of
121 // the COMPUTE_PGM_RSRC2 register
123 uint32_t user_sgpr_count : 5;
141 // end COMPUTE_PGM_RSRC2
142
143 // the 32b below here represent the fields of
144 // KERNEL_CODE_PROPERTIES
154 uint32_t use_dynamic_stack : 1;
156 // end KERNEL_CODE_PROPERTIES
157
160 uint8_t reserved2[4];
162static_assert(sizeof(AMDKernelCode) == 64);
163
164} // namespace gem5
165
166#endif // __GPU_COMPUTE_KERNEL_CODE_HH__
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
struct gem5::GEM5_PACKED AMDKernelCode
ScalarRegInitFields
these enums represent the indices into the initialRegState bitfields in HsaKernelInfo.
@ WorkgroupIdX
@ DispatchId
@ NumScalarInitFields
@ DispatchPtr
@ QueuePtr
@ PrivSegWaveByteOffset
@ PrivateSegBuf
@ WorkgroupIdY
@ PrivateSegSize
@ WorkgroupInfo
@ WorkgroupIdZ
@ FlatScratchInit
@ 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 Tue Jun 18 2024 16:24:04 for gem5 by doxygen 1.11.0