Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit b5c7058

Browse files
[SYCL] Don't check for specific error messages in device compiler log (#1341)
Switching to another version of the driver can lead to test failures due to updated diagnostic messages issued by the device compiler. Remove the checks for specific error messages since those are outside of our control.
1 parent 9caa74b commit b5c7058

11 files changed

+15
-34
lines changed

SYCL/InlineAsm/Negative/asm_bad_opcode.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(f, /* sg size */ true,
29-
/* exception string*/ "syntax error, unexpected IDENT");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3029
return 0;
3130
}

SYCL/InlineAsm/Negative/asm_bad_operand_syntax.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(f, /* sg size */ true,
29-
/* exception string*/ "syntax error, unexpected FTYPE");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3029
return 0;
3130
}

SYCL/InlineAsm/Negative/asm_duplicate_label.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(f, /* sg size */ true,
29-
/* exception string*/ "for the exact error messages");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3029
return 0;
3130
}

SYCL/InlineAsm/Negative/asm_illegal_exec_size.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(f, /* sg size */ true,
29-
/* exception string*/ "invalid execution size");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3029
return 0;
3130
}

SYCL/InlineAsm/Negative/asm_missing_label.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(f, /* sg size */ true,
29-
/* exception string*/ "for the exact error messages");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3029
return 0;
3130
}

SYCL/InlineAsm/Negative/asm_missing_region.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(
29-
f, /* sg size */ true,
30-
/* exception string*/ "unexpected NEWLINE, expecting LANGLE");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3129
return 0;
3230
}

SYCL/InlineAsm/Negative/asm_simple.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(
29-
f, /* sg size */ true,
30-
/* exception string*/ "syntax error, unexpected $undefined");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3129
return 0;
3230
}

SYCL/InlineAsm/Negative/asm_undefined_decl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(
29-
f, /* sg size */ true,
30-
/* exception string*/ "unexpected NEWLINE, expecting LANGLE");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3129
return 0;
3230
}

SYCL/InlineAsm/Negative/asm_undefined_pred.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(f, /* sg size */ true,
29-
/* exception string*/ "P3: undefined predicate variable");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3029
return 0;
3130
}

SYCL/InlineAsm/Negative/asm_wrong_declare.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ struct KernelFunctor {
2525

2626
int main() {
2727
KernelFunctor f;
28-
launchInlineASMTest(
29-
f, /* sg size */ true,
30-
/* exception string*/ "unexpected NEWLINE, expecting NUM_ELTS_EQ");
28+
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
3129
return 0;
3230
}

SYCL/InlineAsm/include/asmhelper.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,17 @@ bool launchInlineASMTestImpl(F &f, bool requires_particular_sg_size = true) {
118118
/// \returns false if test wasn't launched (i.e.was skipped) and true otherwise
119119
template <typename F>
120120
bool launchInlineASMTest(F &f, bool requires_particular_sg_size = true,
121-
std::string exception_string = "") {
121+
bool exception_expected = false) {
122122
bool result = false;
123123
try {
124124
result = launchInlineASMTestImpl(f, requires_particular_sg_size);
125125
} catch (sycl::exception &e) {
126126
std::string what = e.what();
127-
if (!exception_string.empty()) {
128-
if (what.find(exception_string) != std::string::npos) {
129-
std::cout << "Caught expected exception: " << what << std::endl;
130-
} else {
131-
std::cout << "Failed to catch expected exception: " << exception_string
132-
<< std::endl;
133-
throw e;
134-
}
127+
if (exception_expected &&
128+
what.find("PI_ERROR_BUILD_PROGRAM_FAILURE") != std::string::npos) {
129+
std::cout << "Caught expected exception: " << what << std::endl;
135130
} else {
136-
std::cout << "Caught unexpected exception: " << std::endl;
131+
std::cout << "Caught unexpected exception." << std::endl;
137132
throw e;
138133
}
139134
}

0 commit comments

Comments
 (0)