mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 12:11:31 +08:00
fix: prevent underflow in per thread data offset calculation
Related-To: NEO-14719 Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6368f43df8
commit
b462f990b6
@@ -273,3 +273,20 @@ TEST(KernelDescriptor, GivenDescriptorWithoutStatefulArgsWhenInitBindlessOffsets
|
||||
desc.initBindlessOffsetToSurfaceState();
|
||||
EXPECT_EQ(0u, desc.bindlessArgsMap.size());
|
||||
}
|
||||
|
||||
TEST(KernelDescriptor, GivenDescriptorWhenGettingPerThreadDataOffsetThenItReturnsCorrectValue) {
|
||||
NEO::KernelDescriptor desc{};
|
||||
|
||||
desc.kernelAttributes.crossThreadDataSize = 64u;
|
||||
desc.kernelAttributes.inlineDataPayloadSize = 64u;
|
||||
EXPECT_EQ(0u, desc.getPerThreadDataOffset());
|
||||
|
||||
// crossThreadData is fully consumed by inlineDataPayload
|
||||
desc.kernelAttributes.crossThreadDataSize = 40u;
|
||||
desc.kernelAttributes.inlineDataPayloadSize = 64u;
|
||||
EXPECT_EQ(0u, desc.getPerThreadDataOffset());
|
||||
|
||||
desc.kernelAttributes.crossThreadDataSize = 128u;
|
||||
desc.kernelAttributes.inlineDataPayloadSize = 64u;
|
||||
EXPECT_EQ(64u, desc.getPerThreadDataOffset());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user