SWDEV-322605 - Fix infinite loop condition

If GlobalMemCacheLine reported is 0, runtime may run into an
infinite loop as the KernelSegmentAlignment is chosen as size of the
cache line.

Change-Id: Ide547940cc0407f16fab10ee210b4fd3ae4eaafc
This commit is contained in:
Saleel Kudchadker
2022-02-10 23:50:32 -08:00
parent 3fd4a67670
commit 041ddc0c1c
2 ha cambiato i file con 30 aggiunte e 26 eliminazioni
+3 -1
Vedi File
@@ -56,7 +56,9 @@ bool LightningKernel::postLoad() {
symbolName_ = name();
}
kernargSegmentAlignment_ =
amd::alignUp(std::max(kernargSegmentAlignment_, 128u), device().info().globalMemCacheLineSize_);
amd::alignUp(std::max(kernargSegmentAlignment_, 128u),
device().info().globalMemCacheLineSize_ > 0 ?
device().info().globalMemCacheLineSize_ : 64);
// Set the workgroup information for the kernel
workGroupInfo_.availableLDSSize_ = device().info().localMemSizePerCU_;