Improve getGRFsPerThread helper

Change-Id: I8d4d2ce35ca6f6054e74930e6a936fc2e49bfcc3
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2020-02-24 13:21:37 +01:00
committed by sys_ocldev
parent 49aac737a7
commit 5751b5eb27
3 changed files with 17 additions and 10 deletions

View File

@@ -18,19 +18,26 @@
using namespace NEO;
TEST(LocalID, GivenSimd8WhenGettingGrfsPerThreadThenOneIsReturned) {
using LocalIdTests = ::testing::Test;
HWTEST_F(LocalIdTests, GivenSimd8WhenGettingGrfsPerThreadThenOneIsReturned) {
uint32_t simd = 8;
EXPECT_EQ(1u, getGRFsPerThread(simd));
EXPECT_EQ(1u, getGRFsPerThread(simd, 32));
}
TEST(LocalID, GivenSimd16WhenGettingGrfsPerThreadThenOneIsReturned) {
HWTEST_F(LocalIdTests, GivenSimd16WhenGettingGrfsPerThreadThenOneIsReturned) {
uint32_t simd = 16;
EXPECT_EQ(1u, getGRFsPerThread(simd));
EXPECT_EQ(1u, getGRFsPerThread(simd, 32));
}
TEST(LocalID, GivenSimd32WhenGettingGrfsPerThreadThenTwoIsReturned) {
HWTEST_F(LocalIdTests, GivenSimd32WhenGettingGrfsPerThreadThenTwoIsReturned) {
uint32_t simd = 32;
EXPECT_EQ(2u, getGRFsPerThread(simd));
EXPECT_EQ(2u, getGRFsPerThread(simd, 32));
}
HWTEST_F(LocalIdTests, GivenSimd32AndNon32GrfSizeWhenGettingGrfsPerThreadThenTwoIsReturned) {
uint32_t simd = 32;
EXPECT_EQ(1u, getGRFsPerThread(simd, 33));
}
TEST(LocalID, GivenSimd32AndLws33WhenGettingThreadsPerWorkgroupThenTwoIsReturned) {