@@ -28,8 +28,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
2828 File.close ();
2929 }
3030 try {
31- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
32- throw std::logic_error (" sycl::exception didn't throw" );
31+ sycl::detail::readConfig ( true );
32+ throw std::logic_error (" sycl::exception didn't throw 1 " );
3333 } catch (sycl::exception &e) {
3434 EXPECT_EQ (
3535 std::string (
@@ -46,8 +46,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
4646 File.close ();
4747 }
4848 try {
49- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
50- throw std::logic_error (" sycl::exception didn't throw" );
49+ sycl::detail::readConfig ( true );
50+ throw std::logic_error (" sycl::exception didn't throw 2 " );
5151 } catch (sycl::exception &e) {
5252 EXPECT_EQ (
5353 std::string (
@@ -64,8 +64,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
6464 File.close ();
6565 }
6666 try {
67- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
68- throw std::logic_error (" sycl::exception didn't throw" );
67+ sycl::detail::readConfig ( true );
68+ throw std::logic_error (" sycl::exception didn't throw 3 " );
6969 } catch (sycl::exception &e) {
7070 EXPECT_EQ (
7171 std::string (
@@ -82,8 +82,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
8282 File.close ();
8383 }
8484 try {
85- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
86- throw std::logic_error (" sycl::exception didn't throw" );
85+ sycl::detail::readConfig ( true );
86+ throw std::logic_error (" sycl::exception didn't throw 4 " );
8787 } catch (sycl::exception &e) {
8888 EXPECT_EQ (
8989 std::string (
@@ -103,8 +103,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
103103 File.close ();
104104 }
105105 try {
106- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
107- throw std::logic_error (" sycl::exception didn't throw" );
106+ sycl::detail::readConfig ( true );
107+ throw std::logic_error (" sycl::exception didn't throw 5 " );
108108 } catch (sycl::exception &e) {
109109 EXPECT_TRUE (std::regex_match (
110110 e.what (),
@@ -121,8 +121,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
121121 File.close ();
122122 }
123123 try {
124- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
125- throw std::logic_error (" sycl::exception didn't throw" );
124+ sycl::detail::readConfig ( true );
125+ throw std::logic_error (" sycl::exception didn't throw 6 " );
126126 } catch (sycl::exception &e) {
127127 EXPECT_TRUE (std::regex_match (
128128 e.what (), std::regex (" Variable name is more than ([\\ d]+) or less "
@@ -142,8 +142,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
142142 File.close ();
143143 }
144144 try {
145- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
146- throw std::logic_error (" sycl::exception didn't throw" );
145+ sycl::detail::readConfig ( true );
146+ throw std::logic_error (" sycl::exception didn't throw 7 " );
147147 } catch (sycl::exception &e) {
148148 EXPECT_TRUE (std::regex_match (
149149 e.what (), std::regex (" The value contains more than ([\\ d]+) characters "
@@ -159,8 +159,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
159159 File.close ();
160160 }
161161 try {
162- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
163- throw std::logic_error (" sycl::exception didn't throw" );
162+ sycl::detail::readConfig ( true );
163+ throw std::logic_error (" sycl::exception didn't throw 8 " );
164164 } catch (sycl::exception &e) {
165165 EXPECT_TRUE (std::regex_match (
166166 e.what (), std::regex (" The value contains more than ([\\ d]+) characters "
@@ -176,8 +176,8 @@ TEST(ConfigTests, CheckConfigProcessing) {
176176 File.close ();
177177 }
178178 try {
179- sycl::detail::SYCLConfig<sycl::detail::SYCL_DEVICE_ALLOWLIST>:: get ( );
180- throw std::logic_error (" sycl::exception didn't throw" );
179+ sycl::detail::readConfig ( true );
180+ throw std::logic_error (" sycl::exception didn't throw 9 " );
181181 } catch (sycl::exception &e) {
182182 EXPECT_TRUE (std::regex_match (
183183 e.what (), std::regex (" The value contains more than ([\\ d]+) characters "
@@ -249,20 +249,17 @@ TEST(ConfigTests, CheckSyclCacheTraceTest) {
249249 // Lambda to test parsing of SYCL_CACHE_TRACE
250250 auto TestConfig = [](int expectedValue, int expectedDiskCache,
251251 int expectedInMemCache, int expectedKernelCompiler) {
252- EXPECT_EQ (static_cast <unsigned int >(expectedValue),
253- SYCLConfig<SYCL_CACHE_TRACE>::get ());
252+ EXPECT_EQ (static_cast <unsigned int >(expectedValue), SYCLConfigTrace::get ());
254253
255254 EXPECT_EQ (
256255 expectedDiskCache,
257- static_cast <int >(
258- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE>::isTraceDiskCache ()));
256+ static_cast <int >(sycl::detail::SYCLConfigTrace::isTraceDiskCache ()));
259257 EXPECT_EQ (
260258 expectedInMemCache,
261- static_cast <int >(
262- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE>::isTraceInMemCache ()));
259+ static_cast <int >(sycl::detail::SYCLConfigTrace::isTraceInMemCache ()));
263260 EXPECT_EQ (expectedKernelCompiler,
264- static_cast <int >(sycl::detail::SYCLConfig<
265- SYCL_CACHE_TRACE> ::isTraceKernelCompiler ()));
261+ static_cast <int >(
262+ sycl::detail::SYCLConfigTrace ::isTraceKernelCompiler ()));
266263 };
267264
268265 // Lambda to set SYCL_CACHE_TRACE
@@ -279,40 +276,40 @@ TEST(ConfigTests, CheckSyclCacheTraceTest) {
279276 TestConfig (0 , 0 , 0 , 0 );
280277
281278 SetSyclCacheTraceEnv (" 1" );
282- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
279+ sycl::detail::SYCLConfigTrace ::reset ();
283280 TestConfig (1 , 1 , 0 , 0 );
284281
285282 SetSyclCacheTraceEnv (" 2" );
286- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
283+ sycl::detail::SYCLConfigTrace ::reset ();
287284 TestConfig (2 , 0 , 1 , 0 );
288285
289286 SetSyclCacheTraceEnv (" 3" );
290- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
287+ sycl::detail::SYCLConfigTrace ::reset ();
291288 TestConfig (3 , 1 , 1 , 0 );
292289
293290 SetSyclCacheTraceEnv (" 4" );
294- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
291+ sycl::detail::SYCLConfigTrace ::reset ();
295292 TestConfig (4 , 0 , 0 , 1 );
296293
297294 SetSyclCacheTraceEnv (" 5" );
298- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
295+ sycl::detail::SYCLConfigTrace ::reset ();
299296 TestConfig (5 , 1 , 0 , 1 );
300297
301298 SetSyclCacheTraceEnv (" 6" );
302- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
299+ sycl::detail::SYCLConfigTrace ::reset ();
303300 TestConfig (6 , 0 , 1 , 1 );
304301
305302 SetSyclCacheTraceEnv (" 7" );
306- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
303+ sycl::detail::SYCLConfigTrace ::reset ();
307304 TestConfig (7 , 1 , 1 , 1 );
308305
309306 SetSyclCacheTraceEnv (" 8" );
310- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
307+ sycl::detail::SYCLConfigTrace ::reset ();
311308 TestConfig (1 , 1 , 0 , 0 );
312309
313310 // Set random non-null value. It should default to 1.
314311 SetSyclCacheTraceEnv (" random" );
315- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
312+ sycl::detail::SYCLConfigTrace ::reset ();
316313 TestConfig (1 , 1 , 0 , 0 );
317314
318315 // When SYCL_CACHE_TRACE is not set, it should default to 0.
@@ -321,7 +318,7 @@ TEST(ConfigTests, CheckSyclCacheTraceTest) {
321318#else
322319 unsetenv (" SYCL_CACHE_TRACE" );
323320#endif
324- sycl::detail::SYCLConfig<SYCL_CACHE_TRACE> ::reset ();
321+ sycl::detail::SYCLConfigTrace ::reset ();
325322 TestConfig (0 , 0 , 0 , 0 );
326323}
327324
0 commit comments