Skip to content

Commit 067150b

Browse files
kychendevigcbot
authored andcommitted
Bug fix in translating pseudo_input argument.
Fixed a bug in translating vISA asm file that contains pseudo_input argument, which results in invalid kernel prologue code for loading cross thread payload._
1 parent c8332b3 commit 067150b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

visa/BuildCISAIRImpl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,8 +2406,8 @@ bool CISA_IR_Builder::CISA_implicit_input_directive(const char *argName,
24062406
auto implicitInputName =
24072407
implicitArgName.substr(implicitStr.length(), implicitArgName.length());
24082408
for (; numVal < IMPLICIT_INPUT_COUNT; ++numVal) {
2409-
if (!implicitInputName.compare(
2410-
input_info_t::getImplicitKindString(numVal))) {
2409+
if (!implicitInputName.compare(implictKindStrings[numVal])) {
2410+
numVal = implictKindValues[numVal];
24112411
break;
24122412
}
24132413
}
@@ -2419,8 +2419,8 @@ bool CISA_IR_Builder::CISA_implicit_input_directive(const char *argName,
24192419
RecordParseError(lineNum, varName, ": undefined variable");
24202420
return false;
24212421
}
2422-
status = m_kernel->CreateVISAImplicitInputVar((VISA_GenVar *)temp, offset,
2423-
size, numVal);
2422+
status = m_kernel->CreateVISAImplicitInputVar(
2423+
(VISA_GenVar *)temp, offset, size, numVal);
24242424
if (status != VISA_SUCCESS) {
24252425
RecordParseError(lineNum, "failed to create input variable");
24262426
return false;

visa/Common_ISA.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ SPDX-License-Identifier: MIT
1616
const char *implictKindStrings[IMPLICIT_INPUT_COUNT] = {
1717
"EXPLICIT", "LOCAL_SIZE", "GROUP_COUNT", "LOCAL_ID", "PSEUDO_INPUT"};
1818

19+
const int implictKindValues[IMPLICIT_INPUT_COUNT] = {
20+
INPUT_EXPLICIT, LOCAL_SIZE, GROUP_COUNT, LOCAL_ID, PSEUDO_INPUT};
21+
1922
const char *Rel_op_str[ISA_CMP_UNDEF + 1] = {"eq", // equal
2023
"ne", // not equal
2124
"gt", // greater

visa/Common_ISA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ enum Common_ISA_Implicit_Input_Kind {
6767
};
6868

6969
extern const char *implictKindStrings[IMPLICIT_INPUT_COUNT];
70+
extern const int implictKindValues[IMPLICIT_INPUT_COUNT];
7071

7172
enum Common_ISA_Operand_Class {
7273
OPERAND_GENERAL = 0x0,

0 commit comments

Comments
 (0)