Skip to content

Commit 3614379

Browse files
DianaChenigcbot
authored andcommitted
ZEBinary: Add implicit argument type "work_dimensions"
ZEBinary: support work_dimensions implicit argument and execution_env attribute has_dpas
1 parent b4ad023 commit 3614379

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,12 @@ namespace IGC
533533
payloadPosition, iOpenCL::DATA_PARAMETER_DATA_SIZE * 3);
534534
break;
535535

536+
case KernelArg::ArgType::IMPLICIT_WORK_DIM:
537+
zebin::ZEInfoBuilder::addPayloadArgumentImplicit(m_kernelInfo.m_zePayloadArgs,
538+
zebin::PreDefinedAttrGetter::ArgType::work_dimensions,
539+
payloadPosition, iOpenCL::DATA_PARAMETER_DATA_SIZE);
540+
break;
541+
536542
// pointer args
537543
case KernelArg::ArgType::PTR_GLOBAL:
538544
case KernelArg::ArgType::PTR_CONSTANT: {

IGC/ZEBinWriter/zebin/source/autogen/ZEInfo.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct zeInfoExecutionEnv
3636
zeinfo_int32_t grf_count = 0;
3737
zeinfo_bool_t has_4gb_buffers = false;
3838
zeinfo_bool_t has_device_enqueue = false;
39+
zeinfo_bool_t has_dpas = false;
3940
zeinfo_bool_t has_fence_for_image_access = false;
4041
zeinfo_bool_t has_global_atomics = false;
4142
zeinfo_bool_t has_multi_scratch_spaces = false;
@@ -107,13 +108,14 @@ struct zeInfoContainer
107108
KernelsTy kernels;
108109
};
109110
struct PreDefinedAttrGetter{
110-
static zeinfo_str_t getVersionNumber() { return "1.4"; }
111+
static zeinfo_str_t getVersionNumber() { return "1.5"; }
111112

112113
enum class ArgType {
113114
packed_local_ids,
114115
local_id,
115116
local_size,
116117
group_count,
118+
work_dimensions,
117119
global_size,
118120
enqueued_local_size,
119121
global_id_offset,
@@ -161,6 +163,8 @@ struct PreDefinedAttrGetter{
161163
return "local_size";
162164
case ArgType::group_count:
163165
return "group_count";
166+
case ArgType::work_dimensions:
167+
return "work_dimensions";
164168
case ArgType::global_size:
165169
return "global_size";
166170
case ArgType::enqueued_local_size:

IGC/ZEBinWriter/zebin/source/autogen/ZEInfoYAML.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void MappingTraits<zeInfoExecutionEnv>::mapping(IO& io, zeInfoExecutionEnv& info
4242
io.mapRequired("grf_count", info.grf_count);
4343
io.mapOptional("has_4gb_buffers", info.has_4gb_buffers, false);
4444
io.mapOptional("has_device_enqueue", info.has_device_enqueue, false);
45+
io.mapOptional("has_dpas", info.has_dpas, false);
4546
io.mapOptional("has_fence_for_image_access", info.has_fence_for_image_access, false);
4647
io.mapOptional("has_global_atomics", info.has_global_atomics, false);
4748
io.mapOptional("has_multi_scratch_spaces", info.has_multi_scratch_spaces, false);

IGC/ZEBinWriter/zebin/spec/zeinfo.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SPDX-License-Identifier: MIT
77
============================= end_copyright_notice ==========================-->
88

99
# ZE Info
10-
Version 1.4
10+
Version 1.5
1111

1212
## Grammar
1313

@@ -138,6 +138,7 @@ Supported <argument_type> of payload_arguments or per_thread_payload_arguments.
138138
| local_id | int16 x N x n | N is the simd_size <br> n is the number of dimensions derived from work_group_walk_order_dimensions <br> Per id have to be GRF aligned |
139139
| local_size | int32x3 | Number of work-items in a group |
140140
| group_count | int32x3 | Number of group |
141+
| work_dimensions | int32 | Work dimensions |
141142
| global_size | int32x3 | OpenCL specific feacture. The total number of work-items in each dimension |
142143
| enqueued_local_size | int32x3 | OpenCL specific feature. The size returned by OCL get_enqueued_local_size API |
143144
| global_id_offset | int32x3 | |
@@ -256,6 +257,7 @@ Format: \<_Major number_\>.\<_Minor number_\>
256257
- Minor number: Increase when backward-compatible features are added. For example, add new attributes.
257258

258259
## Change Note
260+
- **Version 1.5**: Add payload_argument type work_dimensions.
259261
- **Version 1.4**: Add sampler_index to payload arguments.
260262
- **Version 1.3**: Add printf_buffer to argument_type.
261263
- **Version 1.2**: Add buffer_offset to argument_type.

0 commit comments

Comments
 (0)