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

[SYCL] Don't check for specific error messages in device compiler log #1341

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions SYCL/InlineAsm/Negative/asm_bad_opcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(f, /* sg size */ true,
/* exception string*/ "syntax error, unexpected IDENT");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
3 changes: 1 addition & 2 deletions SYCL/InlineAsm/Negative/asm_bad_operand_syntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(f, /* sg size */ true,
/* exception string*/ "syntax error, unexpected FTYPE");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
3 changes: 1 addition & 2 deletions SYCL/InlineAsm/Negative/asm_duplicate_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(f, /* sg size */ true,
/* exception string*/ "for the exact error messages");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
3 changes: 1 addition & 2 deletions SYCL/InlineAsm/Negative/asm_illegal_exec_size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(f, /* sg size */ true,
/* exception string*/ "invalid execution size");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
3 changes: 1 addition & 2 deletions SYCL/InlineAsm/Negative/asm_missing_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(f, /* sg size */ true,
/* exception string*/ "for the exact error messages");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
4 changes: 1 addition & 3 deletions SYCL/InlineAsm/Negative/asm_missing_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(
f, /* sg size */ true,
/* exception string*/ "unexpected NEWLINE, expecting LANGLE");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
4 changes: 1 addition & 3 deletions SYCL/InlineAsm/Negative/asm_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(
f, /* sg size */ true,
/* exception string*/ "syntax error, unexpected $undefined");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
4 changes: 1 addition & 3 deletions SYCL/InlineAsm/Negative/asm_undefined_decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(
f, /* sg size */ true,
/* exception string*/ "unexpected NEWLINE, expecting LANGLE");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
3 changes: 1 addition & 2 deletions SYCL/InlineAsm/Negative/asm_undefined_pred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(f, /* sg size */ true,
/* exception string*/ "P3: undefined predicate variable");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
4 changes: 1 addition & 3 deletions SYCL/InlineAsm/Negative/asm_wrong_declare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ struct KernelFunctor {

int main() {
KernelFunctor f;
launchInlineASMTest(
f, /* sg size */ true,
/* exception string*/ "unexpected NEWLINE, expecting NUM_ELTS_EQ");
launchInlineASMTest(f, /* sg size */ true, /* exception expected */ true);
return 0;
}
15 changes: 5 additions & 10 deletions SYCL/InlineAsm/include/asmhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,17 @@ bool launchInlineASMTestImpl(F &f, bool requires_particular_sg_size = true) {
/// \returns false if test wasn't launched (i.e.was skipped) and true otherwise
template <typename F>
bool launchInlineASMTest(F &f, bool requires_particular_sg_size = true,
std::string exception_string = "") {
bool exception_expected = false) {
bool result = false;
try {
result = launchInlineASMTestImpl(f, requires_particular_sg_size);
} catch (sycl::exception &e) {
std::string what = e.what();
if (!exception_string.empty()) {
if (what.find(exception_string) != std::string::npos) {
std::cout << "Caught expected exception: " << what << std::endl;
} else {
std::cout << "Failed to catch expected exception: " << exception_string
<< std::endl;
throw e;
}
if (exception_expected &&
what.find("PI_ERROR_BUILD_PROGRAM_FAILURE") != std::string::npos) {
std::cout << "Caught expected exception: " << what << std::endl;
} else {
std::cout << "Caught unexpected exception: " << std::endl;
std::cout << "Caught unexpected exception." << std::endl;
throw e;
}
}
Expand Down