File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ static std::vector<DevDescT> getAllowListDesc() {
126
126
valuePtr = &decDescs.back ().devDriverVer ;
127
127
size = &decDescs.back ().devDriverVerSize ;
128
128
str += sizeof (driverVerStr) - 1 ;
129
+ } else {
130
+ throw sycl::runtime_error (" Unrecognized key in device allowlist" ,
131
+ PI_INVALID_VALUE);
129
132
}
130
133
131
134
if (' :' != *str)
Original file line number Diff line number Diff line change 8
8
// RUN: env TEST_DEVICE_AVAILABLE=1 env SYCL_CONFIG_FILE_NAME=%t2.conf %t.out
9
9
//
10
10
// RUN: env TEST_DEVICE_IS_NOT_AVAILABLE=1 env SYCL_DEVICE_ALLOWLIST="PlatformName:{{SUCH NAME DOESN'T EXIST}}" %t.out
11
+ // RUN: env TEST_INCORRECT_VALUE=1 env SYCL_DEVICE_ALLOWLIST="IncorrectKey:{{.*}}" %t.out
11
12
12
13
#include < CL/sycl.hpp>
13
14
#include < iostream>
@@ -86,5 +87,16 @@ int main() {
86
87
return 0 ;
87
88
}
88
89
90
+ if (getenv (" TEST_INCORRECT_VALUE" )) {
91
+ try {
92
+ sycl::platform::get_platforms ();
93
+ } catch (sycl::runtime_error &E) {
94
+ const std::string ExpectedMsg (" Unrecognized key in device allowlist" );
95
+ const std::string GotMessage (E.what ());
96
+ const bool CorrectMeg = GotMessage.find (ExpectedMsg) != std::string::npos;
97
+ return CorrectMeg ? 0 : 1 ;
98
+ }
99
+ }
100
+
89
101
throw std::runtime_error (" Unhandled situation" );
90
102
}
You can’t perform that action at this time.
0 commit comments