Skip to content

Commit 97216de

Browse files
pratikasharigcbot
authored andcommitted
Fix build error
Fix build error
1 parent ed7180a commit 97216de

File tree

11 files changed

+22
-2
lines changed

11 files changed

+22
-2
lines changed

IGC/AdaptorOCL/OCL/KernelAnnotations.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ struct ExecutionEnivronment
307307
bool UseBindlessMode = false;
308308
uint64_t SIMDInfo = 0;
309309
bool HasDPAS = false;
310+
bool HasStackCalls = false;
310311
};
311312

312313
struct KernelTypeProgramBinaryInfo

IGC/AdaptorOCL/OCL/Patch/patch_parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ void DebugPatchList(
895895
ICBE_DPF_STR(output, GFXDBG_HARDWARE,
896896
"\tUseBindlessMode = %d\n",
897897
pPatchItem->UseBindlessMode);
898+
ICBE_DPF_STR(output, GFXDBG_HARDWARE,
899+
"\tHasStackCalls = %d\n",
900+
pPatchItem->HasStackCalls);
898901
ICBE_DPF_STR(output, GFXDBG_HARDWARE,
899902
"\tSIMDInfo = %lld\n",
900903
pPatchItem->SIMDInfo);

IGC/AdaptorOCL/OCL/sp/sp_g8.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,7 @@ RETVAL CGen8OpenCLStateProcessor::CreatePatchList(
19861986
patch.HasDPAS = annotations.m_executionEnivronment.HasDPAS;
19871987

19881988
patch.UseBindlessMode = annotations.m_executionEnivronment.UseBindlessMode;
1989+
patch.HasStackCalls = annotations.m_executionEnivronment.HasStackCalls;
19891990
patch.SIMDInfo = annotations.m_executionEnivronment.SIMDInfo;
19901991

19911992
retValue = AddPatchItem(

IGC/AdaptorOCL/OCL/sp/zebin_builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ void ZEBinaryBuilder::addKernelExecEnv(const SOpenCLKernelInfo& annotations,
470470
env.work_group_walk_order_dimensions.push_back(annotations.m_executionEnivronment.WorkgroupWalkOrder[1]);
471471
env.work_group_walk_order_dimensions.push_back(annotations.m_executionEnivronment.WorkgroupWalkOrder[2]);
472472
}
473+
env.has_stack_calls = annotations.m_executionEnivronment.HasStackCalls;
473474
}
474475

475476
void ZEBinaryBuilder::addLocalIds(uint32_t simdSize, uint32_t grfSize,

IGC/AdaptorOCL/ocl_igc_shared/executable_format/patch_shared.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ struct SPatchExecutionEnvironment :
198198
uint32_t StatelessWritesCount;
199199
uint32_t IndirectStatelessCount;
200200
uint32_t UseBindlessMode;
201+
uint32_t HasStackCalls;
201202
uint64_t SIMDInfo;
202203
};
203204

204205
// Update CURRENT_ICBE_VERSION when modifying the patch list
205-
static_assert(sizeof(SPatchExecutionEnvironment) == (124 + sizeof(SPatchItemHeader)), "The size of SPatchExecutionEnvironment is not what is expected");
206+
static_assert(sizeof(SPatchExecutionEnvironment) == (128 + sizeof(SPatchItemHeader)), "The size of SPatchExecutionEnvironment is not what is expected");
206207

207208
/*****************************************************************************\
208209
STRUCT: SPatchString

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10691,6 +10691,9 @@ void EmitPass::InitializeKernelStack(Function* pKernel)
1069110691

1069210692
// Set the total alloca size for the entry function
1069310693
m_encoder->SetFunctionAllocaStackSize(pKernel, totalAllocaSize);
10694+
10695+
if (m_FGA && m_FGA->getGroup(pKernel) && m_FGA->getGroup(pKernel)->hasStackCall())
10696+
m_currShader->SetHasStackCalls();
1069410697
}
1069510698

1069610699
// Either do a block load or store to the stack-pointer given a vector of function arguments

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@ namespace IGC
18901890

18911891

18921892
m_kernelInfo.m_executionEnivronment.UseBindlessMode = m_Context->m_InternalOptions.UseBindlessMode;
1893+
m_kernelInfo.m_executionEnivronment.HasStackCalls = HasStackCalls();
18931894
}
18941895

18951896
void COpenCLKernel::RecomputeBTLayout()

IGC/Compiler/CISACodeGen/ShaderCodeGen.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ class CShader
523523
unsigned int GetPrimitiveTypeSizeInRegister(const llvm::Type* Ty) const;
524524
unsigned int GetScalarTypeSizeInRegisterInBits(const llvm::Type* Ty) const;
525525
unsigned int GetScalarTypeSizeInRegister(const llvm::Type* Ty) const;
526+
527+
bool HasStackCalls() const { return m_HasStackCalls; }
528+
void SetHasStackCalls() { m_HasStackCalls = true; }
529+
526530
protected:
527531
bool CompileSIMDSizeInCommon(SIMDMode simdMode);
528532
uint32_t GetShaderThreadUsageRate();
@@ -644,6 +648,8 @@ class CShader
644648
uint32_t m_IndirectStatelessCount = 0;
645649

646650
DebugInfoData diData;
651+
652+
bool m_HasStackCalls = false;
647653
};
648654

649655
/// This class contains the information for the different SIMD version

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct zeInfoExecutionEnv
3232
{
3333
bool operator==(const zeInfoExecutionEnv& other) const
3434
{
35-
return barrier_count == other.barrier_count && disable_mid_thread_preemption == other.disable_mid_thread_preemption && grf_count == other.grf_count && has_4gb_buffers == other.has_4gb_buffers && has_device_enqueue == other.has_device_enqueue && has_dpas == other.has_dpas && has_fence_for_image_access == other.has_fence_for_image_access && has_global_atomics == other.has_global_atomics && has_multi_scratch_spaces == other.has_multi_scratch_spaces && has_no_stateless_write == other.has_no_stateless_write && offset_to_skip_per_thread_data_load == other.offset_to_skip_per_thread_data_load && offset_to_skip_set_ffid_gp == other.offset_to_skip_set_ffid_gp && required_sub_group_size == other.required_sub_group_size && required_work_group_size == other.required_work_group_size && simd_size == other.simd_size && slm_size == other.slm_size && subgroup_independent_forward_progress == other.subgroup_independent_forward_progress && work_group_walk_order_dimensions == other.work_group_walk_order_dimensions;
35+
return barrier_count == other.barrier_count && disable_mid_thread_preemption == other.disable_mid_thread_preemption && grf_count == other.grf_count && has_4gb_buffers == other.has_4gb_buffers && has_device_enqueue == other.has_device_enqueue && has_dpas == other.has_dpas && has_fence_for_image_access == other.has_fence_for_image_access && has_global_atomics == other.has_global_atomics && has_multi_scratch_spaces == other.has_multi_scratch_spaces && has_no_stateless_write == other.has_no_stateless_write && offset_to_skip_per_thread_data_load == other.offset_to_skip_per_thread_data_load && offset_to_skip_set_ffid_gp == other.offset_to_skip_set_ffid_gp && required_sub_group_size == other.required_sub_group_size && required_work_group_size == other.required_work_group_size && simd_size == other.simd_size && slm_size == other.slm_size && subgroup_independent_forward_progress == other.subgroup_independent_forward_progress && work_group_walk_order_dimensions == other.work_group_walk_order_dimensions && has_stack_calls == other.has_stack_calls;
3636
}
3737
zeinfo_int32_t barrier_count = 0;
3838
zeinfo_bool_t disable_mid_thread_preemption = false;
@@ -52,6 +52,7 @@ struct zeInfoExecutionEnv
5252
zeinfo_int32_t slm_size = 0;
5353
zeinfo_bool_t subgroup_independent_forward_progress = false;
5454
std::vector<zeinfo_int32_t> work_group_walk_order_dimensions;
55+
zeinfo_bool_t has_stack_calls = false;
5556
};
5657
struct zeInfoPayloadArgument
5758
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void MappingTraits<zeInfoExecutionEnv>::mapping(IO& io, zeInfoExecutionEnv& info
5555
io.mapOptional("slm_size", info.slm_size, 0);
5656
io.mapOptional("subgroup_independent_forward_progress", info.subgroup_independent_forward_progress, false);
5757
io.mapOptional("work_group_walk_order_dimensions", info.work_group_walk_order_dimensions);
58+
io.mapOptional("has_stack_calls", info.has_stack_calls, false);
5859
}
5960
void MappingTraits<zeInfoPayloadArgument>::mapping(IO& io, zeInfoPayloadArgument& info)
6061
{

IGC/ZEBinWriter/zebin/spec/zeinfo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ If an attribute is **Required**, it must be present in exection_env. If it's **O
106106
| slm_size | int32 | Optional | 0 | SLM size in bytes |
107107
| subgroup_independent_forward_progress | bool | Optional | false | |
108108
| work_group_walk_order_dimensions | int32x3 | Optional | [0, 1, 2] | The value of this key is a sequence of three int32. Valid values are x: [0, 0, 0] , xy: [0, 1, 0], xyz: [0, 1, 2], yx: [1, 0, 0], zyx: [2, 1, 0] |
109+
| has_stack_calls | bool | Optional | false | when this value is true, it indicates that program uses stack calls |
109110
<!--- ExecutionEnv -->
110111

111112
## Payload Arguments

0 commit comments

Comments
 (0)