Skip to content

Commit 6e1e358

Browse files
smilczekigcbot
authored andcommitted
OpenCLProgramContext::getExpGRFSize TotalGRFSize flag check
This commit adds a check for TotalGRFNum flag value before trying to return the value passed from api option.
1 parent 84b432b commit 6e1e358

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ namespace IGC
8585
}
8686

8787
uint32_t OpenCLProgramContext::getExpGRFSize() const {
88+
if (IGC_GET_FLAG_VALUE(TotalGRFNum))
89+
{
90+
return IGC_GET_FLAG_VALUE(TotalGRFNum);
91+
}
8892
if (m_InternalOptions.IntelExpGRFSize) {
8993
return m_InternalOptions.expGRFSize;
9094
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2025 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; REQUIRES: regkeys,pvc-supported,llvm-14-plus
10+
11+
; RUN: llvm-as %s -o %t.bc
12+
; RUN: ocloc compile -llvm_input -file %t.bc -device pvc -options " -ze-exp-register-file-size=64 -igc_opts 'TotalGRFNum=256,DumpVISAASMToConsole=1'" 2>&1 | FileCheck %s --check-prefixes=CHECK
13+
14+
; Check that IGC_TotalGRFNum flag takes precedence over the value passed with -ze-exp-register-file-size api option.
15+
16+
; CHECK: //Build option: {{.*}} -TotalGRFNum 256
17+
; CHECK-NOT: //Build option: {{.*}} -TotalGRFNum 64
18+
19+
20+
; Typed pointer arg for the purpose of omitting error.
21+
define spir_kernel void @foo(i8 addrspace(1)* %p1) {
22+
ret void
23+
}

0 commit comments

Comments
 (0)