Skip to content

Commit 624d294

Browse files
DianaChenigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 223ccfd
ZEBinary: add buffer_address to payload_arguments::arg_type Add new payload_arg::arg_type::buffer_address to represent the buffer address for stateful access only argument. The buffer address is needed when a buffer is fully promoted to stateful but the value of its adderss is used in the kernel. E.g. "if(buffer == nullptr)"
1 parent 193a064 commit 624d294

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

+7-13
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,9 @@ namespace IGC
659659
zebin::ZEInfoBuilder::addBindingTableIndex(m_kernelInfo.m_zeBTIArgs,
660660
bti_idx, arg_idx);
661661
}
662-
663-
// check if all reference are promoted, if it is, we can skip creating stateless payload arg
662+
// FIXME: check if all reference are promoted, if it is, we can skip
663+
// creating non-bti payload arg
664+
/*
664665
bool is_bti_only =
665666
IGC_IS_FLAG_ENABLED(EnableStatelessToStateful) &&
666667
IGC_IS_FLAG_ENABLED(EnableStatefulToken) &&
@@ -670,18 +671,11 @@ namespace IGC
670671
(kernelArg->getArg()->use_empty() || !GetHasGlobalStatelessAccess())) ||
671672
(kernelArg->getArgType() == KernelArg::ArgType::PTR_CONSTANT &&
672673
(kernelArg->getArg()->use_empty() || !GetHasConstantStatelessAccess())));
673-
674-
if (is_bti_only) {
675-
// create buffer_address for statefull only arg in case of address check is needed
676-
// for example: something like "if(buffer != nullptr)" in the kernel.
677-
// this address will be accessed as a value and cannot be de-referenced
678-
zebin::zeInfoPayloadArgument& arg = zebin::ZEInfoBuilder::addPayloadArgumentImplicit(m_kernelInfo.m_zePayloadArgs,
679-
zebin::PreDefinedAttrGetter::ArgType::buffer_address,
680-
payloadPosition, kernelArg->getAllocateSize());
681-
arg.arg_index = kernelArg->getAssociatedArgNo();
682-
arg.offset = payloadPosition;
674+
// no need to add normal argument if all use are promoted
675+
if (is_bti_only)
683676
break;
684-
}
677+
*/
678+
685679
ResourceAllocMD& resAllocMD = GetContext()->getModuleMetaData()->FuncMD[entry].resAllocMD;
686680
IGC_ASSERT_MESSAGE(resAllocMD.argAllocMDList.size() > 0, "ArgAllocMDList is empty.");
687681

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ struct zeInfoContainer
176176
HostAccessesTy global_host_access_table;
177177
};
178178
struct PreDefinedAttrGetter{
179-
static zeinfo_str_t getVersionNumber() { return "1.15"; }
179+
static zeinfo_str_t getVersionNumber() { return "1.14"; }
180180

181181
enum class ArgThreadSchedulingMode {
182182
age_based,
@@ -193,7 +193,6 @@ struct PreDefinedAttrGetter{
193193
enqueued_local_size,
194194
global_id_offset,
195195
private_base_stateless,
196-
buffer_address,
197196
buffer_offset,
198197
printf_buffer,
199198
implicit_arg_buffer,
@@ -261,8 +260,6 @@ struct PreDefinedAttrGetter{
261260
return "global_id_offset";
262261
case ArgType::private_base_stateless:
263262
return "private_base_stateless";
264-
case ArgType::buffer_address:
265-
return "buffer_address";
266263
case ArgType::buffer_offset:
267264
return "buffer_offset";
268265
case ArgType::printf_buffer:

IGC/ZEBinWriter/zebin/spec/zeinfo.md

+1-3
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.15
10+
Version 1.14
1111

1212
## Grammar
1313

@@ -166,7 +166,6 @@ Supported <argument_type> of payload_arguments or per_thread_payload_arguments.
166166
| enqueued_local_size | int32x3 | OpenCL specific feature. The size returned by OCL get_enqueued_local_size API |
167167
| global_id_offset | int32x3 | |
168168
| private_base_stateless | int64 | The base address of private buffer specified at per_thread_memory_buffers |
169-
| buffer_address | | The address for buffer reference of stateful only memory access. |
170169
| buffer_offset | | The extra offset for buffer reference to satisfy the alignment requirement of stateful memory access. |
171170
| printf_buffer | | The address of printf_buffer which holds the printf strings information. |
172171
| implicit_arg_buffer | int64 | The base address of implicit arg buffer |
@@ -301,7 +300,6 @@ Format: \<_Major number_\>.\<_Minor number_\>
301300
- Minor number: Increase when backward-compatible features are added. For example, add new attributes.
302301

303302
## Change Note
304-
- **Version 1.15**: Add buffer_address to payload argument type.
305303
- **Version 1.14**: Add slm_alignment to payload argument.
306304
- **Version 1.13**: Add functions with the name and execution env.
307305
- **Version 1.12**: Add global_host_access_table to container.

0 commit comments

Comments
 (0)