Skip to content

Commit 90da14a

Browse files
jfuentesigcbot
authored andcommitted
Changes in code.
1 parent ac0e352 commit 90da14a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

visa/IsaVerification.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ SPDX-License-Identifier: MIT
2020
#include "VISAKernel.h"
2121

2222
#include "G4_IR.hpp"
23+
#include "G4_Kernel.hpp"
2324
/* stdio.h portability code start */
2425
#ifdef _WIN32
2526
#else
@@ -4490,6 +4491,9 @@ void vISAVerifier::verifyKernelHeader() {
44904491
}
44914492
}
44924493

4494+
GRFMode GRFInfo(irBuilder->getPlatform(), options);
4495+
unsigned GRFNumber = GRFInfo.getMaxGRF();
4496+
44934497
// [Begin, end) is an interval for each input. We check two things
44944498
// - no overlap
44954499
// - do not overflow i.e. end < 32 * (256 - 1)
@@ -4502,7 +4506,7 @@ void vISAVerifier::verifyKernelHeader() {
45024506
continue;
45034507
unsigned Begin = pi->offset;
45044508
unsigned End = Begin + pi->size;
4505-
if (End >= (uint32_t)(irBuilder->getGRFSize() * (256 - 1))) {
4509+
if (End >= (uint32_t)(irBuilder->getGRFSize() * (GRFNumber - 1))) {
45064510
REPORT_HEADER(options, false, "Input V%d is out of bound [%d, %d)",
45074511
pi->index, Begin, End);
45084512
}

0 commit comments

Comments
 (0)