Skip to content

Commit 3cba7b2

Browse files
committed
Print out build error.
1 parent 2bdf669 commit 3cba7b2

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

test/conformance/kernel/urKernelGetSubGroupInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ TEST_P(urKernelGetSubGroupInfoTest, SubGroupSizeIntel) {
8181
ASSERT_EQ(property_size, sizeof(uint32_t));
8282

8383
std::vector<char> property_value(property_size);
84-
>>>>>>> e048b8ea (Align Kernel CTS and Specification.)
8584
ASSERT_SUCCESS(urKernelGetSubGroupInfo(kernel, device, property_name,
8685
property_size, property_value.data(),
8786
nullptr));

test/conformance/testing/include/uur/fixtures.h

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,20 @@ struct urBaseKernelTest : urProgramTest {
13241324
}
13251325

13261326
void Build() {
1327-
ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));
1327+
auto error = urProgramBuild(context, program, nullptr);
1328+
if (UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE == error) {
1329+
size_t property_size = 0;
1330+
1331+
urProgramGetBuildInfo(program, device, UR_PROGRAM_BUILD_INFO_LOG, 0,
1332+
nullptr, &property_size);
1333+
1334+
std::vector<char> property_value(property_size);
1335+
urProgramGetBuildInfo(program, device, UR_PROGRAM_BUILD_INFO_LOG,
1336+
property_size, property_value.data(),
1337+
nullptr);
1338+
std::cout.write(property_value.data(), property_size);
1339+
}
1340+
ASSERT_SUCCESS(error);
13281341
ASSERT_SUCCESS(urKernelCreate(program, kernel_name.data(), &kernel));
13291342
}
13301343

@@ -1360,7 +1373,21 @@ struct urBaseKernelTestWithParam : urProgramTestWithParam<T> {
13601373
}
13611374

13621375
void Build() {
1363-
ASSERT_SUCCESS(urProgramBuild(this->context, this->program, nullptr));
1376+
auto error = urProgramBuild(this->context, this->program, nullptr);
1377+
if (UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE == error) {
1378+
size_t property_size = 0;
1379+
1380+
urProgramGetBuildInfo(this->program, this->device,
1381+
UR_PROGRAM_BUILD_INFO_LOG, 0, nullptr,
1382+
&property_size);
1383+
1384+
std::vector<char> property_value(property_size);
1385+
urProgramGetBuildInfo(this->program, this->device,
1386+
UR_PROGRAM_BUILD_INFO_LOG, property_size,
1387+
property_value.data(), nullptr);
1388+
std::cout.write(property_value.data(), property_size);
1389+
}
1390+
ASSERT_SUCCESS(error);
13641391
ASSERT_SUCCESS(
13651392
urKernelCreate(this->program, kernel_name.data(), &kernel));
13661393
}

0 commit comments

Comments
 (0)