xref: /aosp_15_r20/external/OpenCL-CTS/test_conformance/spir/main.cpp (revision 6467f958c7de8070b317fc65bcb0f6472e388d82)
1 //
2 // Copyright (c) 2017 The Khronos Group Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //    http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 #include "harness/compat.h"
17 
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include <iostream>
22 #include <memory>
23 #include <sstream>
24 #include <iterator>
25 
26 #include "harness/errorHelpers.h"
27 #include "harness/kernelHelpers.h"
28 #include "harness/typeWrappers.h"
29 #include "harness/os_helpers.h"
30 
31 #include "exceptions.h"
32 #include "run_build_test.h"
33 #include "run_services.h"
34 
35 #include <list>
36 #include <algorithm>
37 #include "miniz/miniz.h"
38 
39 #if defined(_WIN32)
40 #include <windows.h>
41 #include <direct.h>
42 #else // !_WIN32
43 #include <dirent.h>
44 #include <sys/stat.h>
45 #include <sys/types.h>
46 #endif
47 
48 static int no_unzip = 0;
49 
50 class custom_cout : public std::streambuf
51 {
52 private:
53     std::stringstream ss;
54 
xsputn(const char * s,std::streamsize n)55     std::streamsize xsputn (const char* s, std::streamsize n)
56     {
57         ss.write(s, n);
58         return n;
59     }
60 
overflow(int c)61     int overflow(int c)
62     {
63         if(c > 0 && c < 256) ss.put(c);
64         return c;
65     }
66 
sync()67     int sync()
68     {
69         log_info("%s", ss.str().c_str());
70         ss.str("");
71         return 0;
72     }
73 };
74 
75 class custom_cerr : public std::streambuf
76 {
77 private:
78     std::stringstream ss;
79 
xsputn(const char * s,std::streamsize n)80     std::streamsize xsputn (const char* s, std::streamsize n)
81     {
82         ss.write(s, n);
83         return n;
84     }
85 
overflow(int c)86     int overflow(int c)
87     {
88         if(c > 0 && c < 256) ss.put(c);
89         return c;
90     }
91 
sync()92     int sync()
93     {
94         log_error("%s", ss.str().c_str());
95         ss.str("");
96         return 0;
97     }
98 };
99 
100 class override_buff
101 {
102     std::ostream* stream;
103     std::streambuf* buff;
104 
105 public:
override_buff(std::ostream & s,std::streambuf & b)106     override_buff(std::ostream& s, std::streambuf& b)
107     {
108         stream = &s;
109         buff = stream->rdbuf();
110         stream->rdbuf(&b);
111     }
112 
~override_buff()113     ~override_buff()
114     {
115         stream->rdbuf(buff);
116     }
117 };
118 
119 typedef bool (*testfn)(cl_device_id device, cl_uint size_t_width, const char *folder);
120 
121 template <typename T>
dealloc(T * p)122 void dealloc(T *p)
123 {
124     if (p) delete p;
125 }
126 
get_spir_version(cl_device_id device,std::vector<Version> & versions)127 static void get_spir_version(cl_device_id device,
128                              std::vector<Version> &versions)
129 {
130     char version[64] = {0};
131     cl_int err;
132     size_t size = 0;
133 
134     if ((err = clGetDeviceInfo(device, CL_DEVICE_SPIR_VERSIONS, sizeof(version),
135                                (void *)version, &size)))
136     {
137         log_error( "Error: failed to obtain SPIR version at %s:%d (err = %d)\n",
138                   __FILE__, __LINE__, err );
139         return;
140     }
141 
142     assert(size && "Empty version string");
143 
144     std::list<std::string> versionVector;
145     std::stringstream versionStream(version);
146     std::copy(std::istream_iterator<std::string>(versionStream),
147               std::istream_iterator<std::string>(),
148               std::back_inserter(versionVector));
149     for (auto &v : versionVector)
150     {
151         auto major = v[v.find('.') - 1];
152         auto minor = v[v.find('.') + 1];
153         versions.push_back(Version{ major - '0', minor - '0' });
154     }
155 }
156 
157 struct CounterEventHandler: EventHandler{
158     unsigned int& Counter;
159     unsigned int TN;
160     std::string LastTest;
161 
162     //N - counter of successful tests.
163     //T - total number of tests in the suite
CounterEventHandlerCounterEventHandler164     CounterEventHandler(unsigned int& N, unsigned int T): Counter(N), TN(T){}
165 
operator ()CounterEventHandler166     void operator ()(const std::string& testName, const std::string& kernelName) {
167         if (testName != LastTest){
168             ++Counter;
169             LastTest = testName;
170         }
171     }
172 };
173 
174 class AccumulatorEventHandler: public EventHandler{
175   std::list<std::string>& m_list;
176   const std::string m_name;
177 public:
AccumulatorEventHandler(std::list<std::string> & L,const std::string N)178   AccumulatorEventHandler(std::list<std::string>& L, const std::string N):
179   m_list(L), m_name(N){}
180 
operator ()(const std::string & T,const std::string & K)181   void operator ()(const std::string& T, const std::string& K){
182     std::cerr << "\nTest " << T << "\t Kernel " << K << " failed" << std::endl;
183     m_list.push_back(m_name + "\t" + T + "\t" + K);
184   }
185 };
186 
printError(const std::string & S)187 static void printError(const std::string& S){
188   std::cerr << S << std::endl;
189 }
190 
191 // Extracts suite with the given name, and saves it to disk.
extract_suite(const char * suiteName)192 static void extract_suite(const char *suiteName)
193 {
194   mz_zip_archive zip_archive;
195 
196   // Composing the name of the archive.
197   char* dir = get_exe_dir();
198   std::string archiveName(dir);
199   archiveName.append(dir_sep());
200   archiveName.append(suiteName);
201   archiveName.append(".zip");
202   free(dir);
203 
204 #if defined(_WIN32)
205       _mkdir(suiteName);
206 #else
207       mkdir(suiteName, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
208 #endif
209 
210   memset(&zip_archive, 0, sizeof(zip_archive));
211   if (!mz_zip_reader_init_file(&zip_archive, archiveName.c_str(), 0))
212       throw Exceptions::ArchiveError(MZ_DATA_ERROR);
213 
214   // Get and print information about each file in the archive.
215   for (size_t i = 0; i < mz_zip_reader_get_num_files(&zip_archive); i++)
216   {
217       mz_zip_archive_file_stat fileStat;
218       size_t fileSize = 0;
219 
220       if (!mz_zip_reader_file_stat(&zip_archive, i, &fileStat))
221       {
222           mz_zip_reader_end(&zip_archive);
223           throw Exceptions::ArchiveError(MZ_DATA_ERROR);
224       }
225       const std::string fileName = fileStat.m_filename;
226 
227       // If the file is a directory, skip it. We create suite folder at the beggining.
228       if (mz_zip_reader_is_file_a_directory(&zip_archive, fileStat.m_file_index))
229       {
230           continue;
231       }
232 
233       // Extracting the file.
234       void *p = mz_zip_reader_extract_file_to_heap(&zip_archive,
235                                                    fileName.c_str(),
236                                                    &fileSize, 0);
237       if (!p)
238       {
239           mz_zip_reader_end(&zip_archive);
240           throw std::runtime_error("mz_zip_reader_extract_file_to_heap() failed!\n");
241       }
242 
243       // Writing the file back to the disk
244       std::fstream file(fileName.c_str(),
245                         std::ios_base::trunc | std::ios_base::in |
246                         std::ios_base::out | std::ios_base::binary);
247       if (!file.is_open())
248       {
249           std::string msg = "Failed to open ";
250           msg.append(fileName);
251           throw Exceptions::TestError(msg);
252       }
253 
254       file.write((const char*)p, fileSize);
255       if (file.bad())
256       {
257           std::string msg("Failed to write into ");
258           msg.append(fileName);
259           throw Exceptions::TestError(msg);
260       }
261 
262       // Cleanup.
263       file.flush();
264       file.close();
265       free(p);
266   }
267   mz_zip_reader_end(&zip_archive);
268 }
269 
270 //
271 // Extracts the given suite package if needed.
272 // return true if the suite was extracted, false otherwise.
273 //
try_extract(const char * suite)274 static bool try_extract(const char* suite)
275 {
276     if(no_unzip == 0)
277     {
278         std::cout << "Extracting test suite " << suite << std::endl;
279         extract_suite(suite);
280         std::cout << "Done." << std::endl;
281     }
282     return true;
283 }
284 
test_suite(cl_device_id device,cl_uint size_t_width,const char * folder,const char * test_name[],unsigned int number_of_tests,const char * extension)285 bool test_suite(cl_device_id device, cl_uint size_t_width, const char *folder,
286                 const char *test_name[], unsigned int number_of_tests,
287                 const char *extension)
288 {
289     // If the folder doesn't exist, we extract in from the archive.
290     try_extract(folder);
291 
292     std::cout << "Running tests:" << std::endl;
293 
294     OclExtensions deviceCapabilities = OclExtensions::getDeviceCapabilities(device);
295     unsigned int tests_passed = 0;
296     CounterEventHandler SuccE(tests_passed, number_of_tests);
297     std::list<std::string> ErrList;
298     for (unsigned int i = 0; i < number_of_tests; ++i)
299     {
300         AccumulatorEventHandler FailE(ErrList, test_name[i]);
301         if((strlen(extension) != 0) && (!is_extension_available(device, extension)))
302         {
303             (SuccE)(test_name[i], "");
304             std::cout << test_name[i] << "... Skipped. (Cannot run on device due to missing extension: " << extension << " )." << std::endl;
305             continue;
306         }
307         TestRunner testRunner(&SuccE, &FailE, deviceCapabilities);
308         testRunner.runBuildTest(device, folder, test_name[i], size_t_width);
309     }
310 
311     std::cout << std::endl;
312     std::cout << "PASSED " << tests_passed << " of " << number_of_tests << " tests.\n" << std::endl;
313 
314     if (!ErrList.empty())
315     {
316         std::cout << "Failed tests:" << std::endl;
317         std::for_each(ErrList.begin(), ErrList.end(), printError);
318         std::cout << std::endl;
319         return false;
320     }
321     std::cout << std::endl;
322     return true;
323 }
324 
getTestFolder(const std::string & TS)325 static std::string getTestFolder(const std::string& TS)
326 {
327   const std::string DOUBLE("_double");
328   if (TS.size() < DOUBLE.size())
329     return TS;
330 
331   const size_t prefixLen = TS.size() - DOUBLE.size();
332   const std::string postfix = TS.substr(prefixLen, DOUBLE.size());
333   if (DOUBLE == postfix)
334       return TS.substr(0, prefixLen);
335 
336   return TS;
337 }
338 
test_api(cl_device_id device,cl_uint size_t_width,const char * folder)339 bool test_api (cl_device_id device, cl_uint size_t_width, const char *folder)
340 {
341     static const char* test_name[] = {
342         "const_derived_d",
343         "const_scalar_d",
344         "const_vector16_d",
345         "const_vector2_d",
346         "const_vector3_d",
347         "const_vector4_d",
348         "const_vector8_d",
349         "constant_derived_p0",
350         "constant_derived_p1",
351         "constant_derived_restrict_p0",
352         "constant_derived_restrict_p1",
353         "constant_scalar_p0",
354         "constant_scalar_p1",
355         "constant_scalar_p2",
356         "constant_scalar_p3",
357         "constant_scalar_restrict_p0",
358         "constant_scalar_restrict_p1",
359         "constant_scalar_restrict_p2",
360         "constant_scalar_restrict_p3",
361         "constant_vector16_p0",
362         "constant_vector16_p1",
363         "constant_vector16_p2",
364         "constant_vector16_restrict_p0",
365         "constant_vector16_restrict_p2",
366         "constant_vector2_p0",
367         "constant_vector2_p1",
368         "constant_vector2_restrict_p0",
369         "constant_vector2_restrict_p1",
370         "constant_vector2_restrict_p2",
371         "constant_vector3_p0",
372         "constant_vector3_p1",
373         "constant_vector3_p2",
374         "constant_vector3_restrict_p0",
375         "constant_vector3_restrict_p1",
376         "constant_vector3_restrict_p2",
377         "constant_vector4_p0",
378         "constant_vector4_p1",
379         "constant_vector4_p2",
380         "constant_vector4_restrict_p0",
381         "constant_vector4_restrict_p1",
382         "constant_vector4_restrict_p2",
383         "constant_vector8_p0",
384         "constant_vector8_p1",
385         "constant_vector8_p2",
386         "constant_vector8_restrict_p0",
387         "constant_vector8_restrict_p1",
388         "constant_vector8_restrict_p2",
389         "derived_d",
390         "global_const_derived_p",
391         "global_const_derived_restrict_p",
392         "global_const_scalar_p",
393         "global_const_scalar_restrict_p",
394         "global_const_vector16_p",
395         "global_const_vector16_restrict_p",
396         "global_const_vector2_p",
397         "global_const_vector2_restrict_p",
398         "global_const_vector3_p",
399         "global_const_vector3_restrict_p",
400         "global_const_vector4_p",
401         "global_const_vector4_restrict_p",
402         "global_const_vector8_p",
403         "global_const_vector8_restrict_p",
404         "global_const_volatile_derived_p",
405         "global_const_volatile_derived_restrict_p",
406         "global_const_volatile_scalar_p",
407         "global_const_volatile_scalar_restrict_p",
408         "global_const_volatile_vector16_p",
409         "global_const_volatile_vector16_restrict_p",
410         "global_const_volatile_vector2_p",
411         "global_const_volatile_vector2_restrict_p",
412         "global_const_volatile_vector3_p",
413         "global_const_volatile_vector3_restrict_p",
414         "global_const_volatile_vector4_p",
415         "global_const_volatile_vector4_restrict_p",
416         "global_const_volatile_vector8_p",
417         "global_const_volatile_vector8_restrict_p",
418         "global_derived_p",
419         "global_derived_restrict_p",
420         "global_scalar_p",
421         "global_scalar_restrict_p",
422         "global_vector16_p",
423         "global_vector16_restrict_p",
424         "global_vector2_p",
425         "global_vector2_restrict_p",
426         "global_vector3_p",
427         "global_vector3_restrict_p",
428         "global_vector4_p",
429         "global_vector4_restrict_p",
430         "global_vector8_p",
431         "global_vector8_restrict_p",
432         "global_volatile_derived_p",
433         "global_volatile_derived_restrict_p",
434         "global_volatile_scalar_p",
435         "global_volatile_scalar_restrict_p",
436         "global_volatile_vector16_p",
437         "global_volatile_vector16_restrict_p",
438         "global_volatile_vector2_p",
439         "global_volatile_vector2_restrict_p",
440         "global_volatile_vector3_p",
441         "global_volatile_vector3_restrict_p",
442         "global_volatile_vector4_p",
443         "global_volatile_vector4_restrict_p",
444         "global_volatile_vector8_p",
445         "global_volatile_vector8_restrict_p",
446         "local_const_derived_p",
447         "local_const_derived_restrict_p",
448         "local_const_scalar_p",
449         "local_const_scalar_restrict_p",
450         "local_const_vector16_p",
451         "local_const_vector16_restrict_p",
452         "local_const_vector2_p",
453         "local_const_vector2_restrict_p",
454         "local_const_vector3_p",
455         "local_const_vector3_restrict_p",
456         "local_const_vector4_p",
457         "local_const_vector4_restrict_p",
458         "local_const_vector8_p",
459         "local_const_vector8_restrict_p",
460         "local_const_volatile_derived_p",
461         "local_const_volatile_derived_restrict_p",
462         "local_const_volatile_scalar_p",
463         "local_const_volatile_scalar_restrict_p",
464         "local_const_volatile_vector16_p",
465         "local_const_volatile_vector16_restrict_p",
466         "local_const_volatile_vector2_p",
467         "local_const_volatile_vector2_restrict_p",
468         "local_const_volatile_vector3_p",
469         "local_const_volatile_vector3_restrict_p",
470         "local_const_volatile_vector4_p",
471         "local_const_volatile_vector4_restrict_p",
472         "local_const_volatile_vector8_p",
473         "local_const_volatile_vector8_restrict_p",
474         "local_derived_p",
475         "local_derived_restrict_p",
476         "local_scalar_p",
477         "local_scalar_restrict_p",
478         "local_vector16_p",
479         "local_vector16_restrict_p",
480         "local_vector2_p",
481         "local_vector2_restrict_p",
482         "local_vector3_p",
483         "local_vector3_restrict_p",
484         "local_vector4_p",
485         "local_vector4_restrict_p",
486         "local_vector8_p",
487         "local_vector8_restrict_p",
488         "local_volatile_derived_p",
489         "local_volatile_derived_restrict_p",
490         "local_volatile_scalar_p",
491         "local_volatile_scalar_restrict_p",
492         "local_volatile_vector16_p",
493         "local_volatile_vector16_restrict_p",
494         "local_volatile_vector2_p",
495         "local_volatile_vector2_restrict_p",
496         "local_volatile_vector3_p",
497         "local_volatile_vector3_restrict_p",
498         "local_volatile_vector4_p",
499         "local_volatile_vector4_restrict_p",
500         "local_volatile_vector8_p",
501         "local_volatile_vector8_restrict_p",
502         "private_const_derived_d",
503         "private_const_scalar_d",
504         "private_const_vector16_d",
505         "private_const_vector2_d",
506         "private_const_vector3_d",
507         "private_const_vector4_d",
508         "private_const_vector8_d",
509         "private_derived_d",
510         "private_scalar_d",
511         "private_vector16_d",
512         "private_vector2_d",
513         "private_vector3_d",
514         "private_vector4_d",
515         "private_vector8_d",
516         "scalar_d",
517         "vector16_d",
518         "vector2_d",
519         "vector3_d",
520         "vector4_d",
521         "vector8_d",
522         "image_d",
523         "image_d_write_array",
524         "image_d_3d",
525         "sample_test.min_max_read_image_args",
526         "kernel_with_bool",
527         "bool_scalar_d",
528         "long_constant_scalar_p2",
529         "long_const_scalar_d",
530         "long_const_vector16_d",
531         "long_const_vector2_d",
532         "long_const_vector3_d",
533         "long_const_vector4_d",
534         "long_const_vector8_d",
535         "long_constant_scalar_p3",
536         "long_constant_scalar_restrict_p2",
537         "long_constant_scalar_restrict_p3",
538         "long_constant_vector16_p1",
539         "long_constant_vector16_restrict_p1",
540         "long_constant_vector2_p1",
541         "long_constant_vector2_restrict_p1",
542         "long_constant_vector3_p1",
543         "long_constant_vector3_restrict_p1",
544         "long_constant_vector4_p1",
545         "long_constant_vector4_restrict_p1",
546         "long_constant_vector8_p1",
547         "long_constant_vector8_restrict_p1",
548         "long_global_const_scalar_p",
549         "long_global_const_scalar_restrict_p",
550         "long_global_const_vector16_p",
551         "long_global_const_vector16_restrict_p",
552         "long_global_const_vector2_p",
553         "long_global_const_vector2_restrict_p",
554         "long_global_const_vector3_p",
555         "long_global_const_vector3_restrict_p",
556         "long_global_const_vector4_p",
557         "long_global_const_vector4_restrict_p",
558         "long_global_const_vector8_p",
559         "long_global_const_vector8_restrict_p",
560         "long_global_const_volatile_scalar_p",
561         "long_global_const_volatile_scalar_restrict_p",
562         "long_global_const_volatile_vector16_p",
563         "long_global_const_volatile_vector16_restrict_p",
564         "long_global_const_volatile_vector2_p",
565         "long_global_const_volatile_vector2_restrict_p",
566         "long_global_const_volatile_vector3_p",
567         "long_global_const_volatile_vector3_restrict_p",
568         "long_global_const_volatile_vector4_p",
569         "long_global_const_volatile_vector4_restrict_p",
570         "long_global_const_volatile_vector8_p",
571         "long_global_const_volatile_vector8_restrict_p",
572         "long_global_scalar_p",
573         "long_global_scalar_restrict_p",
574         "long_global_vector16_p",
575         "long_global_vector16_restrict_p",
576         "long_global_vector2_p",
577         "long_global_vector2_restrict_p",
578         "long_global_vector3_p",
579         "long_global_vector3_restrict_p",
580         "long_global_vector4_p",
581         "long_global_vector4_restrict_p",
582         "long_global_vector8_p",
583         "long_global_vector8_restrict_p",
584         "long_global_volatile_scalar_p",
585         "long_global_volatile_scalar_restrict_p",
586         "long_global_volatile_vector16_p",
587         "long_global_volatile_vector16_restrict_p",
588         "long_global_volatile_vector2_p",
589         "long_global_volatile_vector2_restrict_p",
590         "long_global_volatile_vector3_p",
591         "long_global_volatile_vector3_restrict_p",
592         "long_global_volatile_vector4_p",
593         "long_global_volatile_vector4_restrict_p",
594         "long_global_volatile_vector8_p",
595         "long_global_volatile_vector8_restrict_p",
596         "long_local_const_scalar_p",
597         "long_local_const_scalar_restrict_p",
598         "long_local_const_vector16_p",
599         "long_local_const_vector16_restrict_p",
600         "long_local_const_vector2_p",
601         "long_local_const_vector2_restrict_p",
602         "long_local_const_vector3_p",
603         "long_local_const_vector3_restrict_p",
604         "long_local_const_vector4_p",
605         "long_local_const_vector4_restrict_p",
606         "long_local_const_vector8_p",
607         "long_local_const_vector8_restrict_p",
608         "long_local_const_volatile_scalar_p",
609         "long_local_const_volatile_scalar_restrict_p",
610         "long_local_const_volatile_vector16_p",
611         "long_local_const_volatile_vector16_restrict_p",
612         "long_local_const_volatile_vector2_p",
613         "long_local_const_volatile_vector2_restrict_p",
614         "long_local_const_volatile_vector3_p",
615         "long_local_const_volatile_vector3_restrict_p",
616         "long_local_const_volatile_vector4_p",
617         "long_local_const_volatile_vector4_restrict_p",
618         "long_local_const_volatile_vector8_p",
619         "long_local_const_volatile_vector8_restrict_p",
620         "long_local_scalar_p",
621         "long_local_scalar_restrict_p",
622         "long_local_vector16_p",
623         "long_local_vector16_restrict_p",
624         "long_local_vector2_p",
625         "long_local_vector2_restrict_p",
626         "long_local_vector3_p",
627         "long_local_vector3_restrict_p",
628         "long_local_vector4_p",
629         "long_local_vector4_restrict_p",
630         "long_local_vector8_p",
631         "long_local_vector8_restrict_p",
632         "long_local_volatile_scalar_p",
633         "long_local_volatile_scalar_restrict_p",
634         "long_local_volatile_vector16_p",
635         "long_local_volatile_vector16_restrict_p",
636         "long_local_volatile_vector2_p",
637         "long_local_volatile_vector2_restrict_p",
638         "long_local_volatile_vector3_p",
639         "long_local_volatile_vector3_restrict_p",
640         "long_local_volatile_vector4_p",
641         "long_local_volatile_vector4_restrict_p",
642         "long_local_volatile_vector8_p",
643         "long_local_volatile_vector8_restrict_p",
644         "long_private_const_scalar_d",
645         "long_private_const_vector16_d",
646         "long_private_const_vector2_d",
647         "long_private_const_vector3_d",
648         "long_private_const_vector4_d",
649         "long_private_const_vector8_d",
650         "long_private_scalar_d",
651         "long_private_vector16_d",
652         "long_private_vector2_d",
653         "long_private_vector3_d",
654         "long_private_vector4_d",
655         "long_private_vector8_d",
656         "long_scalar_d",
657         "long_vector16_d",
658         "long_vector2_d",
659         "long_vector3_d",
660         "long_vector4_d",
661         "long_vector8_d",
662     };
663 
664     log_info("test_api\n");
665     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
666 }
667 
668 
test_api_double(cl_device_id device,cl_uint size_t_width,const char * folder)669 bool test_api_double (cl_device_id device, cl_uint size_t_width, const char *folder)
670 {
671     static const char* test_name[] = {
672         "double_scalar_p",
673         "double_scalar_p2",
674         "double_scalar_d",
675         "double_vector2_p",
676         "double_vector2_p2",
677         "double_vector2_d",
678         "double_vector3_p",
679         "double_vector3_p2",
680         "double_vector3_d",
681         "double_vector4_p",
682         "double_vector4_p2",
683         "double_vector4_d",
684         "double_vector8_p",
685         "double_vector8_p2",
686         "double_vector8_d",
687         "double_vector16_p",
688         "double_vector16_p2",
689         "double_vector16_d",
690     };
691 
692     log_info("test_api_double\n");
693     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
694 }
695 
696 
test_atomics(cl_device_id device,cl_uint size_t_width,const char * folder)697 bool test_atomics (cl_device_id device, cl_uint size_t_width, const char *folder)
698 {
699     static const char* test_name[] = {
700         "test_atomic_fn.atomic_add_global_int",
701         "test_atomic_fn.atomic_add_global_uint",
702         "test_atomic_fn.atomic_sub_global_int",
703         "test_atomic_fn.atomic_sub_global_uint",
704         "test_atomic_fn.atomic_xchg_global_int",
705         "test_atomic_fn.atomic_xchg_global_uint",
706         "test_atomic_fn.atomic_xchg_global_float",
707         "test_atomic_fn.atomic_min_global_int",
708         "test_atomic_fn.atomic_min_global_uint",
709         "test_atomic_fn.atomic_max_global_int",
710         "test_atomic_fn.atomic_max_global_uint",
711         "test_atomic_fn.atomic_inc_global_int",
712         "test_atomic_fn.atomic_inc_global_uint",
713         "test_atomic_fn.atomic_dec_global_int",
714         "test_atomic_fn.atomic_dec_global_uint",
715         "test_atomic_fn.atomic_cmpxchg_global_int",
716         "test_atomic_fn.atomic_cmpxchg_global_uint",
717         "test_atomic_fn.atomic_and_global_int",
718         "test_atomic_fn.atomic_and_global_uint",
719         "test_atomic_fn.atomic_or_global_int",
720         "test_atomic_fn.atomic_or_global_uint",
721         "test_atomic_fn.atomic_xor_global_int",
722         "test_atomic_fn.atomic_xor_global_uint",
723         "test_atomic_fn.atomic_add_local_int",
724         "test_atomic_fn.atomic_add_local_uint",
725         "test_atomic_fn.atomic_sub_local_int",
726         "test_atomic_fn.atomic_sub_local_uint",
727         "test_atomic_fn.atomic_xchg_local_int",
728         "test_atomic_fn.atomic_xchg_local_uint",
729         "test_atomic_fn.atomic_xchg_local_float",
730         "test_atomic_fn.atomic_min_local_int",
731         "test_atomic_fn.atomic_min_local_uint",
732         "test_atomic_fn.atomic_max_local_int",
733         "test_atomic_fn.atomic_max_local_uint",
734         "test_atomic_fn.atomic_inc_local_int",
735         "test_atomic_fn.atomic_inc_local_uint",
736         "test_atomic_fn.atomic_dec_local_int",
737         "test_atomic_fn.atomic_dec_local_uint",
738         "test_atomic_fn.atomic_cmpxchg_local_int",
739         "test_atomic_fn.atomic_cmpxchg_local_uint",
740         "test_atomic_fn.atomic_and_local_int",
741         "test_atomic_fn.atomic_and_local_uint",
742         "test_atomic_fn.atomic_or_local_int",
743         "test_atomic_fn.atomic_or_local_uint",
744         "test_atomic_fn.atomic_xor_local_int",
745         "test_atomic_fn.atomic_xor_local_uint",
746     };
747 
748     log_info("test_atomics\n");
749     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
750 }
751 
752 
test_basic(cl_device_id device,cl_uint size_t_width,const char * folder)753 bool test_basic (cl_device_id device, cl_uint size_t_width, const char *folder)
754 {
755     static const char* test_name[] = {
756         "sample_kernel.work_item_functions",
757         "test_sizeof.sizeof_char",
758         "test_sizeof.sizeof_uchar",
759         "test_sizeof.sizeof_unsigned_char",
760         "test_sizeof.sizeof_short",
761         "test_sizeof.sizeof_ushort",
762         "test_sizeof.sizeof_unsigned_short",
763         "test_sizeof.sizeof_int",
764         "test_sizeof.sizeof_uint",
765         "test_sizeof.sizeof_unsigned_int",
766         "test_sizeof.sizeof_float",
767         "test_sizeof.sizeof_long",
768         "test_sizeof.sizeof_ulong",
769         "test_sizeof.sizeof_unsigned_long",
770         "test_sizeof.sizeof_char2",
771         "test_sizeof.sizeof_uchar2",
772         "test_sizeof.sizeof_short2",
773         "test_sizeof.sizeof_ushort2",
774         "test_sizeof.sizeof_int2",
775         "test_sizeof.sizeof_uint2",
776         "test_sizeof.sizeof_float2",
777         "test_sizeof.sizeof_long2",
778         "test_sizeof.sizeof_ulong2",
779         "test_sizeof.sizeof_char4",
780         "test_sizeof.sizeof_uchar4",
781         "test_sizeof.sizeof_short4",
782         "test_sizeof.sizeof_ushort4",
783         "test_sizeof.sizeof_int4",
784         "test_sizeof.sizeof_uint4",
785         "test_sizeof.sizeof_float4",
786         "test_sizeof.sizeof_long4",
787         "test_sizeof.sizeof_ulong4",
788         "test_sizeof.sizeof_char8",
789         "test_sizeof.sizeof_uchar8",
790         "test_sizeof.sizeof_short8",
791         "test_sizeof.sizeof_ushort8",
792         "test_sizeof.sizeof_int8",
793         "test_sizeof.sizeof_uint8",
794         "test_sizeof.sizeof_float8",
795         "test_sizeof.sizeof_long8",
796         "test_sizeof.sizeof_ulong8",
797         "test_sizeof.sizeof_char16",
798         "test_sizeof.sizeof_uchar16",
799         "test_sizeof.sizeof_short16",
800         "test_sizeof.sizeof_ushort16",
801         "test_sizeof.sizeof_int16",
802         "test_sizeof.sizeof_uint16",
803         "test_sizeof.sizeof_float16",
804         "test_sizeof.sizeof_long16",
805         "test_sizeof.sizeof_ulong16",
806         "test_sizeof.sizeof_void_p",
807         "test_sizeof.sizeof_size_t",
808         "test_sizeof.sizeof_sizeof_int",
809         "test_sizeof.sizeof_ptrdiff_t",
810         "test_sizeof.sizeof_intptr_t",
811         "test_sizeof.sizeof_uintptr_t",
812         "test_sizeof.sizeof_image2d_t",
813         "test_sizeof.sizeof_image3d_t",
814         "test_sizeof.sizeof_double",
815         "test_sizeof.sizeof_double2",
816         "test_sizeof.sizeof_double4",
817         "test_sizeof.sizeof_double8",
818         "test_sizeof.sizeof_double16",
819         "sample_test.vec_type_hint_char",
820         "sample_test.vec_type_hint_char2",
821         "sample_test.vec_type_hint_char4",
822         "sample_test.vec_type_hint_char8",
823         "sample_test.vec_type_hint_char16",
824         "sample_test.vec_type_hint_uchar",
825         "sample_test.vec_type_hint_uchar2",
826         "sample_test.vec_type_hint_uchar4",
827         "sample_test.vec_type_hint_uchar8",
828         "sample_test.vec_type_hint_uchar16",
829         "sample_test.vec_type_hint_short",
830         "sample_test.vec_type_hint_short2",
831         "sample_test.vec_type_hint_short4",
832         "sample_test.vec_type_hint_short8",
833         "sample_test.vec_type_hint_short16",
834         "sample_test.vec_type_hint_ushort",
835         "sample_test.vec_type_hint_ushort2",
836         "sample_test.vec_type_hint_ushort4",
837         "sample_test.vec_type_hint_ushort8",
838         "sample_test.vec_type_hint_ushort16",
839         "sample_test.vec_type_hint_int",
840         "sample_test.vec_type_hint_int2",
841         "sample_test.vec_type_hint_int4",
842         "sample_test.vec_type_hint_int8",
843         "sample_test.vec_type_hint_int16",
844         "sample_test.vec_type_hint_uint",
845         "sample_test.vec_type_hint_uint2",
846         "sample_test.vec_type_hint_uint4",
847         "sample_test.vec_type_hint_uint8",
848         "sample_test.vec_type_hint_uint16",
849         "sample_test.vec_type_hint_long",
850         "sample_test.vec_type_hint_long2",
851         "sample_test.vec_type_hint_long4",
852         "sample_test.vec_type_hint_long8",
853         "sample_test.vec_type_hint_long16",
854         "sample_test.vec_type_hint_ulong",
855         "sample_test.vec_type_hint_ulong2",
856         "sample_test.vec_type_hint_ulong4",
857         "sample_test.vec_type_hint_ulong8",
858         "sample_test.vec_type_hint_ulong16",
859         "sample_test.vec_type_hint_float",
860         "sample_test.vec_type_hint_float2",
861         "sample_test.vec_type_hint_float4",
862         "sample_test.vec_type_hint_float8",
863         "sample_test.vec_type_hint_float16",
864         "test.kernel_memory_alignment_private_char",
865         "test.kernel_memory_alignment_private_uchar",
866         "test.kernel_memory_alignment_private_short",
867         "test.kernel_memory_alignment_private_ushort",
868         "test.kernel_memory_alignment_private_int",
869         "test.kernel_memory_alignment_private_uint",
870         "test.kernel_memory_alignment_private_long",
871         "test.kernel_memory_alignment_private_ulong",
872         "test.kernel_memory_alignment_private_float",
873         "test_fn.vload_global_char2",
874         "test_fn.vload_global_char3",
875         "test_fn.vload_global_char4",
876         "test_fn.vload_global_char8",
877         "test_fn.vload_global_char16",
878         "test_fn.vload_global_uchar2",
879         "test_fn.vload_global_uchar3",
880         "test_fn.vload_global_uchar4",
881         "test_fn.vload_global_uchar8",
882         "test_fn.vload_global_uchar16",
883         "test_fn.vload_global_short2",
884         "test_fn.vload_global_short3",
885         "test_fn.vload_global_short4",
886         "test_fn.vload_global_short8",
887         "test_fn.vload_global_short16",
888         "test_fn.vload_global_ushort2",
889         "test_fn.vload_global_ushort3",
890         "test_fn.vload_global_ushort4",
891         "test_fn.vload_global_ushort8",
892         "test_fn.vload_global_ushort16",
893         "test_fn.vload_global_int2",
894         "test_fn.vload_global_int3",
895         "test_fn.vload_global_int4",
896         "test_fn.vload_global_int8",
897         "test_fn.vload_global_int16",
898         "test_fn.vload_global_uint2",
899         "test_fn.vload_global_uint3",
900         "test_fn.vload_global_uint4",
901         "test_fn.vload_global_uint8",
902         "test_fn.vload_global_uint16",
903         "test_fn.vload_global_long2",
904         "test_fn.vload_global_long3",
905         "test_fn.vload_global_long4",
906         "test_fn.vload_global_long8",
907         "test_fn.vload_global_long16",
908         "test_fn.vload_global_ulong2",
909         "test_fn.vload_global_ulong3",
910         "test_fn.vload_global_ulong4",
911         "test_fn.vload_global_ulong8",
912         "test_fn.vload_global_ulong16",
913         "test_fn.vload_global_float2",
914         "test_fn.vload_global_float3",
915         "test_fn.vload_global_float4",
916         "test_fn.vload_global_float8",
917         "test_fn.vload_global_float16",
918         "test_fn.vload_constant_char2",
919         "test_fn.vload_constant_char3",
920         "test_fn.vload_constant_char4",
921         "test_fn.vload_constant_char8",
922         "test_fn.vload_constant_char16",
923         "test_fn.vload_constant_uchar2",
924         "test_fn.vload_constant_uchar3",
925         "test_fn.vload_constant_uchar4",
926         "test_fn.vload_constant_uchar8",
927         "test_fn.vload_constant_uchar16",
928         "test_fn.vload_constant_short2",
929         "test_fn.vload_constant_short3",
930         "test_fn.vload_constant_short4",
931         "test_fn.vload_constant_short8",
932         "test_fn.vload_constant_short16",
933         "test_fn.vload_constant_ushort2",
934         "test_fn.vload_constant_ushort3",
935         "test_fn.vload_constant_ushort4",
936         "test_fn.vload_constant_ushort8",
937         "test_fn.vload_constant_ushort16",
938         "test_fn.vload_constant_int2",
939         "test_fn.vload_constant_int3",
940         "test_fn.vload_constant_int4",
941         "test_fn.vload_constant_int8",
942         "test_fn.vload_constant_int16",
943         "test_fn.vload_constant_uint2",
944         "test_fn.vload_constant_uint3",
945         "test_fn.vload_constant_uint4",
946         "test_fn.vload_constant_uint8",
947         "test_fn.vload_constant_uint16",
948         "test_fn.vload_constant_long2",
949         "test_fn.vload_constant_long3",
950         "test_fn.vload_constant_long4",
951         "test_fn.vload_constant_long8",
952         "test_fn.vload_constant_long16",
953         "test_fn.vload_constant_ulong2",
954         "test_fn.vload_constant_ulong3",
955         "test_fn.vload_constant_ulong4",
956         "test_fn.vload_constant_ulong8",
957         "test_fn.vload_constant_ulong16",
958         "test_fn.vload_constant_float2",
959         "test_fn.vload_constant_float3",
960         "test_fn.vload_constant_float4",
961         "test_fn.vload_constant_float8",
962         "test_fn.vload_constant_float16",
963         "test_fn.vload_private_char2",
964         "test_fn.vload_private_char3",
965         "test_fn.vload_private_char4",
966         "test_fn.vload_private_char8",
967         "test_fn.vload_private_char16",
968         "test_fn.vload_private_uchar2",
969         "test_fn.vload_private_uchar3",
970         "test_fn.vload_private_uchar4",
971         "test_fn.vload_private_uchar8",
972         "test_fn.vload_private_uchar16",
973         "test_fn.vload_private_short2",
974         "test_fn.vload_private_short3",
975         "test_fn.vload_private_short4",
976         "test_fn.vload_private_short8",
977         "test_fn.vload_private_short16",
978         "test_fn.vload_private_ushort2",
979         "test_fn.vload_private_ushort3",
980         "test_fn.vload_private_ushort4",
981         "test_fn.vload_private_ushort8",
982         "test_fn.vload_private_ushort16",
983         "test_fn.vload_private_int2",
984         "test_fn.vload_private_int3",
985         "test_fn.vload_private_int4",
986         "test_fn.vload_private_int8",
987         "test_fn.vload_private_int16",
988         "test_fn.vload_private_uint2",
989         "test_fn.vload_private_uint3",
990         "test_fn.vload_private_uint4",
991         "test_fn.vload_private_uint8",
992         "test_fn.vload_private_uint16",
993         "test_fn.vload_private_long2",
994         "test_fn.vload_private_long3",
995         "test_fn.vload_private_long4",
996         "test_fn.vload_private_long8",
997         "test_fn.vload_private_long16",
998         "test_fn.vload_private_ulong2",
999         "test_fn.vload_private_ulong3",
1000         "test_fn.vload_private_ulong4",
1001         "test_fn.vload_private_ulong8",
1002         "test_fn.vload_private_ulong16",
1003         "test_fn.vload_private_float2",
1004         "test_fn.vload_private_float3",
1005         "test_fn.vload_private_float4",
1006         "test_fn.vload_private_float8",
1007         "test_fn.vload_private_float16",
1008         "test_fn.vload_local_char2",
1009         "test_fn.vload_local_char3",
1010         "test_fn.vload_local_char4",
1011         "test_fn.vload_local_char8",
1012         "test_fn.vload_local_char16",
1013         "test_fn.vload_local_uchar2",
1014         "test_fn.vload_local_uchar3",
1015         "test_fn.vload_local_uchar4",
1016         "test_fn.vload_local_uchar8",
1017         "test_fn.vload_local_uchar16",
1018         "test_fn.vload_local_short2",
1019         "test_fn.vload_local_short3",
1020         "test_fn.vload_local_short4",
1021         "test_fn.vload_local_short8",
1022         "test_fn.vload_local_short16",
1023         "test_fn.vload_local_ushort2",
1024         "test_fn.vload_local_ushort3",
1025         "test_fn.vload_local_ushort4",
1026         "test_fn.vload_local_ushort8",
1027         "test_fn.vload_local_ushort16",
1028         "test_fn.vload_local_int2",
1029         "test_fn.vload_local_int3",
1030         "test_fn.vload_local_int4",
1031         "test_fn.vload_local_int8",
1032         "test_fn.vload_local_int16",
1033         "test_fn.vload_local_uint2",
1034         "test_fn.vload_local_uint3",
1035         "test_fn.vload_local_uint4",
1036         "test_fn.vload_local_uint8",
1037         "test_fn.vload_local_uint16",
1038         "test_fn.vload_local_long2",
1039         "test_fn.vload_local_long3",
1040         "test_fn.vload_local_long4",
1041         "test_fn.vload_local_long8",
1042         "test_fn.vload_local_long16",
1043         "test_fn.vload_local_ulong2",
1044         "test_fn.vload_local_ulong3",
1045         "test_fn.vload_local_ulong4",
1046         "test_fn.vload_local_ulong8",
1047         "test_fn.vload_local_ulong16",
1048         "test_fn.vload_local_float2",
1049         "test_fn.vload_local_float3",
1050         "test_fn.vload_local_float4",
1051         "test_fn.vload_local_float8",
1052         "test_fn.vload_local_float16",
1053         "test_fn.vstore_global_char2",
1054         "test_fn.vstore_global_char3",
1055         "test_fn.vstore_global_char4",
1056         "test_fn.vstore_global_char8",
1057         "test_fn.vstore_global_char16",
1058         "test_fn.vstore_global_uchar2",
1059         "test_fn.vstore_global_uchar3",
1060         "test_fn.vstore_global_uchar4",
1061         "test_fn.vstore_global_uchar8",
1062         "test_fn.vstore_global_uchar16",
1063         "test_fn.vstore_global_short2",
1064         "test_fn.vstore_global_short3",
1065         "test_fn.vstore_global_short4",
1066         "test_fn.vstore_global_short8",
1067         "test_fn.vstore_global_short16",
1068         "test_fn.vstore_global_ushort2",
1069         "test_fn.vstore_global_ushort3",
1070         "test_fn.vstore_global_ushort4",
1071         "test_fn.vstore_global_ushort8",
1072         "test_fn.vstore_global_ushort16",
1073         "test_fn.vstore_global_int2",
1074         "test_fn.vstore_global_int3",
1075         "test_fn.vstore_global_int4",
1076         "test_fn.vstore_global_int8",
1077         "test_fn.vstore_global_int16",
1078         "test_fn.vstore_global_uint2",
1079         "test_fn.vstore_global_uint3",
1080         "test_fn.vstore_global_uint4",
1081         "test_fn.vstore_global_uint8",
1082         "test_fn.vstore_global_uint16",
1083         "test_fn.vstore_global_long2",
1084         "test_fn.vstore_global_long3",
1085         "test_fn.vstore_global_long4",
1086         "test_fn.vstore_global_long8",
1087         "test_fn.vstore_global_long16",
1088         "test_fn.vstore_global_ulong2",
1089         "test_fn.vstore_global_ulong3",
1090         "test_fn.vstore_global_ulong4",
1091         "test_fn.vstore_global_ulong8",
1092         "test_fn.vstore_global_ulong16",
1093         "test_fn.vstore_global_float2",
1094         "test_fn.vstore_global_float3",
1095         "test_fn.vstore_global_float4",
1096         "test_fn.vstore_global_float8",
1097         "test_fn.vstore_global_float16",
1098         "test_fn.vstore_local_char2",
1099         "test_fn.vstore_local_char3",
1100         "test_fn.vstore_local_char4",
1101         "test_fn.vstore_local_char8",
1102         "test_fn.vstore_local_char16",
1103         "test_fn.vstore_local_uchar2",
1104         "test_fn.vstore_local_uchar3",
1105         "test_fn.vstore_local_uchar4",
1106         "test_fn.vstore_local_uchar8",
1107         "test_fn.vstore_local_uchar16",
1108         "test_fn.vstore_local_short2",
1109         "test_fn.vstore_local_short3",
1110         "test_fn.vstore_local_short4",
1111         "test_fn.vstore_local_short8",
1112         "test_fn.vstore_local_short16",
1113         "test_fn.vstore_local_ushort2",
1114         "test_fn.vstore_local_ushort3",
1115         "test_fn.vstore_local_ushort4",
1116         "test_fn.vstore_local_ushort8",
1117         "test_fn.vstore_local_ushort16",
1118         "test_fn.vstore_local_int2",
1119         "test_fn.vstore_local_int3",
1120         "test_fn.vstore_local_int4",
1121         "test_fn.vstore_local_int8",
1122         "test_fn.vstore_local_int16",
1123         "test_fn.vstore_local_uint2",
1124         "test_fn.vstore_local_uint3",
1125         "test_fn.vstore_local_uint4",
1126         "test_fn.vstore_local_uint8",
1127         "test_fn.vstore_local_uint16",
1128         "test_fn.vstore_local_long2",
1129         "test_fn.vstore_local_long3",
1130         "test_fn.vstore_local_long4",
1131         "test_fn.vstore_local_long8",
1132         "test_fn.vstore_local_long16",
1133         "test_fn.vstore_local_ulong2",
1134         "test_fn.vstore_local_ulong3",
1135         "test_fn.vstore_local_ulong4",
1136         "test_fn.vstore_local_ulong8",
1137         "test_fn.vstore_local_ulong16",
1138         "test_fn.vstore_local_float2",
1139         "test_fn.vstore_local_float3",
1140         "test_fn.vstore_local_float4",
1141         "test_fn.vstore_local_float8",
1142         "test_fn.vstore_local_float16",
1143         "test_fn.vstore_private_char2",
1144         "test_fn.vstore_private_char3",
1145         "test_fn.vstore_private_char4",
1146         "test_fn.vstore_private_char8",
1147         "test_fn.vstore_private_char16",
1148         "test_fn.vstore_private_uchar2",
1149         "test_fn.vstore_private_uchar3",
1150         "test_fn.vstore_private_uchar4",
1151         "test_fn.vstore_private_uchar8",
1152         "test_fn.vstore_private_uchar16",
1153         "test_fn.vstore_private_short2",
1154         "test_fn.vstore_private_short3",
1155         "test_fn.vstore_private_short4",
1156         "test_fn.vstore_private_short8",
1157         "test_fn.vstore_private_short16",
1158         "test_fn.vstore_private_ushort2",
1159         "test_fn.vstore_private_ushort3",
1160         "test_fn.vstore_private_ushort4",
1161         "test_fn.vstore_private_ushort8",
1162         "test_fn.vstore_private_ushort16",
1163         "test_fn.vstore_private_int2",
1164         "test_fn.vstore_private_int3",
1165         "test_fn.vstore_private_int4",
1166         "test_fn.vstore_private_int8",
1167         "test_fn.vstore_private_int16",
1168         "test_fn.vstore_private_uint2",
1169         "test_fn.vstore_private_uint3",
1170         "test_fn.vstore_private_uint4",
1171         "test_fn.vstore_private_uint8",
1172         "test_fn.vstore_private_uint16",
1173         "test_fn.vstore_private_long2",
1174         "test_fn.vstore_private_long3",
1175         "test_fn.vstore_private_long4",
1176         "test_fn.vstore_private_long8",
1177         "test_fn.vstore_private_long16",
1178         "test_fn.vstore_private_ulong2",
1179         "test_fn.vstore_private_ulong3",
1180         "test_fn.vstore_private_ulong4",
1181         "test_fn.vstore_private_ulong8",
1182         "test_fn.vstore_private_ulong16",
1183         "test_fn.vstore_private_float2",
1184         "test_fn.vstore_private_float3",
1185         "test_fn.vstore_private_float4",
1186         "test_fn.vstore_private_float8",
1187         "test_fn.vstore_private_float16",
1188         "test_fn.async_copy_global_to_local_char",
1189         "test_fn.async_copy_global_to_local_char2",
1190         "test_fn.async_copy_global_to_local_char4",
1191         "test_fn.async_copy_global_to_local_char8",
1192         "test_fn.async_copy_global_to_local_char16",
1193         "test_fn.async_copy_global_to_local_uchar",
1194         "test_fn.async_copy_global_to_local_uchar2",
1195         "test_fn.async_copy_global_to_local_uchar4",
1196         "test_fn.async_copy_global_to_local_uchar8",
1197         "test_fn.async_copy_global_to_local_uchar16",
1198         "test_fn.async_copy_global_to_local_short",
1199         "test_fn.async_copy_global_to_local_short2",
1200         "test_fn.async_copy_global_to_local_short4",
1201         "test_fn.async_copy_global_to_local_short8",
1202         "test_fn.async_copy_global_to_local_short16",
1203         "test_fn.async_copy_global_to_local_ushort",
1204         "test_fn.async_copy_global_to_local_ushort2",
1205         "test_fn.async_copy_global_to_local_ushort4",
1206         "test_fn.async_copy_global_to_local_ushort8",
1207         "test_fn.async_copy_global_to_local_ushort16",
1208         "test_fn.async_copy_global_to_local_int",
1209         "test_fn.async_copy_global_to_local_int2",
1210         "test_fn.async_copy_global_to_local_int4",
1211         "test_fn.async_copy_global_to_local_int8",
1212         "test_fn.async_copy_global_to_local_int16",
1213         "test_fn.async_copy_global_to_local_uint",
1214         "test_fn.async_copy_global_to_local_uint2",
1215         "test_fn.async_copy_global_to_local_uint4",
1216         "test_fn.async_copy_global_to_local_uint8",
1217         "test_fn.async_copy_global_to_local_uint16",
1218         "test_fn.async_copy_global_to_local_long",
1219         "test_fn.async_copy_global_to_local_long2",
1220         "test_fn.async_copy_global_to_local_long4",
1221         "test_fn.async_copy_global_to_local_long8",
1222         "test_fn.async_copy_global_to_local_long16",
1223         "test_fn.async_copy_global_to_local_ulong",
1224         "test_fn.async_copy_global_to_local_ulong2",
1225         "test_fn.async_copy_global_to_local_ulong4",
1226         "test_fn.async_copy_global_to_local_ulong8",
1227         "test_fn.async_copy_global_to_local_ulong16",
1228         "test_fn.async_copy_global_to_local_float",
1229         "test_fn.async_copy_global_to_local_float2",
1230         "test_fn.async_copy_global_to_local_float4",
1231         "test_fn.async_copy_global_to_local_float8",
1232         "test_fn.async_copy_global_to_local_float16",
1233         "test_fn.async_copy_global_to_local_double",
1234         "test_fn.async_copy_global_to_local_double2",
1235         "test_fn.async_copy_global_to_local_double4",
1236         "test_fn.async_copy_global_to_local_double8",
1237         "test_fn.async_copy_global_to_local_double16",
1238         "test_fn.async_copy_local_to_global_char",
1239         "test_fn.async_copy_local_to_global_char2",
1240         "test_fn.async_copy_local_to_global_char4",
1241         "test_fn.async_copy_local_to_global_char8",
1242         "test_fn.async_copy_local_to_global_char16",
1243         "test_fn.async_copy_local_to_global_uchar",
1244         "test_fn.async_copy_local_to_global_uchar2",
1245         "test_fn.async_copy_local_to_global_uchar4",
1246         "test_fn.async_copy_local_to_global_uchar8",
1247         "test_fn.async_copy_local_to_global_uchar16",
1248         "test_fn.async_copy_local_to_global_short",
1249         "test_fn.async_copy_local_to_global_short2",
1250         "test_fn.async_copy_local_to_global_short4",
1251         "test_fn.async_copy_local_to_global_short8",
1252         "test_fn.async_copy_local_to_global_short16",
1253         "test_fn.async_copy_local_to_global_ushort",
1254         "test_fn.async_copy_local_to_global_ushort2",
1255         "test_fn.async_copy_local_to_global_ushort4",
1256         "test_fn.async_copy_local_to_global_ushort8",
1257         "test_fn.async_copy_local_to_global_ushort16",
1258         "test_fn.async_copy_local_to_global_int",
1259         "test_fn.async_copy_local_to_global_int2",
1260         "test_fn.async_copy_local_to_global_int4",
1261         "test_fn.async_copy_local_to_global_int8",
1262         "test_fn.async_copy_local_to_global_int16",
1263         "test_fn.async_copy_local_to_global_uint",
1264         "test_fn.async_copy_local_to_global_uint2",
1265         "test_fn.async_copy_local_to_global_uint4",
1266         "test_fn.async_copy_local_to_global_uint8",
1267         "test_fn.async_copy_local_to_global_uint16",
1268         "test_fn.async_copy_local_to_global_long",
1269         "test_fn.async_copy_local_to_global_long2",
1270         "test_fn.async_copy_local_to_global_long4",
1271         "test_fn.async_copy_local_to_global_long8",
1272         "test_fn.async_copy_local_to_global_long16",
1273         "test_fn.async_copy_local_to_global_ulong",
1274         "test_fn.async_copy_local_to_global_ulong2",
1275         "test_fn.async_copy_local_to_global_ulong4",
1276         "test_fn.async_copy_local_to_global_ulong8",
1277         "test_fn.async_copy_local_to_global_ulong16",
1278         "test_fn.async_copy_local_to_global_float",
1279         "test_fn.async_copy_local_to_global_float2",
1280         "test_fn.async_copy_local_to_global_float4",
1281         "test_fn.async_copy_local_to_global_float8",
1282         "test_fn.async_copy_local_to_global_float16",
1283         "test_fn.async_strided_copy_global_to_local_char",
1284         "test_fn.async_strided_copy_global_to_local_char2",
1285         "test_fn.async_strided_copy_global_to_local_char4",
1286         "test_fn.async_strided_copy_global_to_local_char8",
1287         "test_fn.async_strided_copy_global_to_local_char16",
1288         "test_fn.async_strided_copy_global_to_local_uchar",
1289         "test_fn.async_strided_copy_global_to_local_uchar2",
1290         "test_fn.async_strided_copy_global_to_local_uchar4",
1291         "test_fn.async_strided_copy_global_to_local_uchar8",
1292         "test_fn.async_strided_copy_global_to_local_uchar16",
1293         "test_fn.async_strided_copy_global_to_local_short",
1294         "test_fn.async_strided_copy_global_to_local_short2",
1295         "test_fn.async_strided_copy_global_to_local_short4",
1296         "test_fn.async_strided_copy_global_to_local_short8",
1297         "test_fn.async_strided_copy_global_to_local_short16",
1298         "test_fn.async_strided_copy_global_to_local_ushort",
1299         "test_fn.async_strided_copy_global_to_local_ushort2",
1300         "test_fn.async_strided_copy_global_to_local_ushort4",
1301         "test_fn.async_strided_copy_global_to_local_ushort8",
1302         "test_fn.async_strided_copy_global_to_local_ushort16",
1303         "test_fn.async_strided_copy_global_to_local_int",
1304         "test_fn.async_strided_copy_global_to_local_int2",
1305         "test_fn.async_strided_copy_global_to_local_int4",
1306         "test_fn.async_strided_copy_global_to_local_int8",
1307         "test_fn.async_strided_copy_global_to_local_int16",
1308         "test_fn.async_strided_copy_global_to_local_uint",
1309         "test_fn.async_strided_copy_global_to_local_uint2",
1310         "test_fn.async_strided_copy_global_to_local_uint4",
1311         "test_fn.async_strided_copy_global_to_local_uint8",
1312         "test_fn.async_strided_copy_global_to_local_uint16",
1313         "test_fn.async_strided_copy_global_to_local_long",
1314         "test_fn.async_strided_copy_global_to_local_long2",
1315         "test_fn.async_strided_copy_global_to_local_long4",
1316         "test_fn.async_strided_copy_global_to_local_long8",
1317         "test_fn.async_strided_copy_global_to_local_long16",
1318         "test_fn.async_strided_copy_global_to_local_ulong",
1319         "test_fn.async_strided_copy_global_to_local_ulong2",
1320         "test_fn.async_strided_copy_global_to_local_ulong4",
1321         "test_fn.async_strided_copy_global_to_local_ulong8",
1322         "test_fn.async_strided_copy_global_to_local_ulong16",
1323         "test_fn.async_strided_copy_global_to_local_float",
1324         "test_fn.async_strided_copy_global_to_local_float2",
1325         "test_fn.async_strided_copy_global_to_local_float4",
1326         "test_fn.async_strided_copy_global_to_local_float8",
1327         "test_fn.async_strided_copy_global_to_local_float16",
1328         "test_fn.async_strided_copy_local_to_global_char",
1329         "test_fn.async_strided_copy_local_to_global_char2",
1330         "test_fn.async_strided_copy_local_to_global_char4",
1331         "test_fn.async_strided_copy_local_to_global_char8",
1332         "test_fn.async_strided_copy_local_to_global_char16",
1333         "test_fn.async_strided_copy_local_to_global_uchar",
1334         "test_fn.async_strided_copy_local_to_global_uchar2",
1335         "test_fn.async_strided_copy_local_to_global_uchar4",
1336         "test_fn.async_strided_copy_local_to_global_uchar8",
1337         "test_fn.async_strided_copy_local_to_global_uchar16",
1338         "test_fn.async_strided_copy_local_to_global_short",
1339         "test_fn.async_strided_copy_local_to_global_short2",
1340         "test_fn.async_strided_copy_local_to_global_short4",
1341         "test_fn.async_strided_copy_local_to_global_short8",
1342         "test_fn.async_strided_copy_local_to_global_short16",
1343         "test_fn.async_strided_copy_local_to_global_ushort",
1344         "test_fn.async_strided_copy_local_to_global_ushort2",
1345         "test_fn.async_strided_copy_local_to_global_ushort4",
1346         "test_fn.async_strided_copy_local_to_global_ushort8",
1347         "test_fn.async_strided_copy_local_to_global_ushort16",
1348         "test_fn.async_strided_copy_local_to_global_int",
1349         "test_fn.async_strided_copy_local_to_global_int2",
1350         "test_fn.async_strided_copy_local_to_global_int4",
1351         "test_fn.async_strided_copy_local_to_global_int8",
1352         "test_fn.async_strided_copy_local_to_global_int16",
1353         "test_fn.async_strided_copy_local_to_global_uint",
1354         "test_fn.async_strided_copy_local_to_global_uint2",
1355         "test_fn.async_strided_copy_local_to_global_uint4",
1356         "test_fn.async_strided_copy_local_to_global_uint8",
1357         "test_fn.async_strided_copy_local_to_global_uint16",
1358         "test_fn.async_strided_copy_local_to_global_long",
1359         "test_fn.async_strided_copy_local_to_global_long2",
1360         "test_fn.async_strided_copy_local_to_global_long4",
1361         "test_fn.async_strided_copy_local_to_global_long8",
1362         "test_fn.async_strided_copy_local_to_global_long16",
1363         "test_fn.async_strided_copy_local_to_global_ulong",
1364         "test_fn.async_strided_copy_local_to_global_ulong2",
1365         "test_fn.async_strided_copy_local_to_global_ulong4",
1366         "test_fn.async_strided_copy_local_to_global_ulong8",
1367         "test_fn.async_strided_copy_local_to_global_ulong16",
1368         "test_fn.async_strided_copy_local_to_global_float",
1369         "test_fn.async_strided_copy_local_to_global_float2",
1370         "test_fn.async_strided_copy_local_to_global_float4",
1371         "test_fn.async_strided_copy_local_to_global_float8",
1372         "test_fn.async_strided_copy_local_to_global_float16",
1373         "test_fn.prefetch_char",
1374         "test_fn.prefetch_char2",
1375         "test_fn.prefetch_char4",
1376         "test_fn.prefetch_char8",
1377         "test_fn.prefetch_char16",
1378         "test_fn.prefetch_uchar",
1379         "test_fn.prefetch_uchar2",
1380         "test_fn.prefetch_uchar4",
1381         "test_fn.prefetch_uchar8",
1382         "test_fn.prefetch_uchar16",
1383         "test_fn.prefetch_short",
1384         "test_fn.prefetch_short2",
1385         "test_fn.prefetch_short4",
1386         "test_fn.prefetch_short8",
1387         "test_fn.prefetch_short16",
1388         "test_fn.prefetch_ushort",
1389         "test_fn.prefetch_ushort2",
1390         "test_fn.prefetch_ushort4",
1391         "test_fn.prefetch_ushort8",
1392         "test_fn.prefetch_ushort16",
1393         "test_fn.prefetch_int",
1394         "test_fn.prefetch_int2",
1395         "test_fn.prefetch_int4",
1396         "test_fn.prefetch_int8",
1397         "test_fn.prefetch_int16",
1398         "test_fn.prefetch_uint",
1399         "test_fn.prefetch_uint2",
1400         "test_fn.prefetch_uint4",
1401         "test_fn.prefetch_uint8",
1402         "test_fn.prefetch_uint16",
1403         "test_fn.prefetch_long",
1404         "test_fn.prefetch_long2",
1405         "test_fn.prefetch_long4",
1406         "test_fn.prefetch_long8",
1407         "test_fn.prefetch_long16",
1408         "test_fn.prefetch_ulong",
1409         "test_fn.prefetch_ulong2",
1410         "test_fn.prefetch_ulong4",
1411         "test_fn.prefetch_ulong8",
1412         "test_fn.prefetch_ulong16",
1413         "test_fn.prefetch_float",
1414         "test_fn.prefetch_float2",
1415         "test_fn.prefetch_float4",
1416         "test_fn.prefetch_float8",
1417         "test_fn.prefetch_float16",
1418     };
1419 
1420     log_info("test_basic\n");
1421     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
1422 }
1423 
test_basic_double(cl_device_id device,cl_uint size_t_width,const char * folder)1424 bool test_basic_double (cl_device_id device, cl_uint size_t_width, const char *folder)
1425 {
1426     static const char* test_name[] = {
1427         "sample_test.vec_type_hint_double",
1428         "sample_test.vec_type_hint_double2",
1429         "sample_test.vec_type_hint_double4",
1430         "sample_test.vec_type_hint_double8",
1431         "sample_test.vec_type_hint_double16",
1432         "test.kernel_memory_alignment_private_double",
1433         "test_fn.vload_global_double2",
1434         "test_fn.vload_global_double3",
1435         "test_fn.vload_global_double4",
1436         "test_fn.vload_global_double8",
1437         "test_fn.vload_global_double16",
1438         "test_fn.vload_constant_double2",
1439         "test_fn.vload_constant_double3",
1440         "test_fn.vload_constant_double4",
1441         "test_fn.vload_constant_double8",
1442         "test_fn.vload_constant_double16",
1443         "test_fn.vstore_global_double2",
1444         "test_fn.vstore_global_double3",
1445         "test_fn.vstore_global_double4",
1446         "test_fn.vstore_global_double8",
1447         "test_fn.vstore_global_double16",
1448         "test_fn.vload_local_double2",
1449         "test_fn.vload_local_double3",
1450         "test_fn.vload_local_double4",
1451         "test_fn.vload_local_double8",
1452         "test_fn.vload_local_double16",
1453         "test_fn.vstore_global_double2",
1454         "test_fn.vstore_global_double3",
1455         "test_fn.vstore_global_double4",
1456         "test_fn.vstore_global_double8",
1457         "test_fn.vstore_global_double16",
1458         "test_fn.vstore_local_double2",
1459         "test_fn.vstore_local_double3",
1460         "test_fn.vstore_local_double4",
1461         "test_fn.vstore_local_double8",
1462         "test_fn.vstore_local_double16",
1463         "test_fn.vstore_private_double2",
1464         "test_fn.vstore_private_double3",
1465         "test_fn.vstore_private_double4",
1466         "test_fn.vstore_private_double8",
1467         "test_fn.vstore_private_double16",
1468         "test_fn.async_copy_local_to_global_double",
1469         "test_fn.async_copy_local_to_global_double2",
1470         "test_fn.async_copy_local_to_global_double4",
1471         "test_fn.async_copy_local_to_global_double8",
1472         "test_fn.async_copy_local_to_global_double16",
1473         "test_fn.async_strided_copy_global_to_local_double",
1474         "test_fn.async_strided_copy_global_to_local_double2",
1475         "test_fn.async_strided_copy_global_to_local_double4",
1476         "test_fn.async_strided_copy_global_to_local_double8",
1477         "test_fn.async_strided_copy_global_to_local_double16",
1478         "test_fn.async_strided_copy_local_to_global_double",
1479         "test_fn.async_strided_copy_local_to_global_double2",
1480         "test_fn.async_strided_copy_local_to_global_double4",
1481         "test_fn.async_strided_copy_local_to_global_double8",
1482         "test_fn.async_strided_copy_local_to_global_double16",
1483         "test_fn.prefetch_double",
1484         "test_fn.prefetch_double2",
1485         "test_fn.prefetch_double4",
1486         "test_fn.prefetch_double8",
1487         "test_fn.prefetch_double16",
1488     };
1489 
1490     log_info("test_basic_double\n");
1491     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
1492 }
1493 
1494 
test_commonfns(cl_device_id device,cl_uint size_t_width,const char * folder)1495 bool test_commonfns (cl_device_id device, cl_uint size_t_width, const char *folder)
1496 {
1497     static const char* test_name[] = {
1498         "test_clamp.test_clamp_float",
1499         "test_clamp.test_clamp_float2",
1500         "test_clamp.test_clamp_float4",
1501         "test_clamp.test_clamp_float8",
1502         "test_clamp.test_clamp_float16",
1503         "test_clamp.test_clamp_float3",
1504         "test_degrees",
1505         "test_degrees2",
1506         "test_degrees4",
1507         "test_degrees8",
1508         "test_degrees16",
1509         "test_degrees3",
1510         "test_fmax",
1511         "test_fmax2",
1512         "test_fmax4",
1513         "test_fmax8",
1514         "test_fmax16",
1515         "test_fmax3",
1516         "test_fmin",
1517         "test_fmin2",
1518         "test_fmin4",
1519         "test_fmin8",
1520         "test_fmin16",
1521         "test_fmin3",
1522         "test_fn.test_max_float",
1523         "test_fn.test_max_float2",
1524         "test_fn.test_max_float4",
1525         "test_fn.test_max_float8",
1526         "test_fn.test_max_float16",
1527         "test_fn.test_max_float3",
1528         "test_fn.test_min_float",
1529         "test_fn.test_min_float2",
1530         "test_fn.test_min_float4",
1531         "test_fn.test_min_float8",
1532         "test_fn.test_min_float16",
1533         "test_fn.test_min_float3",
1534         "test_mix",
1535         "test_radians",
1536         "test_radians2",
1537         "test_radians4",
1538         "test_radians8",
1539         "test_radians16",
1540         "test_radians3",
1541         "test_step",
1542         "test_step2",
1543         "test_step4",
1544         "test_step8",
1545         "test_step16",
1546         "test_step3",
1547         "test_smoothstep",
1548         "test_smoothstep2",
1549         "test_smoothstep4",
1550         "test_smoothstep8",
1551         "test_smoothstep16",
1552         "test_smoothstep3",
1553         "test_sign",
1554         "test_sign2",
1555         "test_sign4",
1556         "test_sign8",
1557         "test_sign16",
1558         "test_sign3",
1559     };
1560 
1561     log_info("test_commonfns\n");
1562     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
1563 }
1564 
1565 
test_commonfns_double(cl_device_id device,cl_uint size_t_width,const char * folder)1566 bool test_commonfns_double (cl_device_id device, cl_uint size_t_width, const char *folder)
1567 {
1568     static const char* test_name[] = {
1569         "test_clamp.test_clamp_double",
1570         "test_clamp.test_clamp_double2",
1571         "test_clamp.test_clamp_double4",
1572         "test_clamp.test_clamp_double8",
1573         "test_clamp.test_clamp_double16",
1574         "test_clamp.test_clamp_double3",
1575         "test_degrees_double",
1576         "test_degrees2_double",
1577         "test_degrees4_double",
1578         "test_degrees8_double",
1579         "test_degrees16_double",
1580         "test_degrees3_double",
1581         "test_fn.test_max_double",
1582         "test_fn.test_max_double2",
1583         "test_fn.test_max_double4",
1584         "test_fn.test_max_double8",
1585         "test_fn.test_max_double16",
1586         "test_fn.test_max_double3",
1587         "test_fn.test_min_double",
1588         "test_fn.test_min_double2",
1589         "test_fn.test_min_double4",
1590         "test_fn.test_min_double8",
1591         "test_fn.test_min_double16",
1592         "test_fn.test_min_double3",
1593         "test_radians_double",
1594         "test_radians2_double",
1595         "test_radians4_double",
1596         "test_radians8_double",
1597         "test_radians16_double",
1598         "test_radians3_double",
1599         "test_step_double",
1600         "test_step2_double",
1601         "test_step4_double",
1602         "test_step8_double",
1603         "test_step16_double",
1604         "test_step3_double",
1605         "test_sign_double",
1606         "test_sign2_double",
1607         "test_sign4_double",
1608         "test_sign8_double",
1609         "test_sign16_double",
1610         "test_sign3_double",
1611     };
1612 
1613     log_info("test_commonfns_double\n");
1614     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
1615 }
1616 
test_conversions(cl_device_id device,cl_uint size_t_width,const char * folder)1617 bool test_conversions (cl_device_id device, cl_uint size_t_width, const char *folder)
1618 {
1619     static const char* test_name[] = {
1620         "convert2_type_roundingmode_type_f",
1621         "convert3_type_roundingmode_type_f",
1622         "convert4_type_roundingmode_type_f",
1623         "convert8_type_roundingmode_type_f",
1624         "convert16_type_roundingmode_type_f",
1625         "test_implicit_uchar_uchar",
1626         "test_convert_uchar_uchar",
1627         "test_convert_uchar_rte_uchar",
1628         "test_convert_uchar_rtp_uchar",
1629         "test_convert_uchar_rtn_uchar",
1630         "test_convert_uchar_rtz_uchar",
1631         "test_convert_uchar_sat_uchar",
1632         "test_convert_uchar_sat_rte_uchar",
1633         "test_convert_uchar_sat_rtp_uchar",
1634         "test_convert_uchar_sat_rtn_uchar",
1635         "test_convert_uchar_sat_rtz_uchar",
1636         "test_implicit_uchar_char",
1637         "test_convert_uchar_char",
1638         "test_convert_uchar_rte_char",
1639         "test_convert_uchar_rtp_char",
1640         "test_convert_uchar_rtn_char",
1641         "test_convert_uchar_rtz_char",
1642         "test_convert_uchar_sat_char",
1643         "test_convert_uchar_sat_rte_char",
1644         "test_convert_uchar_sat_rtp_char",
1645         "test_convert_uchar_sat_rtn_char",
1646         "test_convert_uchar_sat_rtz_char",
1647         "test_implicit_uchar_ushort",
1648         "test_convert_uchar_ushort",
1649         "test_convert_uchar_rte_ushort",
1650         "test_convert_uchar_rtp_ushort",
1651         "test_convert_uchar_rtn_ushort",
1652         "test_convert_uchar_rtz_ushort",
1653         "test_convert_uchar_sat_ushort",
1654         "test_convert_uchar_sat_rte_ushort",
1655         "test_convert_uchar_sat_rtp_ushort",
1656         "test_convert_uchar_sat_rtn_ushort",
1657         "test_convert_uchar_sat_rtz_ushort",
1658         "test_implicit_uchar_short",
1659         "test_convert_uchar_short",
1660         "test_convert_uchar_rte_short",
1661         "test_convert_uchar_rtp_short",
1662         "test_convert_uchar_rtn_short",
1663         "test_convert_uchar_rtz_short",
1664         "test_convert_uchar_sat_short",
1665         "test_convert_uchar_sat_rte_short",
1666         "test_convert_uchar_sat_rtp_short",
1667         "test_convert_uchar_sat_rtn_short",
1668         "test_convert_uchar_sat_rtz_short",
1669         "test_implicit_uchar_uint",
1670         "test_convert_uchar_uint",
1671         "test_convert_uchar_rte_uint",
1672         "test_convert_uchar_rtp_uint",
1673         "test_convert_uchar_rtn_uint",
1674         "test_convert_uchar_rtz_uint",
1675         "test_convert_uchar_sat_uint",
1676         "test_convert_uchar_sat_rte_uint",
1677         "test_convert_uchar_sat_rtp_uint",
1678         "test_convert_uchar_sat_rtn_uint",
1679         "test_convert_uchar_sat_rtz_uint",
1680         "test_implicit_uchar_int",
1681         "test_convert_uchar_int",
1682         "test_convert_uchar_rte_int",
1683         "test_convert_uchar_rtp_int",
1684         "test_convert_uchar_rtn_int",
1685         "test_convert_uchar_rtz_int",
1686         "test_convert_uchar_sat_int",
1687         "test_convert_uchar_sat_rte_int",
1688         "test_convert_uchar_sat_rtp_int",
1689         "test_convert_uchar_sat_rtn_int",
1690         "test_convert_uchar_sat_rtz_int",
1691         "test_implicit_uchar_float",
1692         "test_convert_uchar_float",
1693         "test_convert_uchar_rte_float",
1694         "test_convert_uchar_rtp_float",
1695         "test_convert_uchar_rtn_float",
1696         "test_convert_uchar_rtz_float",
1697         "test_convert_uchar_sat_float",
1698         "test_convert_uchar_sat_rte_float",
1699         "test_convert_uchar_sat_rtp_float",
1700         "test_convert_uchar_sat_rtn_float",
1701         "test_convert_uchar_sat_rtz_float",
1702         "test_implicit_uchar_ulong",
1703         "test_convert_uchar_ulong",
1704         "test_convert_uchar_rte_ulong",
1705         "test_convert_uchar_rtp_ulong",
1706         "test_convert_uchar_rtn_ulong",
1707         "test_convert_uchar_rtz_ulong",
1708         "test_convert_uchar_sat_ulong",
1709         "test_convert_uchar_sat_rte_ulong",
1710         "test_convert_uchar_sat_rtp_ulong",
1711         "test_convert_uchar_sat_rtn_ulong",
1712         "test_convert_uchar_sat_rtz_ulong",
1713         "test_implicit_uchar_long",
1714         "test_convert_uchar_long",
1715         "test_convert_uchar_rte_long",
1716         "test_convert_uchar_rtp_long",
1717         "test_convert_uchar_rtn_long",
1718         "test_convert_uchar_rtz_long",
1719         "test_convert_uchar_sat_long",
1720         "test_convert_uchar_sat_rte_long",
1721         "test_convert_uchar_sat_rtp_long",
1722         "test_convert_uchar_sat_rtn_long",
1723         "test_convert_uchar_sat_rtz_long",
1724         "test_implicit_char_uchar",
1725         "test_convert_char_uchar",
1726         "test_convert_char_rte_uchar",
1727         "test_convert_char_rtp_uchar",
1728         "test_convert_char_rtn_uchar",
1729         "test_convert_char_rtz_uchar",
1730         "test_convert_char_sat_uchar",
1731         "test_convert_char_sat_rte_uchar",
1732         "test_convert_char_sat_rtp_uchar",
1733         "test_convert_char_sat_rtn_uchar",
1734         "test_convert_char_sat_rtz_uchar",
1735         "test_implicit_char_char",
1736         "test_convert_char_char",
1737         "test_convert_char_rte_char",
1738         "test_convert_char_rtp_char",
1739         "test_convert_char_rtn_char",
1740         "test_convert_char_rtz_char",
1741         "test_convert_char_sat_char",
1742         "test_convert_char_sat_rte_char",
1743         "test_convert_char_sat_rtp_char",
1744         "test_convert_char_sat_rtn_char",
1745         "test_convert_char_sat_rtz_char",
1746         "test_implicit_char_ushort",
1747         "test_convert_char_ushort",
1748         "test_convert_char_rte_ushort",
1749         "test_convert_char_rtp_ushort",
1750         "test_convert_char_rtn_ushort",
1751         "test_convert_char_rtz_ushort",
1752         "test_convert_char_sat_ushort",
1753         "test_convert_char_sat_rte_ushort",
1754         "test_convert_char_sat_rtp_ushort",
1755         "test_convert_char_sat_rtn_ushort",
1756         "test_convert_char_sat_rtz_ushort",
1757         "test_implicit_char_short",
1758         "test_convert_char_short",
1759         "test_convert_char_rte_short",
1760         "test_convert_char_rtp_short",
1761         "test_convert_char_rtn_short",
1762         "test_convert_char_rtz_short",
1763         "test_convert_char_sat_short",
1764         "test_convert_char_sat_rte_short",
1765         "test_convert_char_sat_rtp_short",
1766         "test_convert_char_sat_rtn_short",
1767         "test_convert_char_sat_rtz_short",
1768         "test_implicit_char_uint",
1769         "test_convert_char_uint",
1770         "test_convert_char_rte_uint",
1771         "test_convert_char_rtp_uint",
1772         "test_convert_char_rtn_uint",
1773         "test_convert_char_rtz_uint",
1774         "test_convert_char_sat_uint",
1775         "test_convert_char_sat_rte_uint",
1776         "test_convert_char_sat_rtp_uint",
1777         "test_convert_char_sat_rtn_uint",
1778         "test_convert_char_sat_rtz_uint",
1779         "test_implicit_char_int",
1780         "test_convert_char_int",
1781         "test_convert_char_rte_int",
1782         "test_convert_char_rtp_int",
1783         "test_convert_char_rtn_int",
1784         "test_convert_char_rtz_int",
1785         "test_convert_char_sat_int",
1786         "test_convert_char_sat_rte_int",
1787         "test_convert_char_sat_rtp_int",
1788         "test_convert_char_sat_rtn_int",
1789         "test_convert_char_sat_rtz_int",
1790         "test_implicit_char_float",
1791         "test_convert_char_float",
1792         "test_convert_char_rte_float",
1793         "test_convert_char_rtp_float",
1794         "test_convert_char_rtn_float",
1795         "test_convert_char_rtz_float",
1796         "test_convert_char_sat_float",
1797         "test_convert_char_sat_rte_float",
1798         "test_convert_char_sat_rtp_float",
1799         "test_convert_char_sat_rtn_float",
1800         "test_convert_char_sat_rtz_float",
1801         "test_implicit_char_ulong",
1802         "test_convert_char_ulong",
1803         "test_convert_char_rte_ulong",
1804         "test_convert_char_rtp_ulong",
1805         "test_convert_char_rtn_ulong",
1806         "test_convert_char_rtz_ulong",
1807         "test_convert_char_sat_ulong",
1808         "test_convert_char_sat_rte_ulong",
1809         "test_convert_char_sat_rtp_ulong",
1810         "test_convert_char_sat_rtn_ulong",
1811         "test_convert_char_sat_rtz_ulong",
1812         "test_implicit_char_long",
1813         "test_convert_char_long",
1814         "test_convert_char_rte_long",
1815         "test_convert_char_rtp_long",
1816         "test_convert_char_rtn_long",
1817         "test_convert_char_rtz_long",
1818         "test_convert_char_sat_long",
1819         "test_convert_char_sat_rte_long",
1820         "test_convert_char_sat_rtp_long",
1821         "test_convert_char_sat_rtn_long",
1822         "test_convert_char_sat_rtz_long",
1823         "test_implicit_ushort_uchar",
1824         "test_convert_ushort_uchar",
1825         "test_convert_ushort_rte_uchar",
1826         "test_convert_ushort_rtp_uchar",
1827         "test_convert_ushort_rtn_uchar",
1828         "test_convert_ushort_rtz_uchar",
1829         "test_convert_ushort_sat_uchar",
1830         "test_convert_ushort_sat_rte_uchar",
1831         "test_convert_ushort_sat_rtp_uchar",
1832         "test_convert_ushort_sat_rtn_uchar",
1833         "test_convert_ushort_sat_rtz_uchar",
1834         "test_implicit_ushort_char",
1835         "test_convert_ushort_char",
1836         "test_convert_ushort_rte_char",
1837         "test_convert_ushort_rtp_char",
1838         "test_convert_ushort_rtn_char",
1839         "test_convert_ushort_rtz_char",
1840         "test_convert_ushort_sat_char",
1841         "test_convert_ushort_sat_rte_char",
1842         "test_convert_ushort_sat_rtp_char",
1843         "test_convert_ushort_sat_rtn_char",
1844         "test_convert_ushort_sat_rtz_char",
1845         "test_implicit_ushort_ushort",
1846         "test_convert_ushort_ushort",
1847         "test_convert_ushort_rte_ushort",
1848         "test_convert_ushort_rtp_ushort",
1849         "test_convert_ushort_rtn_ushort",
1850         "test_convert_ushort_rtz_ushort",
1851         "test_convert_ushort_sat_ushort",
1852         "test_convert_ushort_sat_rte_ushort",
1853         "test_convert_ushort_sat_rtp_ushort",
1854         "test_convert_ushort_sat_rtn_ushort",
1855         "test_convert_ushort_sat_rtz_ushort",
1856         "test_implicit_ushort_short",
1857         "test_convert_ushort_short",
1858         "test_convert_ushort_rte_short",
1859         "test_convert_ushort_rtp_short",
1860         "test_convert_ushort_rtn_short",
1861         "test_convert_ushort_rtz_short",
1862         "test_convert_ushort_sat_short",
1863         "test_convert_ushort_sat_rte_short",
1864         "test_convert_ushort_sat_rtp_short",
1865         "test_convert_ushort_sat_rtn_short",
1866         "test_convert_ushort_sat_rtz_short",
1867         "test_implicit_ushort_uint",
1868         "test_convert_ushort_uint",
1869         "test_convert_ushort_rte_uint",
1870         "test_convert_ushort_rtp_uint",
1871         "test_convert_ushort_rtn_uint",
1872         "test_convert_ushort_rtz_uint",
1873         "test_convert_ushort_sat_uint",
1874         "test_convert_ushort_sat_rte_uint",
1875         "test_convert_ushort_sat_rtp_uint",
1876         "test_convert_ushort_sat_rtn_uint",
1877         "test_convert_ushort_sat_rtz_uint",
1878         "test_implicit_ushort_int",
1879         "test_convert_ushort_int",
1880         "test_convert_ushort_rte_int",
1881         "test_convert_ushort_rtp_int",
1882         "test_convert_ushort_rtn_int",
1883         "test_convert_ushort_rtz_int",
1884         "test_convert_ushort_sat_int",
1885         "test_convert_ushort_sat_rte_int",
1886         "test_convert_ushort_sat_rtp_int",
1887         "test_convert_ushort_sat_rtn_int",
1888         "test_convert_ushort_sat_rtz_int",
1889         "test_implicit_ushort_float",
1890         "test_convert_ushort_float",
1891         "test_convert_ushort_rte_float",
1892         "test_convert_ushort_rtp_float",
1893         "test_convert_ushort_rtn_float",
1894         "test_convert_ushort_rtz_float",
1895         "test_convert_ushort_sat_float",
1896         "test_convert_ushort_sat_rte_float",
1897         "test_convert_ushort_sat_rtp_float",
1898         "test_convert_ushort_sat_rtn_float",
1899         "test_convert_ushort_sat_rtz_float",
1900         "test_implicit_ushort_ulong",
1901         "test_convert_ushort_ulong",
1902         "test_convert_ushort_rte_ulong",
1903         "test_convert_ushort_rtp_ulong",
1904         "test_convert_ushort_rtn_ulong",
1905         "test_convert_ushort_rtz_ulong",
1906         "test_convert_ushort_sat_ulong",
1907         "test_convert_ushort_sat_rte_ulong",
1908         "test_convert_ushort_sat_rtp_ulong",
1909         "test_convert_ushort_sat_rtn_ulong",
1910         "test_convert_ushort_sat_rtz_ulong",
1911         "test_implicit_ushort_long",
1912         "test_convert_ushort_long",
1913         "test_convert_ushort_rte_long",
1914         "test_convert_ushort_rtp_long",
1915         "test_convert_ushort_rtn_long",
1916         "test_convert_ushort_rtz_long",
1917         "test_convert_ushort_sat_long",
1918         "test_convert_ushort_sat_rte_long",
1919         "test_convert_ushort_sat_rtp_long",
1920         "test_convert_ushort_sat_rtn_long",
1921         "test_convert_ushort_sat_rtz_long",
1922         "test_implicit_short_uchar",
1923         "test_convert_short_uchar",
1924         "test_convert_short_rte_uchar",
1925         "test_convert_short_rtp_uchar",
1926         "test_convert_short_rtn_uchar",
1927         "test_convert_short_rtz_uchar",
1928         "test_convert_short_sat_uchar",
1929         "test_convert_short_sat_rte_uchar",
1930         "test_convert_short_sat_rtp_uchar",
1931         "test_convert_short_sat_rtn_uchar",
1932         "test_convert_short_sat_rtz_uchar",
1933         "test_implicit_short_char",
1934         "test_convert_short_char",
1935         "test_convert_short_rte_char",
1936         "test_convert_short_rtp_char",
1937         "test_convert_short_rtn_char",
1938         "test_convert_short_rtz_char",
1939         "test_convert_short_sat_char",
1940         "test_convert_short_sat_rte_char",
1941         "test_convert_short_sat_rtp_char",
1942         "test_convert_short_sat_rtn_char",
1943         "test_convert_short_sat_rtz_char",
1944         "test_implicit_short_ushort",
1945         "test_convert_short_ushort",
1946         "test_convert_short_rte_ushort",
1947         "test_convert_short_rtp_ushort",
1948         "test_convert_short_rtn_ushort",
1949         "test_convert_short_rtz_ushort",
1950         "test_convert_short_sat_ushort",
1951         "test_convert_short_sat_rte_ushort",
1952         "test_convert_short_sat_rtp_ushort",
1953         "test_convert_short_sat_rtn_ushort",
1954         "test_convert_short_sat_rtz_ushort",
1955         "test_implicit_short_short",
1956         "test_convert_short_short",
1957         "test_convert_short_rte_short",
1958         "test_convert_short_rtp_short",
1959         "test_convert_short_rtn_short",
1960         "test_convert_short_rtz_short",
1961         "test_convert_short_sat_short",
1962         "test_convert_short_sat_rte_short",
1963         "test_convert_short_sat_rtp_short",
1964         "test_convert_short_sat_rtn_short",
1965         "test_convert_short_sat_rtz_short",
1966         "test_implicit_short_uint",
1967         "test_convert_short_uint",
1968         "test_convert_short_rte_uint",
1969         "test_convert_short_rtp_uint",
1970         "test_convert_short_rtn_uint",
1971         "test_convert_short_rtz_uint",
1972         "test_convert_short_sat_uint",
1973         "test_convert_short_sat_rte_uint",
1974         "test_convert_short_sat_rtp_uint",
1975         "test_convert_short_sat_rtn_uint",
1976         "test_convert_short_sat_rtz_uint",
1977         "test_implicit_short_int",
1978         "test_convert_short_int",
1979         "test_convert_short_rte_int",
1980         "test_convert_short_rtp_int",
1981         "test_convert_short_rtn_int",
1982         "test_convert_short_rtz_int",
1983         "test_convert_short_sat_int",
1984         "test_convert_short_sat_rte_int",
1985         "test_convert_short_sat_rtp_int",
1986         "test_convert_short_sat_rtn_int",
1987         "test_convert_short_sat_rtz_int",
1988         "test_implicit_short_float",
1989         "test_convert_short_float",
1990         "test_convert_short_rte_float",
1991         "test_convert_short_rtp_float",
1992         "test_convert_short_rtn_float",
1993         "test_convert_short_rtz_float",
1994         "test_convert_short_sat_float",
1995         "test_convert_short_sat_rte_float",
1996         "test_convert_short_sat_rtp_float",
1997         "test_convert_short_sat_rtn_float",
1998         "test_convert_short_sat_rtz_float",
1999         "test_implicit_short_ulong",
2000         "test_convert_short_ulong",
2001         "test_convert_short_rte_ulong",
2002         "test_convert_short_rtp_ulong",
2003         "test_convert_short_rtn_ulong",
2004         "test_convert_short_rtz_ulong",
2005         "test_convert_short_sat_ulong",
2006         "test_convert_short_sat_rte_ulong",
2007         "test_convert_short_sat_rtp_ulong",
2008         "test_convert_short_sat_rtn_ulong",
2009         "test_convert_short_sat_rtz_ulong",
2010         "test_implicit_short_long",
2011         "test_convert_short_long",
2012         "test_convert_short_rte_long",
2013         "test_convert_short_rtp_long",
2014         "test_convert_short_rtn_long",
2015         "test_convert_short_rtz_long",
2016         "test_convert_short_sat_long",
2017         "test_convert_short_sat_rte_long",
2018         "test_convert_short_sat_rtp_long",
2019         "test_convert_short_sat_rtn_long",
2020         "test_convert_short_sat_rtz_long",
2021         "test_implicit_uint_uchar",
2022         "test_convert_uint_uchar",
2023         "test_convert_uint_rte_uchar",
2024         "test_convert_uint_rtp_uchar",
2025         "test_convert_uint_rtn_uchar",
2026         "test_convert_uint_rtz_uchar",
2027         "test_convert_uint_sat_uchar",
2028         "test_convert_uint_sat_rte_uchar",
2029         "test_convert_uint_sat_rtp_uchar",
2030         "test_convert_uint_sat_rtn_uchar",
2031         "test_convert_uint_sat_rtz_uchar",
2032         "test_implicit_uint_char",
2033         "test_convert_uint_char",
2034         "test_convert_uint_rte_char",
2035         "test_convert_uint_rtp_char",
2036         "test_convert_uint_rtn_char",
2037         "test_convert_uint_rtz_char",
2038         "test_convert_uint_sat_char",
2039         "test_convert_uint_sat_rte_char",
2040         "test_convert_uint_sat_rtp_char",
2041         "test_convert_uint_sat_rtn_char",
2042         "test_convert_uint_sat_rtz_char",
2043         "test_implicit_uint_ushort",
2044         "test_convert_uint_ushort",
2045         "test_convert_uint_rte_ushort",
2046         "test_convert_uint_rtp_ushort",
2047         "test_convert_uint_rtn_ushort",
2048         "test_convert_uint_rtz_ushort",
2049         "test_convert_uint_sat_ushort",
2050         "test_convert_uint_sat_rte_ushort",
2051         "test_convert_uint_sat_rtp_ushort",
2052         "test_convert_uint_sat_rtn_ushort",
2053         "test_convert_uint_sat_rtz_ushort",
2054         "test_implicit_uint_short",
2055         "test_convert_uint_short",
2056         "test_convert_uint_rte_short",
2057         "test_convert_uint_rtp_short",
2058         "test_convert_uint_rtn_short",
2059         "test_convert_uint_rtz_short",
2060         "test_convert_uint_sat_short",
2061         "test_convert_uint_sat_rte_short",
2062         "test_convert_uint_sat_rtp_short",
2063         "test_convert_uint_sat_rtn_short",
2064         "test_convert_uint_sat_rtz_short",
2065         "test_implicit_uint_uint",
2066         "test_convert_uint_uint",
2067         "test_convert_uint_rte_uint",
2068         "test_convert_uint_rtp_uint",
2069         "test_convert_uint_rtn_uint",
2070         "test_convert_uint_rtz_uint",
2071         "test_convert_uint_sat_uint",
2072         "test_convert_uint_sat_rte_uint",
2073         "test_convert_uint_sat_rtp_uint",
2074         "test_convert_uint_sat_rtn_uint",
2075         "test_convert_uint_sat_rtz_uint",
2076         "test_implicit_uint_int",
2077         "test_convert_uint_int",
2078         "test_convert_uint_rte_int",
2079         "test_convert_uint_rtp_int",
2080         "test_convert_uint_rtn_int",
2081         "test_convert_uint_rtz_int",
2082         "test_convert_uint_sat_int",
2083         "test_convert_uint_sat_rte_int",
2084         "test_convert_uint_sat_rtp_int",
2085         "test_convert_uint_sat_rtn_int",
2086         "test_convert_uint_sat_rtz_int",
2087         "test_implicit_uint_float",
2088         "test_convert_uint_float",
2089         "test_convert_uint_rte_float",
2090         "test_convert_uint_rtp_float",
2091         "test_convert_uint_rtn_float",
2092         "test_convert_uint_rtz_float",
2093         "test_convert_uint_sat_float",
2094         "test_convert_uint_sat_rte_float",
2095         "test_convert_uint_sat_rtp_float",
2096         "test_convert_uint_sat_rtn_float",
2097         "test_convert_uint_sat_rtz_float",
2098         "test_implicit_uint_ulong",
2099         "test_convert_uint_ulong",
2100         "test_convert_uint_rte_ulong",
2101         "test_convert_uint_rtp_ulong",
2102         "test_convert_uint_rtn_ulong",
2103         "test_convert_uint_rtz_ulong",
2104         "test_convert_uint_sat_ulong",
2105         "test_convert_uint_sat_rte_ulong",
2106         "test_convert_uint_sat_rtp_ulong",
2107         "test_convert_uint_sat_rtn_ulong",
2108         "test_convert_uint_sat_rtz_ulong",
2109         "test_implicit_uint_long",
2110         "test_convert_uint_long",
2111         "test_convert_uint_rte_long",
2112         "test_convert_uint_rtp_long",
2113         "test_convert_uint_rtn_long",
2114         "test_convert_uint_rtz_long",
2115         "test_convert_uint_sat_long",
2116         "test_convert_uint_sat_rte_long",
2117         "test_convert_uint_sat_rtp_long",
2118         "test_convert_uint_sat_rtn_long",
2119         "test_convert_uint_sat_rtz_long",
2120         "test_implicit_int_uchar",
2121         "test_convert_int_uchar",
2122         "test_convert_int_rte_uchar",
2123         "test_convert_int_rtp_uchar",
2124         "test_convert_int_rtn_uchar",
2125         "test_convert_int_rtz_uchar",
2126         "test_convert_int_sat_uchar",
2127         "test_convert_int_sat_rte_uchar",
2128         "test_convert_int_sat_rtp_uchar",
2129         "test_convert_int_sat_rtn_uchar",
2130         "test_convert_int_sat_rtz_uchar",
2131         "test_implicit_int_char",
2132         "test_convert_int_char",
2133         "test_convert_int_rte_char",
2134         "test_convert_int_rtp_char",
2135         "test_convert_int_rtn_char",
2136         "test_convert_int_rtz_char",
2137         "test_convert_int_sat_char",
2138         "test_convert_int_sat_rte_char",
2139         "test_convert_int_sat_rtp_char",
2140         "test_convert_int_sat_rtn_char",
2141         "test_convert_int_sat_rtz_char",
2142         "test_implicit_int_ushort",
2143         "test_convert_int_ushort",
2144         "test_convert_int_rte_ushort",
2145         "test_convert_int_rtp_ushort",
2146         "test_convert_int_rtn_ushort",
2147         "test_convert_int_rtz_ushort",
2148         "test_convert_int_sat_ushort",
2149         "test_convert_int_sat_rte_ushort",
2150         "test_convert_int_sat_rtp_ushort",
2151         "test_convert_int_sat_rtn_ushort",
2152         "test_convert_int_sat_rtz_ushort",
2153         "test_implicit_int_short",
2154         "test_convert_int_short",
2155         "test_convert_int_rte_short",
2156         "test_convert_int_rtp_short",
2157         "test_convert_int_rtn_short",
2158         "test_convert_int_rtz_short",
2159         "test_convert_int_sat_short",
2160         "test_convert_int_sat_rte_short",
2161         "test_convert_int_sat_rtp_short",
2162         "test_convert_int_sat_rtn_short",
2163         "test_convert_int_sat_rtz_short",
2164         "test_implicit_int_uint",
2165         "test_convert_int_uint",
2166         "test_convert_int_rte_uint",
2167         "test_convert_int_rtp_uint",
2168         "test_convert_int_rtn_uint",
2169         "test_convert_int_rtz_uint",
2170         "test_convert_int_sat_uint",
2171         "test_convert_int_sat_rte_uint",
2172         "test_convert_int_sat_rtp_uint",
2173         "test_convert_int_sat_rtn_uint",
2174         "test_convert_int_sat_rtz_uint",
2175         "test_implicit_int_int",
2176         "test_convert_int_int",
2177         "test_convert_int_rte_int",
2178         "test_convert_int_rtp_int",
2179         "test_convert_int_rtn_int",
2180         "test_convert_int_rtz_int",
2181         "test_convert_int_sat_int",
2182         "test_convert_int_sat_rte_int",
2183         "test_convert_int_sat_rtp_int",
2184         "test_convert_int_sat_rtn_int",
2185         "test_convert_int_sat_rtz_int",
2186         "test_implicit_int_float",
2187         "test_convert_int_float",
2188         "test_convert_int_rte_float",
2189         "test_convert_int_rtp_float",
2190         "test_convert_int_rtn_float",
2191         "test_convert_int_rtz_float",
2192         "test_convert_int_sat_float",
2193         "test_convert_int_sat_rte_float",
2194         "test_convert_int_sat_rtp_float",
2195         "test_convert_int_sat_rtn_float",
2196         "test_convert_int_sat_rtz_float",
2197         "test_implicit_int_ulong",
2198         "test_convert_int_ulong",
2199         "test_convert_int_rte_ulong",
2200         "test_convert_int_rtp_ulong",
2201         "test_convert_int_rtn_ulong",
2202         "test_convert_int_rtz_ulong",
2203         "test_convert_int_sat_ulong",
2204         "test_convert_int_sat_rte_ulong",
2205         "test_convert_int_sat_rtp_ulong",
2206         "test_convert_int_sat_rtn_ulong",
2207         "test_convert_int_sat_rtz_ulong",
2208         "test_implicit_int_long",
2209         "test_convert_int_long",
2210         "test_convert_int_rte_long",
2211         "test_convert_int_rtp_long",
2212         "test_convert_int_rtn_long",
2213         "test_convert_int_rtz_long",
2214         "test_convert_int_sat_long",
2215         "test_convert_int_sat_rte_long",
2216         "test_convert_int_sat_rtp_long",
2217         "test_convert_int_sat_rtn_long",
2218         "test_convert_int_sat_rtz_long",
2219         "test_implicit_float_uchar",
2220         "test_convert_float_uchar",
2221         "test_convert_float_rte_uchar",
2222         "test_convert_float_rtp_uchar",
2223         "test_convert_float_rtn_uchar",
2224         "test_convert_float_rtz_uchar",
2225         "test_implicit_float_char",
2226         "test_convert_float_char",
2227         "test_convert_float_rte_char",
2228         "test_convert_float_rtp_char",
2229         "test_convert_float_rtn_char",
2230         "test_convert_float_rtz_char",
2231         "test_implicit_float_ushort",
2232         "test_convert_float_ushort",
2233         "test_convert_float_rte_ushort",
2234         "test_convert_float_rtp_ushort",
2235         "test_convert_float_rtn_ushort",
2236         "test_convert_float_rtz_ushort",
2237         "test_implicit_float_short",
2238         "test_convert_float_short",
2239         "test_convert_float_rte_short",
2240         "test_convert_float_rtp_short",
2241         "test_convert_float_rtn_short",
2242         "test_convert_float_rtz_short",
2243         "test_implicit_float_uint",
2244         "test_convert_float_uint",
2245         "test_convert_float_rte_uint",
2246         "test_convert_float_rtp_uint",
2247         "test_convert_float_rtn_uint",
2248         "test_convert_float_rtz_uint",
2249         "test_implicit_float_int",
2250         "test_convert_float_int",
2251         "test_convert_float_rte_int",
2252         "test_convert_float_rtp_int",
2253         "test_convert_float_rtn_int",
2254         "test_convert_float_rtz_int",
2255         "test_implicit_float_float",
2256         "test_convert_float_float",
2257         "test_convert_float_rte_float",
2258         "test_convert_float_rtp_float",
2259         "test_convert_float_rtn_float",
2260         "test_convert_float_rtz_float",
2261         "test_implicit_float_ulong",
2262         "test_convert_float_ulong",
2263         "test_convert_float_rte_ulong",
2264         "test_convert_float_rtp_ulong",
2265         "test_convert_float_rtn_ulong",
2266         "test_convert_float_rtz_ulong",
2267         "test_implicit_float_long",
2268         "test_convert_float_long",
2269         "test_convert_float_rte_long",
2270         "test_convert_float_rtp_long",
2271         "test_convert_float_rtn_long",
2272         "test_convert_float_rtz_long",
2273         "test_implicit_ulong_uchar",
2274         "test_convert_ulong_uchar",
2275         "test_convert_ulong_rte_uchar",
2276         "test_convert_ulong_rtp_uchar",
2277         "test_convert_ulong_rtn_uchar",
2278         "test_convert_ulong_rtz_uchar",
2279         "test_convert_ulong_sat_uchar",
2280         "test_convert_ulong_sat_rte_uchar",
2281         "test_convert_ulong_sat_rtp_uchar",
2282         "test_convert_ulong_sat_rtn_uchar",
2283         "test_convert_ulong_sat_rtz_uchar",
2284         "test_implicit_ulong_char",
2285         "test_convert_ulong_char",
2286         "test_convert_ulong_rte_char",
2287         "test_convert_ulong_rtp_char",
2288         "test_convert_ulong_rtn_char",
2289         "test_convert_ulong_rtz_char",
2290         "test_convert_ulong_sat_char",
2291         "test_convert_ulong_sat_rte_char",
2292         "test_convert_ulong_sat_rtp_char",
2293         "test_convert_ulong_sat_rtn_char",
2294         "test_convert_ulong_sat_rtz_char",
2295         "test_implicit_ulong_ushort",
2296         "test_convert_ulong_ushort",
2297         "test_convert_ulong_rte_ushort",
2298         "test_convert_ulong_rtp_ushort",
2299         "test_convert_ulong_rtn_ushort",
2300         "test_convert_ulong_rtz_ushort",
2301         "test_convert_ulong_sat_ushort",
2302         "test_convert_ulong_sat_rte_ushort",
2303         "test_convert_ulong_sat_rtp_ushort",
2304         "test_convert_ulong_sat_rtn_ushort",
2305         "test_convert_ulong_sat_rtz_ushort",
2306         "test_implicit_ulong_short",
2307         "test_convert_ulong_short",
2308         "test_convert_ulong_rte_short",
2309         "test_convert_ulong_rtp_short",
2310         "test_convert_ulong_rtn_short",
2311         "test_convert_ulong_rtz_short",
2312         "test_convert_ulong_sat_short",
2313         "test_convert_ulong_sat_rte_short",
2314         "test_convert_ulong_sat_rtp_short",
2315         "test_convert_ulong_sat_rtn_short",
2316         "test_convert_ulong_sat_rtz_short",
2317         "test_implicit_ulong_uint",
2318         "test_convert_ulong_uint",
2319         "test_convert_ulong_rte_uint",
2320         "test_convert_ulong_rtp_uint",
2321         "test_convert_ulong_rtn_uint",
2322         "test_convert_ulong_rtz_uint",
2323         "test_convert_ulong_sat_uint",
2324         "test_convert_ulong_sat_rte_uint",
2325         "test_convert_ulong_sat_rtp_uint",
2326         "test_convert_ulong_sat_rtn_uint",
2327         "test_convert_ulong_sat_rtz_uint",
2328         "test_implicit_ulong_int",
2329         "test_convert_ulong_int",
2330         "test_convert_ulong_rte_int",
2331         "test_convert_ulong_rtp_int",
2332         "test_convert_ulong_rtn_int",
2333         "test_convert_ulong_rtz_int",
2334         "test_convert_ulong_sat_int",
2335         "test_convert_ulong_sat_rte_int",
2336         "test_convert_ulong_sat_rtp_int",
2337         "test_convert_ulong_sat_rtn_int",
2338         "test_convert_ulong_sat_rtz_int",
2339         "test_implicit_ulong_float",
2340         "test_convert_ulong_float",
2341         "test_convert_ulong_rte_float",
2342         "test_convert_ulong_rtp_float",
2343         "test_convert_ulong_rtn_float",
2344         "test_convert_ulong_rtz_float",
2345         "test_convert_ulong_sat_float",
2346         "test_convert_ulong_sat_rte_float",
2347         "test_convert_ulong_sat_rtp_float",
2348         "test_convert_ulong_sat_rtn_float",
2349         "test_convert_ulong_sat_rtz_float",
2350         "test_implicit_ulong_ulong",
2351         "test_convert_ulong_ulong",
2352         "test_convert_ulong_rte_ulong",
2353         "test_convert_ulong_rtp_ulong",
2354         "test_convert_ulong_rtn_ulong",
2355         "test_convert_ulong_rtz_ulong",
2356         "test_convert_ulong_sat_ulong",
2357         "test_convert_ulong_sat_rte_ulong",
2358         "test_convert_ulong_sat_rtp_ulong",
2359         "test_convert_ulong_sat_rtn_ulong",
2360         "test_convert_ulong_sat_rtz_ulong",
2361         "test_implicit_ulong_long",
2362         "test_convert_ulong_long",
2363         "test_convert_ulong_rte_long",
2364         "test_convert_ulong_rtp_long",
2365         "test_convert_ulong_rtn_long",
2366         "test_convert_ulong_rtz_long",
2367         "test_convert_ulong_sat_long",
2368         "test_convert_ulong_sat_rte_long",
2369         "test_convert_ulong_sat_rtp_long",
2370         "test_convert_ulong_sat_rtn_long",
2371         "test_convert_ulong_sat_rtz_long",
2372         "test_implicit_long_uchar",
2373         "test_convert_long_uchar",
2374         "test_convert_long_rte_uchar",
2375         "test_convert_long_rtp_uchar",
2376         "test_convert_long_rtn_uchar",
2377         "test_convert_long_rtz_uchar",
2378         "test_convert_long_sat_uchar",
2379         "test_convert_long_sat_rte_uchar",
2380         "test_convert_long_sat_rtp_uchar",
2381         "test_convert_long_sat_rtn_uchar",
2382         "test_convert_long_sat_rtz_uchar",
2383         "test_implicit_long_char",
2384         "test_convert_long_char",
2385         "test_convert_long_rte_char",
2386         "test_convert_long_rtp_char",
2387         "test_convert_long_rtn_char",
2388         "test_convert_long_rtz_char",
2389         "test_convert_long_sat_char",
2390         "test_convert_long_sat_rte_char",
2391         "test_convert_long_sat_rtp_char",
2392         "test_convert_long_sat_rtn_char",
2393         "test_convert_long_sat_rtz_char",
2394         "test_implicit_long_ushort",
2395         "test_convert_long_ushort",
2396         "test_convert_long_rte_ushort",
2397         "test_convert_long_rtp_ushort",
2398         "test_convert_long_rtn_ushort",
2399         "test_convert_long_rtz_ushort",
2400         "test_convert_long_sat_ushort",
2401         "test_convert_long_sat_rte_ushort",
2402         "test_convert_long_sat_rtp_ushort",
2403         "test_convert_long_sat_rtn_ushort",
2404         "test_convert_long_sat_rtz_ushort",
2405         "test_implicit_long_short",
2406         "test_convert_long_short",
2407         "test_convert_long_rte_short",
2408         "test_convert_long_rtp_short",
2409         "test_convert_long_rtn_short",
2410         "test_convert_long_rtz_short",
2411         "test_convert_long_sat_short",
2412         "test_convert_long_sat_rte_short",
2413         "test_convert_long_sat_rtp_short",
2414         "test_convert_long_sat_rtn_short",
2415         "test_convert_long_sat_rtz_short",
2416         "test_implicit_long_uint",
2417         "test_convert_long_uint",
2418         "test_convert_long_rte_uint",
2419         "test_convert_long_rtp_uint",
2420         "test_convert_long_rtn_uint",
2421         "test_convert_long_rtz_uint",
2422         "test_convert_long_sat_uint",
2423         "test_convert_long_sat_rte_uint",
2424         "test_convert_long_sat_rtp_uint",
2425         "test_convert_long_sat_rtn_uint",
2426         "test_convert_long_sat_rtz_uint",
2427         "test_implicit_long_int",
2428         "test_convert_long_int",
2429         "test_convert_long_rte_int",
2430         "test_convert_long_rtp_int",
2431         "test_convert_long_rtn_int",
2432         "test_convert_long_rtz_int",
2433         "test_convert_long_sat_int",
2434         "test_convert_long_sat_rte_int",
2435         "test_convert_long_sat_rtp_int",
2436         "test_convert_long_sat_rtn_int",
2437         "test_convert_long_sat_rtz_int",
2438         "test_implicit_long_float",
2439         "test_convert_long_float",
2440         "test_convert_long_rte_float",
2441         "test_convert_long_rtp_float",
2442         "test_convert_long_rtn_float",
2443         "test_convert_long_rtz_float",
2444         "test_convert_long_sat_float",
2445         "test_convert_long_sat_rte_float",
2446         "test_convert_long_sat_rtp_float",
2447         "test_convert_long_sat_rtn_float",
2448         "test_convert_long_sat_rtz_float",
2449         "test_implicit_long_ulong",
2450         "test_convert_long_ulong",
2451         "test_convert_long_rte_ulong",
2452         "test_convert_long_rtp_ulong",
2453         "test_convert_long_rtn_ulong",
2454         "test_convert_long_rtz_ulong",
2455         "test_convert_long_sat_ulong",
2456         "test_convert_long_sat_rte_ulong",
2457         "test_convert_long_sat_rtp_ulong",
2458         "test_convert_long_sat_rtn_ulong",
2459         "test_convert_long_sat_rtz_ulong",
2460         "test_implicit_long_long",
2461         "test_convert_long_long",
2462         "test_convert_long_rte_long",
2463         "test_convert_long_rtp_long",
2464         "test_convert_long_rtn_long",
2465         "test_convert_long_rtz_long",
2466         "test_convert_long_sat_long",
2467         "test_convert_long_sat_rte_long",
2468         "test_convert_long_sat_rtp_long",
2469         "test_convert_long_sat_rtn_long",
2470         "test_convert_long_sat_rtz_long",
2471         "long_convert2_type_roundingmode_type_f",
2472         "long_convert3_type_roundingmode_type_f",
2473         "long_convert4_type_roundingmode_type_f",
2474         "long_convert8_type_roundingmode_type_f",
2475         "long_convert16_type_roundingmode_type_f",
2476     };
2477 
2478     log_info("test_conversions\n");
2479     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
2480 }
2481 
2482 
test_conversions_double(cl_device_id device,cl_uint size_t_width,const char * folder)2483 bool test_conversions_double (cl_device_id device, cl_uint size_t_width, const char *folder)
2484 {
2485     static const char* test_name[] = {
2486         "convert2_type_roundingmode_type_d",
2487         "convert3_type_roundingmode_type_d",
2488         "convert4_type_roundingmode_type_d",
2489         "convert8_type_roundingmode_type_d",
2490         "convert16_type_roundingmode_type_d",
2491         "test_implicit_uchar_double",
2492         "test_convert_uchar_double",
2493         "test_convert_uchar_rte_double",
2494         "test_convert_uchar_rtp_double",
2495         "test_convert_uchar_rtn_double",
2496         "test_convert_uchar_rtz_double",
2497         "test_convert_uchar_sat_double",
2498         "test_convert_uchar_sat_rte_double",
2499         "test_convert_uchar_sat_rtp_double",
2500         "test_convert_uchar_sat_rtn_double",
2501         "test_convert_uchar_sat_rtz_double",
2502         "test_implicit_char_double",
2503         "test_convert_char_double",
2504         "test_convert_char_rte_double",
2505         "test_convert_char_rtp_double",
2506         "test_convert_char_rtn_double",
2507         "test_convert_char_rtz_double",
2508         "test_convert_char_sat_double",
2509         "test_convert_char_sat_rte_double",
2510         "test_convert_char_sat_rtp_double",
2511         "test_convert_char_sat_rtn_double",
2512         "test_convert_char_sat_rtz_double",
2513         "test_implicit_ushort_double",
2514         "test_convert_ushort_double",
2515         "test_convert_ushort_rte_double",
2516         "test_convert_ushort_rtp_double",
2517         "test_convert_ushort_rtn_double",
2518         "test_convert_ushort_rtz_double",
2519         "test_convert_ushort_sat_double",
2520         "test_convert_ushort_sat_rte_double",
2521         "test_convert_ushort_sat_rtp_double",
2522         "test_convert_ushort_sat_rtn_double",
2523         "test_convert_ushort_sat_rtz_double",
2524         "test_implicit_short_double",
2525         "test_convert_short_double",
2526         "test_convert_short_rte_double",
2527         "test_convert_short_rtp_double",
2528         "test_convert_short_rtn_double",
2529         "test_convert_short_rtz_double",
2530         "test_convert_short_sat_double",
2531         "test_convert_short_sat_rte_double",
2532         "test_convert_short_sat_rtp_double",
2533         "test_convert_short_sat_rtn_double",
2534         "test_convert_short_sat_rtz_double",
2535         "test_implicit_uint_double",
2536         "test_convert_uint_double",
2537         "test_convert_uint_rte_double",
2538         "test_convert_uint_rtp_double",
2539         "test_convert_uint_rtn_double",
2540         "test_convert_uint_rtz_double",
2541         "test_convert_uint_sat_double",
2542         "test_convert_uint_sat_rte_double",
2543         "test_convert_uint_sat_rtp_double",
2544         "test_convert_uint_sat_rtn_double",
2545         "test_convert_uint_sat_rtz_double",
2546         "test_implicit_int_double",
2547         "test_convert_int_double",
2548         "test_convert_int_rte_double",
2549         "test_convert_int_rtp_double",
2550         "test_convert_int_rtn_double",
2551         "test_convert_int_rtz_double",
2552         "test_convert_int_sat_double",
2553         "test_convert_int_sat_rte_double",
2554         "test_convert_int_sat_rtp_double",
2555         "test_convert_int_sat_rtn_double",
2556         "test_convert_int_sat_rtz_double",
2557         "test_implicit_float_double",
2558         "test_convert_float_double",
2559         "test_convert_float_rte_double",
2560         "test_convert_float_rtp_double",
2561         "test_convert_float_rtn_double",
2562         "test_convert_float_rtz_double",
2563         "test_implicit_double_uchar",
2564         "test_convert_double_uchar",
2565         "test_convert_double_rte_uchar",
2566         "test_convert_double_rtp_uchar",
2567         "test_convert_double_rtn_uchar",
2568         "test_convert_double_rtz_uchar",
2569         "test_implicit_double_char",
2570         "test_convert_double_char",
2571         "test_convert_double_rte_char",
2572         "test_convert_double_rtp_char",
2573         "test_convert_double_rtn_char",
2574         "test_convert_double_rtz_char",
2575         "test_implicit_double_ushort",
2576         "test_convert_double_ushort",
2577         "test_convert_double_rte_ushort",
2578         "test_convert_double_rtp_ushort",
2579         "test_convert_double_rtn_ushort",
2580         "test_convert_double_rtz_ushort",
2581         "test_implicit_double_short",
2582         "test_convert_double_short",
2583         "test_convert_double_rte_short",
2584         "test_convert_double_rtp_short",
2585         "test_convert_double_rtn_short",
2586         "test_convert_double_rtz_short",
2587         "test_implicit_double_uint",
2588         "test_convert_double_uint",
2589         "test_convert_double_rte_uint",
2590         "test_convert_double_rtp_uint",
2591         "test_convert_double_rtn_uint",
2592         "test_convert_double_rtz_uint",
2593         "test_implicit_double_int",
2594         "test_convert_double_int",
2595         "test_convert_double_rte_int",
2596         "test_convert_double_rtp_int",
2597         "test_convert_double_rtn_int",
2598         "test_convert_double_rtz_int",
2599         "test_implicit_double_float",
2600         "test_convert_double_float",
2601         "test_convert_double_rte_float",
2602         "test_convert_double_rtp_float",
2603         "test_convert_double_rtn_float",
2604         "test_convert_double_rtz_float",
2605         "test_implicit_double_double",
2606         "test_convert_double_double",
2607         "test_convert_double_rte_double",
2608         "test_convert_double_rtp_double",
2609         "test_convert_double_rtn_double",
2610         "test_convert_double_rtz_double",
2611         "test_implicit_double_ulong",
2612         "test_convert_double_ulong",
2613         "test_convert_double_rte_ulong",
2614         "test_convert_double_rtp_ulong",
2615         "test_convert_double_rtn_ulong",
2616         "test_convert_double_rtz_ulong",
2617         "test_implicit_double_long",
2618         "test_convert_double_long",
2619         "test_convert_double_rte_long",
2620         "test_convert_double_rtp_long",
2621         "test_convert_double_rtn_long",
2622         "test_convert_double_rtz_long",
2623         "test_implicit_ulong_double",
2624         "test_convert_ulong_double",
2625         "test_convert_ulong_rte_double",
2626         "test_convert_ulong_rtp_double",
2627         "test_convert_ulong_rtn_double",
2628         "test_convert_ulong_rtz_double",
2629         "test_convert_ulong_sat_double",
2630         "test_convert_ulong_sat_rte_double",
2631         "test_convert_ulong_sat_rtp_double",
2632         "test_convert_ulong_sat_rtn_double",
2633         "test_convert_ulong_sat_rtz_double",
2634         "test_implicit_long_double",
2635         "test_convert_long_double",
2636         "test_convert_long_rte_double",
2637         "test_convert_long_rtp_double",
2638         "test_convert_long_rtn_double",
2639         "test_convert_long_rtz_double",
2640         "test_convert_long_sat_double",
2641         "test_convert_long_sat_rte_double",
2642         "test_convert_long_sat_rtp_double",
2643         "test_convert_long_sat_rtn_double",
2644         "test_convert_long_sat_rtz_double",
2645     };
2646 
2647     log_info("test_conversions_double\n");
2648     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
2649 }
2650 
2651 
test_geometrics(cl_device_id device,cl_uint size_t_width,const char * folder)2652 bool test_geometrics (cl_device_id device, cl_uint size_t_width, const char *folder)
2653 {
2654     static const char* test_name[] = {
2655         "sample_test.geom_cross_float3",
2656         "sample_test.geom_cross_float4",
2657         "sample_test.geom_dot_float",
2658         "sample_test.geom_dot_float2",
2659         "sample_test.geom_dot_float3",
2660         "sample_test.geom_dot_float4",
2661         "sample_test.geom_distance_float",
2662         "sample_test.geom_distance_float2",
2663         "sample_test.geom_distance_float3",
2664         "sample_test.geom_distance_float4",
2665         "sample_test.geom_fast_distance_float",
2666         "sample_test.geom_fast_distance_float2",
2667         "sample_test.geom_fast_distance_float3",
2668         "sample_test.geom_fast_distance_float4",
2669         "sample_test.geom_length_float",
2670         "sample_test.geom_length_float2",
2671         "sample_test.geom_length_float3",
2672         "sample_test.geom_length_float4",
2673         "sample_test.geom_fast_length_float",
2674         "sample_test.geom_fast_length_float2",
2675         "sample_test.geom_fast_length_float3",
2676         "sample_test.geom_fast_length_float4",
2677         "sample_test.geom_normalize_float",
2678         "sample_test.geom_normalize_float2",
2679         "sample_test.geom_normalize_float3",
2680         "sample_test.geom_normalize_float4",
2681         "sample_test.geom_fast_normalize_float",
2682         "sample_test.geom_fast_normalize_float2",
2683         "sample_test.geom_fast_normalize_float3",
2684         "sample_test.geom_fast_normalize_float4",
2685     };
2686 
2687     log_info("test_geometrics\n");
2688     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
2689 }
2690 
2691 
test_geometrics_double(cl_device_id device,cl_uint size_t_width,const char * folder)2692 bool test_geometrics_double (cl_device_id device, cl_uint size_t_width, const char *folder)
2693 {
2694     static const char* test_name[] = {
2695         "sample_test.geom_cross_double3",
2696         "sample_test.geom_cross_double4",
2697         "sample_test.geom_dot_double",
2698         "sample_test.geom_dot_double2",
2699         "sample_test.geom_dot_double3",
2700         "sample_test.geom_dot_double4",
2701         "sample_test.geom_distance_double",
2702         "sample_test.geom_distance_double2",
2703         "sample_test.geom_distance_double3",
2704         "sample_test.geom_distance_double4",
2705         "sample_test.geom_length_double",
2706         "sample_test.geom_length_double2",
2707         "sample_test.geom_length_double3",
2708         "sample_test.geom_length_double4",
2709         "sample_test.geom_normalize_double",
2710         "sample_test.geom_normalize_double2",
2711         "sample_test.geom_normalize_double3",
2712         "sample_test.geom_normalize_double4",
2713     };
2714 
2715     log_info("test_geometrics_double\n");
2716     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
2717 }
2718 
2719 
test_half(cl_device_id device,cl_uint size_t_width,const char * folder)2720 bool test_half (cl_device_id device, cl_uint size_t_width, const char *folder)
2721 {
2722     static const char* test_name[] = {
2723         "test.vload_half_global",
2724         "test.vload_half_private",
2725         "test.vload_half_local",
2726         "test.vload_half_constant",
2727         "test.vload_half2_global",
2728         "test.vload_half2_private",
2729         "test.vload_half2_local",
2730         "test.vload_half2_constant",
2731         "test.vload_half4_global",
2732         "test.vload_half4_private",
2733         "test.vload_half4_local",
2734         "test.vload_half4_constant",
2735         "test.vload_half8_global",
2736         "test.vload_half8_private",
2737         "test.vload_half8_local",
2738         "test.vload_half8_constant",
2739         "test.vload_half16_global",
2740         "test.vload_half16_private",
2741         "test.vload_half16_local",
2742         "test.vload_half16_constant",
2743         "test.vload_half3_global",
2744         "test.vload_half3_private",
2745         "test.vload_half3_local",
2746         "test.vload_half3_constant",
2747         "test.vloada_half_global",
2748         "test.vloada_half_private",
2749         "test.vloada_half_local",
2750         "test.vloada_half_constant",
2751         "test.vloada_half2_global",
2752         "test.vloada_half2_private",
2753         "test.vloada_half2_local",
2754         "test.vloada_half2_constant",
2755         "test.vloada_half4_global",
2756         "test.vloada_half4_private",
2757         "test.vloada_half4_local",
2758         "test.vloada_half4_constant",
2759         "test.vloada_half8_global",
2760         "test.vloada_half8_private",
2761         "test.vloada_half8_local",
2762         "test.vloada_half8_constant",
2763         "test.vloada_half16_global",
2764         "test.vloada_half16_private",
2765         "test.vloada_half16_local",
2766         "test.vloada_half16_constant",
2767         "test.vloada_half3_global",
2768         "test.vloada_half3_private",
2769         "test.vloada_half3_local",
2770         "test.vloada_half3_constant",
2771         "test.vstore_half_global_float",
2772         "test.vstore_half_private_float",
2773         "test.vstore_half_local_float",
2774         "test.vstore_half_global_float2",
2775         "test.vstore_half_private_float2",
2776         "test.vstore_half_local_float2",
2777         "test.vstore_half_global_float4",
2778         "test.vstore_half_private_float4",
2779         "test.vstore_half_local_float4",
2780         "test.vstore_half_global_float8",
2781         "test.vstore_half_private_float8",
2782         "test.vstore_half_local_float8",
2783         "test.vstore_half_global_float16",
2784         "test.vstore_half_private_float16",
2785         "test.vstore_half_local_float16",
2786         "test.vstore_half_global_float3",
2787         "test.vstore_half_private_float3",
2788         "test.vstore_half_local_float3",
2789         "test.vstorea_half_global_float2",
2790         "test.vstorea_half_private_float2",
2791         "test.vstorea_half_local_float2",
2792         "test.vstorea_half_global_float4",
2793         "test.vstorea_half_private_float4",
2794         "test.vstorea_half_local_float4",
2795         "test.vstorea_half_global_float8",
2796         "test.vstorea_half_private_float8",
2797         "test.vstorea_half_local_float8",
2798         "test.vstorea_half_global_float16",
2799         "test.vstorea_half_private_float16",
2800         "test.vstorea_half_local_float16",
2801         "test.vstorea_half_global_float3",
2802         "test.vstorea_half_private_float3",
2803         "test.vstorea_half_local_float3",
2804         "test.vstore_half_rte_global_float",
2805         "test.vstore_half_rte_private_float",
2806         "test.vstore_half_rte_local_float",
2807         "test.vstore_half_rte_global_float2",
2808         "test.vstore_half_rte_private_float2",
2809         "test.vstore_half_rte_local_float2",
2810         "test.vstore_half_rte_global_float4",
2811         "test.vstore_half_rte_private_float4",
2812         "test.vstore_half_rte_local_float4",
2813         "test.vstore_half_rte_global_float8",
2814         "test.vstore_half_rte_private_float8",
2815         "test.vstore_half_rte_local_float8",
2816         "test.vstore_half_rte_global_float16",
2817         "test.vstore_half_rte_private_float16",
2818         "test.vstore_half_rte_local_float16",
2819         "test.vstore_half_rte_global_float3",
2820         "test.vstore_half_rte_private_float3",
2821         "test.vstore_half_rte_local_float3",
2822         "test.vstorea_half_rte_global_float2",
2823         "test.vstorea_half_rte_private_float2",
2824         "test.vstorea_half_rte_local_float2",
2825         "test.vstorea_half_rte_global_float4",
2826         "test.vstorea_half_rte_private_float4",
2827         "test.vstorea_half_rte_local_float4",
2828         "test.vstorea_half_rte_global_float8",
2829         "test.vstorea_half_rte_private_float8",
2830         "test.vstorea_half_rte_local_float8",
2831         "test.vstorea_half_rte_global_float16",
2832         "test.vstorea_half_rte_private_float16",
2833         "test.vstorea_half_rte_local_float16",
2834         "test.vstorea_half_rte_global_float3",
2835         "test.vstorea_half_rte_private_float3",
2836         "test.vstorea_half_rte_local_float3",
2837         "test.vstore_half_rtz_global_float",
2838         "test.vstore_half_rtz_private_float",
2839         "test.vstore_half_rtz_local_float",
2840         "test.vstore_half_rtz_global_float2",
2841         "test.vstore_half_rtz_private_float2",
2842         "test.vstore_half_rtz_local_float2",
2843         "test.vstore_half_rtz_global_float4",
2844         "test.vstore_half_rtz_private_float4",
2845         "test.vstore_half_rtz_local_float4",
2846         "test.vstore_half_rtz_global_float8",
2847         "test.vstore_half_rtz_private_float8",
2848         "test.vstore_half_rtz_local_float8",
2849         "test.vstore_half_rtz_global_float16",
2850         "test.vstore_half_rtz_private_float16",
2851         "test.vstore_half_rtz_local_float16",
2852         "test.vstore_half_rtz_global_float3",
2853         "test.vstore_half_rtz_private_float3",
2854         "test.vstore_half_rtz_local_float3",
2855         "test.vstorea_half_rtz_global_float2",
2856         "test.vstorea_half_rtz_private_float2",
2857         "test.vstorea_half_rtz_local_float2",
2858         "test.vstorea_half_rtz_global_float4",
2859         "test.vstorea_half_rtz_private_float4",
2860         "test.vstorea_half_rtz_local_float4",
2861         "test.vstorea_half_rtz_global_float8",
2862         "test.vstorea_half_rtz_private_float8",
2863         "test.vstorea_half_rtz_local_float8",
2864         "test.vstorea_half_rtz_global_float16",
2865         "test.vstorea_half_rtz_private_float16",
2866         "test.vstorea_half_rtz_local_float16",
2867         "test.vstorea_half_rtz_global_float3",
2868         "test.vstorea_half_rtz_private_float3",
2869         "test.vstorea_half_rtz_local_float3",
2870         "test.vstore_half_rtp_global_float",
2871         "test.vstore_half_rtp_private_float",
2872         "test.vstore_half_rtp_local_float",
2873         "test.vstore_half_rtp_global_float2",
2874         "test.vstore_half_rtp_private_float2",
2875         "test.vstore_half_rtp_local_float2",
2876         "test.vstore_half_rtp_global_float4",
2877         "test.vstore_half_rtp_private_float4",
2878         "test.vstore_half_rtp_local_float4",
2879         "test.vstore_half_rtp_global_float8",
2880         "test.vstore_half_rtp_private_float8",
2881         "test.vstore_half_rtp_local_float8",
2882         "test.vstore_half_rtp_global_float16",
2883         "test.vstore_half_rtp_private_float16",
2884         "test.vstore_half_rtp_local_float16",
2885         "test.vstore_half_rtp_global_float3",
2886         "test.vstore_half_rtp_private_float3",
2887         "test.vstore_half_rtp_local_float3",
2888         "test.vstorea_half_rtp_global_float2",
2889         "test.vstorea_half_rtp_private_float2",
2890         "test.vstorea_half_rtp_local_float2",
2891         "test.vstorea_half_rtp_global_float4",
2892         "test.vstorea_half_rtp_private_float4",
2893         "test.vstorea_half_rtp_local_float4",
2894         "test.vstorea_half_rtp_global_float8",
2895         "test.vstorea_half_rtp_private_float8",
2896         "test.vstorea_half_rtp_local_float8",
2897         "test.vstorea_half_rtp_global_float16",
2898         "test.vstorea_half_rtp_private_float16",
2899         "test.vstorea_half_rtp_local_float16",
2900         "test.vstorea_half_rtp_global_float3",
2901         "test.vstorea_half_rtp_private_float3",
2902         "test.vstorea_half_rtp_local_float3",
2903         "test.vstore_half_rtn_global_float",
2904         "test.vstore_half_rtn_private_float",
2905         "test.vstore_half_rtn_local_float",
2906         "test.vstore_half_rtn_global_float2",
2907         "test.vstore_half_rtn_private_float2",
2908         "test.vstore_half_rtn_local_float2",
2909         "test.vstore_half_rtn_global_float4",
2910         "test.vstore_half_rtn_private_float4",
2911         "test.vstore_half_rtn_local_float4",
2912         "test.vstore_half_rtn_global_float8",
2913         "test.vstore_half_rtn_private_float8",
2914         "test.vstore_half_rtn_local_float8",
2915         "test.vstore_half_rtn_global_float16",
2916         "test.vstore_half_rtn_private_float16",
2917         "test.vstore_half_rtn_local_float16",
2918         "test.vstore_half_rtn_global_float3",
2919         "test.vstore_half_rtn_private_float3",
2920         "test.vstore_half_rtn_local_float3",
2921         "test.vstorea_half_rtn_global_float2",
2922         "test.vstorea_half_rtn_private_float2",
2923         "test.vstorea_half_rtn_local_float2",
2924         "test.vstorea_half_rtn_global_float4",
2925         "test.vstorea_half_rtn_private_float4",
2926         "test.vstorea_half_rtn_local_float4",
2927         "test.vstorea_half_rtn_global_float8",
2928         "test.vstorea_half_rtn_private_float8",
2929         "test.vstorea_half_rtn_local_float8",
2930         "test.vstorea_half_rtn_global_float16",
2931         "test.vstorea_half_rtn_private_float16",
2932         "test.vstorea_half_rtn_local_float16",
2933         "test.vstorea_half_rtn_global_float3",
2934         "test.vstorea_half_rtn_private_float3",
2935         "test.vstorea_half_rtn_local_float3",
2936     };
2937 
2938     log_info("test_half\n");
2939     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
2940 }
2941 
2942 
test_half_double(cl_device_id device,cl_uint size_t_width,const char * folder)2943 bool test_half_double (cl_device_id device, cl_uint size_t_width, const char *folder)
2944 {
2945     static const char* test_name[] = {
2946         "test.vstore_half_global_double",
2947         "test.vstore_half_private_double",
2948         "test.vstore_half_local_double",
2949         "test.vstore_half_global_double2",
2950         "test.vstore_half_private_double2",
2951         "test.vstore_half_local_double2",
2952         "test.vstore_half_global_double4",
2953         "test.vstore_half_private_double4",
2954         "test.vstore_half_local_double4",
2955         "test.vstore_half_global_double8",
2956         "test.vstore_half_private_double8",
2957         "test.vstore_half_local_double8",
2958         "test.vstore_half_global_double16",
2959         "test.vstore_half_private_double16",
2960         "test.vstore_half_local_double16",
2961         "test.vstore_half_global_double3",
2962         "test.vstore_half_private_double3",
2963         "test.vstore_half_local_double3",
2964         "test.vstorea_half_global_double2",
2965         "test.vstorea_half_private_double2",
2966         "test.vstorea_half_local_double2",
2967         "test.vstorea_half_global_double4",
2968         "test.vstorea_half_private_double4",
2969         "test.vstorea_half_local_double4",
2970         "test.vstorea_half_global_double8",
2971         "test.vstorea_half_private_double8",
2972         "test.vstorea_half_local_double8",
2973         "test.vstorea_half_global_double16",
2974         "test.vstorea_half_private_double16",
2975         "test.vstorea_half_local_double16",
2976         "test.vstorea_half_global_double3",
2977         "test.vstorea_half_private_double3",
2978         "test.vstorea_half_local_double3",
2979         "test.vstore_half_rte_global_double",
2980         "test.vstore_half_rte_private_double",
2981         "test.vstore_half_rte_local_double",
2982         "test.vstore_half_rte_global_double2",
2983         "test.vstore_half_rte_private_double2",
2984         "test.vstore_half_rte_local_double2",
2985         "test.vstore_half_rte_global_double4",
2986         "test.vstore_half_rte_private_double4",
2987         "test.vstore_half_rte_local_double4",
2988         "test.vstore_half_rte_global_double8",
2989         "test.vstore_half_rte_private_double8",
2990         "test.vstore_half_rte_local_double8",
2991         "test.vstore_half_rte_global_double16",
2992         "test.vstore_half_rte_private_double16",
2993         "test.vstore_half_rte_local_double16",
2994         "test.vstore_half_rte_global_double3",
2995         "test.vstore_half_rte_private_double3",
2996         "test.vstore_half_rte_local_double3",
2997         "test.vstorea_half_rte_global_double2",
2998         "test.vstorea_half_rte_private_double2",
2999         "test.vstorea_half_rte_local_double2",
3000         "test.vstorea_half_rte_global_double4",
3001         "test.vstorea_half_rte_private_double4",
3002         "test.vstorea_half_rte_local_double4",
3003         "test.vstorea_half_rte_global_double8",
3004         "test.vstorea_half_rte_private_double8",
3005         "test.vstorea_half_rte_local_double8",
3006         "test.vstorea_half_rte_global_double16",
3007         "test.vstorea_half_rte_private_double16",
3008         "test.vstorea_half_rte_local_double16",
3009         "test.vstorea_half_rte_global_double3",
3010         "test.vstorea_half_rte_private_double3",
3011         "test.vstorea_half_rte_local_double3",
3012         "test.vstore_half_rtz_global_double",
3013         "test.vstore_half_rtz_private_double",
3014         "test.vstore_half_rtz_local_double",
3015         "test.vstore_half_rtz_global_double2",
3016         "test.vstore_half_rtz_private_double2",
3017         "test.vstore_half_rtz_local_double2",
3018         "test.vstore_half_rtz_global_double4",
3019         "test.vstore_half_rtz_private_double4",
3020         "test.vstore_half_rtz_local_double4",
3021         "test.vstore_half_rtz_global_double8",
3022         "test.vstore_half_rtz_private_double8",
3023         "test.vstore_half_rtz_local_double8",
3024         "test.vstore_half_rtz_global_double16",
3025         "test.vstore_half_rtz_private_double16",
3026         "test.vstore_half_rtz_local_double16",
3027         "test.vstore_half_rtz_global_double3",
3028         "test.vstore_half_rtz_private_double3",
3029         "test.vstore_half_rtz_local_double3",
3030         "test.vstorea_half_rtz_global_double2",
3031         "test.vstorea_half_rtz_private_double2",
3032         "test.vstorea_half_rtz_local_double2",
3033         "test.vstorea_half_rtz_global_double4",
3034         "test.vstorea_half_rtz_private_double4",
3035         "test.vstorea_half_rtz_local_double4",
3036         "test.vstorea_half_rtz_global_double8",
3037         "test.vstorea_half_rtz_private_double8",
3038         "test.vstorea_half_rtz_local_double8",
3039         "test.vstorea_half_rtz_global_double16",
3040         "test.vstorea_half_rtz_private_double16",
3041         "test.vstorea_half_rtz_local_double16",
3042         "test.vstorea_half_rtz_global_double3",
3043         "test.vstorea_half_rtz_private_double3",
3044         "test.vstorea_half_rtz_local_double3",
3045         "test.vstore_half_rtp_global_double",
3046         "test.vstore_half_rtp_private_double",
3047         "test.vstore_half_rtp_local_double",
3048         "test.vstore_half_rtp_global_double2",
3049         "test.vstore_half_rtp_private_double2",
3050         "test.vstore_half_rtp_local_double2",
3051         "test.vstore_half_rtp_global_double4",
3052         "test.vstore_half_rtp_private_double4",
3053         "test.vstore_half_rtp_local_double4",
3054         "test.vstore_half_rtp_global_double8",
3055         "test.vstore_half_rtp_private_double8",
3056         "test.vstore_half_rtp_local_double8",
3057         "test.vstore_half_rtp_global_double16",
3058         "test.vstore_half_rtp_private_double16",
3059         "test.vstore_half_rtp_local_double16",
3060         "test.vstore_half_rtp_global_double3",
3061         "test.vstore_half_rtp_private_double3",
3062         "test.vstore_half_rtp_local_double3",
3063         "test.vstorea_half_rtp_global_double2",
3064         "test.vstorea_half_rtp_private_double2",
3065         "test.vstorea_half_rtp_local_double2",
3066         "test.vstorea_half_rtp_global_double4",
3067         "test.vstorea_half_rtp_private_double4",
3068         "test.vstorea_half_rtp_local_double4",
3069         "test.vstorea_half_rtp_global_double8",
3070         "test.vstorea_half_rtp_private_double8",
3071         "test.vstorea_half_rtp_local_double8",
3072         "test.vstorea_half_rtp_global_double16",
3073         "test.vstorea_half_rtp_private_double16",
3074         "test.vstorea_half_rtp_local_double16",
3075         "test.vstorea_half_rtp_global_double3",
3076         "test.vstorea_half_rtp_private_double3",
3077         "test.vstorea_half_rtp_local_double3",
3078         "test.vstore_half_rtn_global_double",
3079         "test.vstore_half_rtn_private_double",
3080         "test.vstore_half_rtn_local_double",
3081         "test.vstore_half_rtn_global_double2",
3082         "test.vstore_half_rtn_private_double2",
3083         "test.vstore_half_rtn_local_double2",
3084         "test.vstore_half_rtn_global_double4",
3085         "test.vstore_half_rtn_private_double4",
3086         "test.vstore_half_rtn_local_double4",
3087         "test.vstore_half_rtn_global_double8",
3088         "test.vstore_half_rtn_private_double8",
3089         "test.vstore_half_rtn_local_double8",
3090         "test.vstore_half_rtn_global_double16",
3091         "test.vstore_half_rtn_private_double16",
3092         "test.vstore_half_rtn_local_double16",
3093         "test.vstore_half_rtn_global_double3",
3094         "test.vstore_half_rtn_private_double3",
3095         "test.vstore_half_rtn_local_double3",
3096         "test.vstorea_half_rtn_global_double2",
3097         "test.vstorea_half_rtn_private_double2",
3098         "test.vstorea_half_rtn_local_double2",
3099         "test.vstorea_half_rtn_global_double4",
3100         "test.vstorea_half_rtn_private_double4",
3101         "test.vstorea_half_rtn_local_double4",
3102         "test.vstorea_half_rtn_global_double8",
3103         "test.vstorea_half_rtn_private_double8",
3104         "test.vstorea_half_rtn_local_double8",
3105         "test.vstorea_half_rtn_global_double16",
3106         "test.vstorea_half_rtn_private_double16",
3107         "test.vstorea_half_rtn_local_double16",
3108         "test.vstorea_half_rtn_global_double3",
3109         "test.vstorea_half_rtn_private_double3",
3110         "test.vstorea_half_rtn_local_double3",
3111     };
3112 
3113     log_info("test_half_double\n");
3114     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
3115 }
3116 
3117 
test_kernel_image_methods(cl_device_id device,cl_uint size_t_width,const char * folder)3118 bool test_kernel_image_methods (cl_device_id device, cl_uint size_t_width, const char *folder)
3119 {
3120     static const char* test_name[] = {
3121         "sample_kernel.get_image_info_1D",
3122         "sample_kernel.get_image_info_2D",
3123         "sample_kernel.get_image_info_3D",
3124         "sample_kernel.get_image_info_1D_array",
3125         "sample_kernel.get_image_info_2D_array",
3126     };
3127 
3128     log_info("test_kernel_image_methods\n");
3129     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
3130 }
3131 
3132 
test_images_kernel_read_write(cl_device_id device,cl_uint size_t_width,const char * folder)3133 bool test_images_kernel_read_write (cl_device_id device, cl_uint size_t_width, const char *folder)
3134 {
3135     static const char* test_name[] = {
3136         "sample_kernel.read_image_set_1D_fint",
3137         "sample_kernel.read_image_set_1D_ffloat",
3138         "sample_kernel.read_image_set_1D_iint",
3139         "sample_kernel.read_image_set_1D_ifloat",
3140         "sample_kernel.read_image_set_1D_uiint",
3141         "sample_kernel.read_image_set_1D_uifloat",
3142         "sample_kernel.write_image_1D_set_float",
3143         "sample_kernel.write_image_1D_set_int",
3144         "sample_kernel.write_image_1D_set_uint",
3145         "sample_kernel.read_image_set_2D_fint",
3146         "sample_kernel.read_image_set_2D_ffloat",
3147         "sample_kernel.read_image_set_2D_iint",
3148         "sample_kernel.read_image_set_2D_ifloat",
3149         "sample_kernel.read_image_set_2D_uiint",
3150         "sample_kernel.read_image_set_2D_uifloat",
3151         "sample_kernel.write_image_2D_set_float",
3152         "sample_kernel.write_image_2D_set_int",
3153         "sample_kernel.write_image_2D_set_uint",
3154         "sample_kernel.read_image_set_3D_fint",
3155         "sample_kernel.read_image_set_3D_ffloat",
3156         "sample_kernel.read_image_set_3D_iint",
3157         "sample_kernel.read_image_set_3D_ifloat",
3158         "sample_kernel.read_image_set_3D_uiint",
3159         "sample_kernel.read_image_set_3D_uifloat",
3160         "sample_kernel.read_image_set_1D_array_fint",
3161         "sample_kernel.read_image_set_1D_array_ffloat",
3162         "sample_kernel.read_image_set_1D_array_iint",
3163         "sample_kernel.read_image_set_1D_array_ifloat",
3164         "sample_kernel.read_image_set_1D_array_uiint",
3165         "sample_kernel.read_image_set_1D_array_uifloat",
3166         "sample_kernel.write_image_1D_array_set_float",
3167         "sample_kernel.write_image_1D_array_set_int",
3168         "sample_kernel.write_image_1D_array_set_uint",
3169         "sample_kernel.read_image_set_2D_array_fint",
3170         "sample_kernel.read_image_set_2D_array_ffloat",
3171         "sample_kernel.read_image_set_2D_array_iint",
3172         "sample_kernel.read_image_set_2D_array_ifloat",
3173         "sample_kernel.read_image_set_2D_array_uiint",
3174         "sample_kernel.read_image_set_2D_array_uifloat",
3175         "sample_kernel.write_image_2D_array_set_float",
3176         "sample_kernel.write_image_2D_array_set_int",
3177         "sample_kernel.write_image_2D_array_set_uint",
3178     };
3179 
3180     log_info("test_images_kernel_read_write\n");
3181     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
3182 }
3183 
3184 
test_images_samplerless_read(cl_device_id device,cl_uint size_t_width,const char * folder)3185 bool test_images_samplerless_read (cl_device_id device, cl_uint size_t_width, const char *folder)
3186 {
3187     static const char* test_name[] = {
3188         "sample_kernel.read_image_set_1D_float",
3189         "sample_kernel.read_image_set_1D_int",
3190         "sample_kernel.read_image_set_1D_uint",
3191         "sample_kernel.read_image_set_1D_buffer_float",
3192         "sample_kernel.read_image_set_1D_buffer_int",
3193         "sample_kernel.read_image_set_1D_buffer_uint",
3194         "sample_kernel.read_image_set_2D_float",
3195         "sample_kernel.read_image_set_2D_int",
3196         "sample_kernel.read_image_set_2D_uint",
3197         "sample_kernel.read_image_set_3D_float",
3198         "sample_kernel.read_image_set_3D_int",
3199         "sample_kernel.read_image_set_3D_uint",
3200         "sample_kernel.read_image_set_1D_array_float",
3201         "sample_kernel.read_image_set_1D_array_int",
3202         "sample_kernel.read_image_set_1D_array_uint",
3203         "sample_kernel.read_image_set_2D_array_float",
3204         "sample_kernel.read_image_set_2D_array_int",
3205         "sample_kernel.read_image_set_2D_array_uint",
3206     };
3207 
3208     log_info("test_images_samplerless_read\n");
3209     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
3210 }
3211 
3212 
test_integer_ops(cl_device_id device,cl_uint size_t_width,const char * folder)3213 bool test_integer_ops (cl_device_id device, cl_uint size_t_width, const char *folder)
3214 {
3215     static const char* test_name[] = {
3216         "sample_test.integer_clz_char",
3217         "sample_test.integer_clz_char2",
3218         "sample_test.integer_clz_char3",
3219         "sample_test.integer_clz_char4",
3220         "sample_test.integer_clz_char8",
3221         "sample_test.integer_clz_char16",
3222         "sample_test.integer_clz_uchar",
3223         "sample_test.integer_clz_uchar2",
3224         "sample_test.integer_clz_uchar3",
3225         "sample_test.integer_clz_uchar4",
3226         "sample_test.integer_clz_uchar8",
3227         "sample_test.integer_clz_uchar16",
3228         "sample_test.integer_clz_short",
3229         "sample_test.integer_clz_short2",
3230         "sample_test.integer_clz_short3",
3231         "sample_test.integer_clz_short4",
3232         "sample_test.integer_clz_short8",
3233         "sample_test.integer_clz_short16",
3234         "sample_test.integer_clz_ushort",
3235         "sample_test.integer_clz_ushort2",
3236         "sample_test.integer_clz_ushort3",
3237         "sample_test.integer_clz_ushort4",
3238         "sample_test.integer_clz_ushort8",
3239         "sample_test.integer_clz_ushort16",
3240         "sample_test.integer_clz_int",
3241         "sample_test.integer_clz_int2",
3242         "sample_test.integer_clz_int3",
3243         "sample_test.integer_clz_int4",
3244         "sample_test.integer_clz_int8",
3245         "sample_test.integer_clz_int16",
3246         "sample_test.integer_clz_uint",
3247         "sample_test.integer_clz_uint2",
3248         "sample_test.integer_clz_uint3",
3249         "sample_test.integer_clz_uint4",
3250         "sample_test.integer_clz_uint8",
3251         "sample_test.integer_clz_uint16",
3252         "sample_test.integer_clz_long",
3253         "sample_test.integer_clz_long2",
3254         "sample_test.integer_clz_long3",
3255         "sample_test.integer_clz_long4",
3256         "sample_test.integer_clz_long8",
3257         "sample_test.integer_clz_long16",
3258         "sample_test.integer_clz_ulong",
3259         "sample_test.integer_clz_ulong2",
3260         "sample_test.integer_clz_ulong3",
3261         "sample_test.integer_clz_ulong4",
3262         "sample_test.integer_clz_ulong8",
3263         "sample_test.integer_clz_ulong16",
3264         "sample_test.integer_hadd_char",
3265         "sample_test.integer_hadd_char2",
3266         "sample_test.integer_hadd_char3",
3267         "sample_test.integer_hadd_char4",
3268         "sample_test.integer_hadd_char8",
3269         "sample_test.integer_hadd_char16",
3270         "sample_test.integer_hadd_uchar",
3271         "sample_test.integer_hadd_uchar2",
3272         "sample_test.integer_hadd_uchar3",
3273         "sample_test.integer_hadd_uchar4",
3274         "sample_test.integer_hadd_uchar8",
3275         "sample_test.integer_hadd_uchar16",
3276         "sample_test.integer_hadd_short",
3277         "sample_test.integer_hadd_short2",
3278         "sample_test.integer_hadd_short3",
3279         "sample_test.integer_hadd_short4",
3280         "sample_test.integer_hadd_short8",
3281         "sample_test.integer_hadd_short16",
3282         "sample_test.integer_hadd_ushort",
3283         "sample_test.integer_hadd_ushort2",
3284         "sample_test.integer_hadd_ushort3",
3285         "sample_test.integer_hadd_ushort4",
3286         "sample_test.integer_hadd_ushort8",
3287         "sample_test.integer_hadd_ushort16",
3288         "sample_test.integer_hadd_int",
3289         "sample_test.integer_hadd_int2",
3290         "sample_test.integer_hadd_int3",
3291         "sample_test.integer_hadd_int4",
3292         "sample_test.integer_hadd_int8",
3293         "sample_test.integer_hadd_int16",
3294         "sample_test.integer_hadd_uint",
3295         "sample_test.integer_hadd_uint2",
3296         "sample_test.integer_hadd_uint3",
3297         "sample_test.integer_hadd_uint4",
3298         "sample_test.integer_hadd_uint8",
3299         "sample_test.integer_hadd_uint16",
3300         "sample_test.integer_hadd_long",
3301         "sample_test.integer_hadd_long2",
3302         "sample_test.integer_hadd_long3",
3303         "sample_test.integer_hadd_long4",
3304         "sample_test.integer_hadd_long8",
3305         "sample_test.integer_hadd_long16",
3306         "sample_test.integer_hadd_ulong",
3307         "sample_test.integer_hadd_ulong2",
3308         "sample_test.integer_hadd_ulong3",
3309         "sample_test.integer_hadd_ulong4",
3310         "sample_test.integer_hadd_ulong8",
3311         "sample_test.integer_hadd_ulong16",
3312         "sample_test.integer_rhadd_char",
3313         "sample_test.integer_rhadd_char2",
3314         "sample_test.integer_rhadd_char3",
3315         "sample_test.integer_rhadd_char4",
3316         "sample_test.integer_rhadd_char8",
3317         "sample_test.integer_rhadd_char16",
3318         "sample_test.integer_rhadd_uchar",
3319         "sample_test.integer_rhadd_uchar2",
3320         "sample_test.integer_rhadd_uchar3",
3321         "sample_test.integer_rhadd_uchar4",
3322         "sample_test.integer_rhadd_uchar8",
3323         "sample_test.integer_rhadd_uchar16",
3324         "sample_test.integer_rhadd_short",
3325         "sample_test.integer_rhadd_short2",
3326         "sample_test.integer_rhadd_short3",
3327         "sample_test.integer_rhadd_short4",
3328         "sample_test.integer_rhadd_short8",
3329         "sample_test.integer_rhadd_short16",
3330         "sample_test.integer_rhadd_ushort",
3331         "sample_test.integer_rhadd_ushort2",
3332         "sample_test.integer_rhadd_ushort3",
3333         "sample_test.integer_rhadd_ushort4",
3334         "sample_test.integer_rhadd_ushort8",
3335         "sample_test.integer_rhadd_ushort16",
3336         "sample_test.integer_rhadd_int",
3337         "sample_test.integer_rhadd_int2",
3338         "sample_test.integer_rhadd_int3",
3339         "sample_test.integer_rhadd_int4",
3340         "sample_test.integer_rhadd_int8",
3341         "sample_test.integer_rhadd_int16",
3342         "sample_test.integer_rhadd_uint",
3343         "sample_test.integer_rhadd_uint2",
3344         "sample_test.integer_rhadd_uint3",
3345         "sample_test.integer_rhadd_uint4",
3346         "sample_test.integer_rhadd_uint8",
3347         "sample_test.integer_rhadd_uint16",
3348         "sample_test.integer_rhadd_long",
3349         "sample_test.integer_rhadd_long2",
3350         "sample_test.integer_rhadd_long3",
3351         "sample_test.integer_rhadd_long4",
3352         "sample_test.integer_rhadd_long8",
3353         "sample_test.integer_rhadd_long16",
3354         "sample_test.integer_rhadd_ulong",
3355         "sample_test.integer_rhadd_ulong2",
3356         "sample_test.integer_rhadd_ulong3",
3357         "sample_test.integer_rhadd_ulong4",
3358         "sample_test.integer_rhadd_ulong8",
3359         "sample_test.integer_rhadd_ulong16",
3360         "sample_test.integer_mul_hi_char",
3361         "sample_test.integer_mul_hi_char2",
3362         "sample_test.integer_mul_hi_char3",
3363         "sample_test.integer_mul_hi_char4",
3364         "sample_test.integer_mul_hi_char8",
3365         "sample_test.integer_mul_hi_char16",
3366         "sample_test.integer_mul_hi_uchar",
3367         "sample_test.integer_mul_hi_uchar2",
3368         "sample_test.integer_mul_hi_uchar3",
3369         "sample_test.integer_mul_hi_uchar4",
3370         "sample_test.integer_mul_hi_uchar8",
3371         "sample_test.integer_mul_hi_uchar16",
3372         "sample_test.integer_mul_hi_short",
3373         "sample_test.integer_mul_hi_short2",
3374         "sample_test.integer_mul_hi_short3",
3375         "sample_test.integer_mul_hi_short4",
3376         "sample_test.integer_mul_hi_short8",
3377         "sample_test.integer_mul_hi_short16",
3378         "sample_test.integer_mul_hi_ushort",
3379         "sample_test.integer_mul_hi_ushort2",
3380         "sample_test.integer_mul_hi_ushort3",
3381         "sample_test.integer_mul_hi_ushort4",
3382         "sample_test.integer_mul_hi_ushort8",
3383         "sample_test.integer_mul_hi_ushort16",
3384         "sample_test.integer_mul_hi_int",
3385         "sample_test.integer_mul_hi_int2",
3386         "sample_test.integer_mul_hi_int3",
3387         "sample_test.integer_mul_hi_int4",
3388         "sample_test.integer_mul_hi_int8",
3389         "sample_test.integer_mul_hi_int16",
3390         "sample_test.integer_mul_hi_uint",
3391         "sample_test.integer_mul_hi_uint2",
3392         "sample_test.integer_mul_hi_uint3",
3393         "sample_test.integer_mul_hi_uint4",
3394         "sample_test.integer_mul_hi_uint8",
3395         "sample_test.integer_mul_hi_uint16",
3396         "sample_test.integer_mul_hi_long",
3397         "sample_test.integer_mul_hi_long2",
3398         "sample_test.integer_mul_hi_long3",
3399         "sample_test.integer_mul_hi_long4",
3400         "sample_test.integer_mul_hi_long8",
3401         "sample_test.integer_mul_hi_long16",
3402         "sample_test.integer_mul_hi_ulong",
3403         "sample_test.integer_mul_hi_ulong2",
3404         "sample_test.integer_mul_hi_ulong3",
3405         "sample_test.integer_mul_hi_ulong4",
3406         "sample_test.integer_mul_hi_ulong8",
3407         "sample_test.integer_mul_hi_ulong16",
3408         "sample_test.integer_rotate_char",
3409         "sample_test.integer_rotate_char2",
3410         "sample_test.integer_rotate_char3",
3411         "sample_test.integer_rotate_char4",
3412         "sample_test.integer_rotate_char8",
3413         "sample_test.integer_rotate_char16",
3414         "sample_test.integer_rotate_uchar",
3415         "sample_test.integer_rotate_uchar2",
3416         "sample_test.integer_rotate_uchar3",
3417         "sample_test.integer_rotate_uchar4",
3418         "sample_test.integer_rotate_uchar8",
3419         "sample_test.integer_rotate_uchar16",
3420         "sample_test.integer_rotate_short",
3421         "sample_test.integer_rotate_short2",
3422         "sample_test.integer_rotate_short3",
3423         "sample_test.integer_rotate_short4",
3424         "sample_test.integer_rotate_short8",
3425         "sample_test.integer_rotate_short16",
3426         "sample_test.integer_rotate_ushort",
3427         "sample_test.integer_rotate_ushort2",
3428         "sample_test.integer_rotate_ushort3",
3429         "sample_test.integer_rotate_ushort4",
3430         "sample_test.integer_rotate_ushort8",
3431         "sample_test.integer_rotate_ushort16",
3432         "sample_test.integer_rotate_int",
3433         "sample_test.integer_rotate_int2",
3434         "sample_test.integer_rotate_int3",
3435         "sample_test.integer_rotate_int4",
3436         "sample_test.integer_rotate_int8",
3437         "sample_test.integer_rotate_int16",
3438         "sample_test.integer_rotate_uint",
3439         "sample_test.integer_rotate_uint2",
3440         "sample_test.integer_rotate_uint3",
3441         "sample_test.integer_rotate_uint4",
3442         "sample_test.integer_rotate_uint8",
3443         "sample_test.integer_rotate_uint16",
3444         "sample_test.integer_rotate_long",
3445         "sample_test.integer_rotate_long2",
3446         "sample_test.integer_rotate_long3",
3447         "sample_test.integer_rotate_long4",
3448         "sample_test.integer_rotate_long8",
3449         "sample_test.integer_rotate_long16",
3450         "sample_test.integer_rotate_ulong",
3451         "sample_test.integer_rotate_ulong2",
3452         "sample_test.integer_rotate_ulong3",
3453         "sample_test.integer_rotate_ulong4",
3454         "sample_test.integer_rotate_ulong8",
3455         "sample_test.integer_rotate_ulong16",
3456         "sample_test.integer_clamp_char",
3457         "sample_test.integer_clamp_char2",
3458         "sample_test.integer_clamp_char3",
3459         "sample_test.integer_clamp_char4",
3460         "sample_test.integer_clamp_char8",
3461         "sample_test.integer_clamp_char16",
3462         "sample_test.integer_clamp_uchar",
3463         "sample_test.integer_clamp_uchar2",
3464         "sample_test.integer_clamp_uchar3",
3465         "sample_test.integer_clamp_uchar4",
3466         "sample_test.integer_clamp_uchar8",
3467         "sample_test.integer_clamp_uchar16",
3468         "sample_test.integer_clamp_short",
3469         "sample_test.integer_clamp_short2",
3470         "sample_test.integer_clamp_short3",
3471         "sample_test.integer_clamp_short4",
3472         "sample_test.integer_clamp_short8",
3473         "sample_test.integer_clamp_short16",
3474         "sample_test.integer_clamp_ushort",
3475         "sample_test.integer_clamp_ushort2",
3476         "sample_test.integer_clamp_ushort3",
3477         "sample_test.integer_clamp_ushort4",
3478         "sample_test.integer_clamp_ushort8",
3479         "sample_test.integer_clamp_ushort16",
3480         "sample_test.integer_clamp_int",
3481         "sample_test.integer_clamp_int2",
3482         "sample_test.integer_clamp_int3",
3483         "sample_test.integer_clamp_int4",
3484         "sample_test.integer_clamp_int8",
3485         "sample_test.integer_clamp_int16",
3486         "sample_test.integer_clamp_uint",
3487         "sample_test.integer_clamp_uint2",
3488         "sample_test.integer_clamp_uint3",
3489         "sample_test.integer_clamp_uint4",
3490         "sample_test.integer_clamp_uint8",
3491         "sample_test.integer_clamp_uint16",
3492         "sample_test.integer_clamp_long",
3493         "sample_test.integer_clamp_long2",
3494         "sample_test.integer_clamp_long3",
3495         "sample_test.integer_clamp_long4",
3496         "sample_test.integer_clamp_long8",
3497         "sample_test.integer_clamp_long16",
3498         "sample_test.integer_clamp_ulong",
3499         "sample_test.integer_clamp_ulong2",
3500         "sample_test.integer_clamp_ulong3",
3501         "sample_test.integer_clamp_ulong4",
3502         "sample_test.integer_clamp_ulong8",
3503         "sample_test.integer_clamp_ulong16",
3504         "sample_test.integer_mad_sat_char",
3505         "sample_test.integer_mad_sat_char2",
3506         "sample_test.integer_mad_sat_char3",
3507         "sample_test.integer_mad_sat_char4",
3508         "sample_test.integer_mad_sat_char8",
3509         "sample_test.integer_mad_sat_char16",
3510         "sample_test.integer_mad_sat_uchar",
3511         "sample_test.integer_mad_sat_uchar2",
3512         "sample_test.integer_mad_sat_uchar3",
3513         "sample_test.integer_mad_sat_uchar4",
3514         "sample_test.integer_mad_sat_uchar8",
3515         "sample_test.integer_mad_sat_uchar16",
3516         "sample_test.integer_mad_sat_short",
3517         "sample_test.integer_mad_sat_short2",
3518         "sample_test.integer_mad_sat_short3",
3519         "sample_test.integer_mad_sat_short4",
3520         "sample_test.integer_mad_sat_short8",
3521         "sample_test.integer_mad_sat_short16",
3522         "sample_test.integer_mad_sat_ushort",
3523         "sample_test.integer_mad_sat_ushort2",
3524         "sample_test.integer_mad_sat_ushort3",
3525         "sample_test.integer_mad_sat_ushort4",
3526         "sample_test.integer_mad_sat_ushort8",
3527         "sample_test.integer_mad_sat_ushort16",
3528         "sample_test.integer_mad_sat_int",
3529         "sample_test.integer_mad_sat_int2",
3530         "sample_test.integer_mad_sat_int3",
3531         "sample_test.integer_mad_sat_int4",
3532         "sample_test.integer_mad_sat_int8",
3533         "sample_test.integer_mad_sat_int16",
3534         "sample_test.integer_mad_sat_uint",
3535         "sample_test.integer_mad_sat_uint2",
3536         "sample_test.integer_mad_sat_uint3",
3537         "sample_test.integer_mad_sat_uint4",
3538         "sample_test.integer_mad_sat_uint8",
3539         "sample_test.integer_mad_sat_uint16",
3540         "sample_test.integer_mad_sat_long",
3541         "sample_test.integer_mad_sat_long2",
3542         "sample_test.integer_mad_sat_long3",
3543         "sample_test.integer_mad_sat_long4",
3544         "sample_test.integer_mad_sat_long8",
3545         "sample_test.integer_mad_sat_long16",
3546         "sample_test.integer_mad_sat_ulong",
3547         "sample_test.integer_mad_sat_ulong2",
3548         "sample_test.integer_mad_sat_ulong3",
3549         "sample_test.integer_mad_sat_ulong4",
3550         "sample_test.integer_mad_sat_ulong8",
3551         "sample_test.integer_mad_sat_ulong16",
3552         "sample_test.integer_mad_hi_char",
3553         "sample_test.integer_mad_hi_char2",
3554         "sample_test.integer_mad_hi_char3",
3555         "sample_test.integer_mad_hi_char4",
3556         "sample_test.integer_mad_hi_char8",
3557         "sample_test.integer_mad_hi_char16",
3558         "sample_test.integer_mad_hi_uchar",
3559         "sample_test.integer_mad_hi_uchar2",
3560         "sample_test.integer_mad_hi_uchar3",
3561         "sample_test.integer_mad_hi_uchar4",
3562         "sample_test.integer_mad_hi_uchar8",
3563         "sample_test.integer_mad_hi_uchar16",
3564         "sample_test.integer_mad_hi_short",
3565         "sample_test.integer_mad_hi_short2",
3566         "sample_test.integer_mad_hi_short3",
3567         "sample_test.integer_mad_hi_short4",
3568         "sample_test.integer_mad_hi_short8",
3569         "sample_test.integer_mad_hi_short16",
3570         "sample_test.integer_mad_hi_ushort",
3571         "sample_test.integer_mad_hi_ushort2",
3572         "sample_test.integer_mad_hi_ushort3",
3573         "sample_test.integer_mad_hi_ushort4",
3574         "sample_test.integer_mad_hi_ushort8",
3575         "sample_test.integer_mad_hi_ushort16",
3576         "sample_test.integer_mad_hi_int",
3577         "sample_test.integer_mad_hi_int2",
3578         "sample_test.integer_mad_hi_int3",
3579         "sample_test.integer_mad_hi_int4",
3580         "sample_test.integer_mad_hi_int8",
3581         "sample_test.integer_mad_hi_int16",
3582         "sample_test.integer_mad_hi_uint",
3583         "sample_test.integer_mad_hi_uint2",
3584         "sample_test.integer_mad_hi_uint3",
3585         "sample_test.integer_mad_hi_uint4",
3586         "sample_test.integer_mad_hi_uint8",
3587         "sample_test.integer_mad_hi_uint16",
3588         "sample_test.integer_mad_hi_long",
3589         "sample_test.integer_mad_hi_long2",
3590         "sample_test.integer_mad_hi_long3",
3591         "sample_test.integer_mad_hi_long4",
3592         "sample_test.integer_mad_hi_long8",
3593         "sample_test.integer_mad_hi_long16",
3594         "sample_test.integer_mad_hi_ulong",
3595         "sample_test.integer_mad_hi_ulong2",
3596         "sample_test.integer_mad_hi_ulong3",
3597         "sample_test.integer_mad_hi_ulong4",
3598         "sample_test.integer_mad_hi_ulong8",
3599         "sample_test.integer_mad_hi_ulong16",
3600         "sample_test.integer_min_char",
3601         "sample_test.integer_min_char2",
3602         "sample_test.integer_min_char3",
3603         "sample_test.integer_min_char4",
3604         "sample_test.integer_min_char8",
3605         "sample_test.integer_min_char16",
3606         "sample_test.integer_min_uchar",
3607         "sample_test.integer_min_uchar2",
3608         "sample_test.integer_min_uchar3",
3609         "sample_test.integer_min_uchar4",
3610         "sample_test.integer_min_uchar8",
3611         "sample_test.integer_min_uchar16",
3612         "sample_test.integer_min_short",
3613         "sample_test.integer_min_short2",
3614         "sample_test.integer_min_short3",
3615         "sample_test.integer_min_short4",
3616         "sample_test.integer_min_short8",
3617         "sample_test.integer_min_short16",
3618         "sample_test.integer_min_ushort",
3619         "sample_test.integer_min_ushort2",
3620         "sample_test.integer_min_ushort3",
3621         "sample_test.integer_min_ushort4",
3622         "sample_test.integer_min_ushort8",
3623         "sample_test.integer_min_ushort16",
3624         "sample_test.integer_min_int",
3625         "sample_test.integer_min_int2",
3626         "sample_test.integer_min_int3",
3627         "sample_test.integer_min_int4",
3628         "sample_test.integer_min_int8",
3629         "sample_test.integer_min_int16",
3630         "sample_test.integer_min_uint",
3631         "sample_test.integer_min_uint2",
3632         "sample_test.integer_min_uint3",
3633         "sample_test.integer_min_uint4",
3634         "sample_test.integer_min_uint8",
3635         "sample_test.integer_min_uint16",
3636         "sample_test.integer_min_long",
3637         "sample_test.integer_min_long2",
3638         "sample_test.integer_min_long3",
3639         "sample_test.integer_min_long4",
3640         "sample_test.integer_min_long8",
3641         "sample_test.integer_min_long16",
3642         "sample_test.integer_min_ulong",
3643         "sample_test.integer_min_ulong2",
3644         "sample_test.integer_min_ulong3",
3645         "sample_test.integer_min_ulong4",
3646         "sample_test.integer_min_ulong8",
3647         "sample_test.integer_min_ulong16",
3648         "sample_test.integer_max_char",
3649         "sample_test.integer_max_char2",
3650         "sample_test.integer_max_char3",
3651         "sample_test.integer_max_char4",
3652         "sample_test.integer_max_char8",
3653         "sample_test.integer_max_char16",
3654         "sample_test.integer_max_uchar",
3655         "sample_test.integer_max_uchar2",
3656         "sample_test.integer_max_uchar3",
3657         "sample_test.integer_max_uchar4",
3658         "sample_test.integer_max_uchar8",
3659         "sample_test.integer_max_uchar16",
3660         "sample_test.integer_max_short",
3661         "sample_test.integer_max_short2",
3662         "sample_test.integer_max_short3",
3663         "sample_test.integer_max_short4",
3664         "sample_test.integer_max_short8",
3665         "sample_test.integer_max_short16",
3666         "sample_test.integer_max_ushort",
3667         "sample_test.integer_max_ushort2",
3668         "sample_test.integer_max_ushort3",
3669         "sample_test.integer_max_ushort4",
3670         "sample_test.integer_max_ushort8",
3671         "sample_test.integer_max_ushort16",
3672         "sample_test.integer_max_int",
3673         "sample_test.integer_max_int2",
3674         "sample_test.integer_max_int3",
3675         "sample_test.integer_max_int4",
3676         "sample_test.integer_max_int8",
3677         "sample_test.integer_max_int16",
3678         "sample_test.integer_max_uint",
3679         "sample_test.integer_max_uint2",
3680         "sample_test.integer_max_uint3",
3681         "sample_test.integer_max_uint4",
3682         "sample_test.integer_max_uint8",
3683         "sample_test.integer_max_uint16",
3684         "sample_test.integer_max_long",
3685         "sample_test.integer_max_long2",
3686         "sample_test.integer_max_long3",
3687         "sample_test.integer_max_long4",
3688         "sample_test.integer_max_long8",
3689         "sample_test.integer_max_long16",
3690         "sample_test.integer_max_ulong",
3691         "sample_test.integer_max_ulong2",
3692         "sample_test.integer_max_ulong3",
3693         "sample_test.integer_max_ulong4",
3694         "sample_test.integer_max_ulong8",
3695         "sample_test.integer_max_ulong16",
3696         "test_upsample.integer_upsample_char",
3697         "test_upsample.integer_upsample_char2",
3698         "test_upsample.integer_upsample_char3",
3699         "test_upsample.integer_upsample_char4",
3700         "test_upsample.integer_upsample_char8",
3701         "test_upsample.integer_upsample_char16",
3702         "test_upsample.integer_upsample_uchar",
3703         "test_upsample.integer_upsample_uchar2",
3704         "test_upsample.integer_upsample_uchar3",
3705         "test_upsample.integer_upsample_uchar4",
3706         "test_upsample.integer_upsample_uchar8",
3707         "test_upsample.integer_upsample_uchar16",
3708         "test_upsample.integer_upsample_short",
3709         "test_upsample.integer_upsample_short2",
3710         "test_upsample.integer_upsample_short3",
3711         "test_upsample.integer_upsample_short4",
3712         "test_upsample.integer_upsample_short8",
3713         "test_upsample.integer_upsample_short16",
3714         "test_upsample.integer_upsample_ushort",
3715         "test_upsample.integer_upsample_ushort2",
3716         "test_upsample.integer_upsample_ushort3",
3717         "test_upsample.integer_upsample_ushort4",
3718         "test_upsample.integer_upsample_ushort8",
3719         "test_upsample.integer_upsample_ushort16",
3720         "test_upsample.integer_upsample_int",
3721         "test_upsample.integer_upsample_int2",
3722         "test_upsample.integer_upsample_int3",
3723         "test_upsample.integer_upsample_int4",
3724         "test_upsample.integer_upsample_int8",
3725         "test_upsample.integer_upsample_int16",
3726         "test_upsample.integer_upsample_uint",
3727         "test_upsample.integer_upsample_uint2",
3728         "test_upsample.integer_upsample_uint3",
3729         "test_upsample.integer_upsample_uint4",
3730         "test_upsample.integer_upsample_uint8",
3731         "test_upsample.integer_upsample_uint16",
3732         "test_abs_char",
3733         "test_abs_char2",
3734         "test_abs_char3",
3735         "test_abs_char4",
3736         "test_abs_char8",
3737         "test_abs_char16",
3738         "test_abs_short",
3739         "test_abs_short2",
3740         "test_abs_short3",
3741         "test_abs_short4",
3742         "test_abs_short8",
3743         "test_abs_short16",
3744         "test_abs_int",
3745         "test_abs_int2",
3746         "test_abs_int3",
3747         "test_abs_int4",
3748         "test_abs_int8",
3749         "test_abs_int16",
3750         "test_abs_long",
3751         "test_abs_long2",
3752         "test_abs_long3",
3753         "test_abs_long4",
3754         "test_abs_long8",
3755         "test_abs_long16",
3756         "test_abs_uchar",
3757         "test_abs_uchar2",
3758         "test_abs_uchar3",
3759         "test_abs_uchar4",
3760         "test_abs_uchar8",
3761         "test_abs_uchar16",
3762         "test_abs_ushort",
3763         "test_abs_ushort2",
3764         "test_abs_ushort3",
3765         "test_abs_ushort4",
3766         "test_abs_ushort8",
3767         "test_abs_ushort16",
3768         "test_abs_uint",
3769         "test_abs_uint2",
3770         "test_abs_uint3",
3771         "test_abs_uint4",
3772         "test_abs_uint8",
3773         "test_abs_uint16",
3774         "test_abs_ulong",
3775         "test_abs_ulong2",
3776         "test_abs_ulong3",
3777         "test_abs_ulong4",
3778         "test_abs_ulong8",
3779         "test_abs_ulong16",
3780         "test_absdiff_char",
3781         "test_absdiff_char2",
3782         "test_absdiff_char3",
3783         "test_absdiff_char4",
3784         "test_absdiff_char8",
3785         "test_absdiff_char16",
3786         "test_absdiff_uchar",
3787         "test_absdiff_uchar2",
3788         "test_absdiff_uchar3",
3789         "test_absdiff_uchar4",
3790         "test_absdiff_uchar8",
3791         "test_absdiff_uchar16",
3792         "test_absdiff_short",
3793         "test_absdiff_short2",
3794         "test_absdiff_short3",
3795         "test_absdiff_short4",
3796         "test_absdiff_short8",
3797         "test_absdiff_short16",
3798         "test_absdiff_ushort",
3799         "test_absdiff_ushort2",
3800         "test_absdiff_ushort3",
3801         "test_absdiff_ushort4",
3802         "test_absdiff_ushort8",
3803         "test_absdiff_ushort16",
3804         "test_absdiff_int",
3805         "test_absdiff_int2",
3806         "test_absdiff_int3",
3807         "test_absdiff_int4",
3808         "test_absdiff_int8",
3809         "test_absdiff_int16",
3810         "test_absdiff_uint",
3811         "test_absdiff_uint2",
3812         "test_absdiff_uint3",
3813         "test_absdiff_uint4",
3814         "test_absdiff_uint8",
3815         "test_absdiff_uint16",
3816         "test_absdiff_long",
3817         "test_absdiff_long2",
3818         "test_absdiff_long3",
3819         "test_absdiff_long4",
3820         "test_absdiff_long8",
3821         "test_absdiff_long16",
3822         "test_absdiff_ulong",
3823         "test_absdiff_ulong2",
3824         "test_absdiff_ulong3",
3825         "test_absdiff_ulong4",
3826         "test_absdiff_ulong8",
3827         "test_absdiff_ulong16",
3828         "test_add_sat_char",
3829         "test_add_sat_char2",
3830         "test_add_sat_char3",
3831         "test_add_sat_char4",
3832         "test_add_sat_char8",
3833         "test_add_sat_char16",
3834         "test_add_sat_uchar",
3835         "test_add_sat_uchar2",
3836         "test_add_sat_uchar3",
3837         "test_add_sat_uchar4",
3838         "test_add_sat_uchar8",
3839         "test_add_sat_uchar16",
3840         "test_add_sat_short",
3841         "test_add_sat_short2",
3842         "test_add_sat_short3",
3843         "test_add_sat_short4",
3844         "test_add_sat_short8",
3845         "test_add_sat_short16",
3846         "test_add_sat_ushort",
3847         "test_add_sat_ushort2",
3848         "test_add_sat_ushort3",
3849         "test_add_sat_ushort4",
3850         "test_add_sat_ushort8",
3851         "test_add_sat_ushort16",
3852         "test_add_sat_int",
3853         "test_add_sat_int2",
3854         "test_add_sat_int3",
3855         "test_add_sat_int4",
3856         "test_add_sat_int8",
3857         "test_add_sat_int16",
3858         "test_add_sat_uint",
3859         "test_add_sat_uint2",
3860         "test_add_sat_uint3",
3861         "test_add_sat_uint4",
3862         "test_add_sat_uint8",
3863         "test_add_sat_uint16",
3864         "test_add_sat_long",
3865         "test_add_sat_long2",
3866         "test_add_sat_long3",
3867         "test_add_sat_long4",
3868         "test_add_sat_long8",
3869         "test_add_sat_long16",
3870         "test_add_sat_ulong",
3871         "test_add_sat_ulong2",
3872         "test_add_sat_ulong3",
3873         "test_add_sat_ulong4",
3874         "test_add_sat_ulong8",
3875         "test_add_sat_ulong16",
3876         "test_sub_sat_char",
3877         "test_sub_sat_char2",
3878         "test_sub_sat_char3",
3879         "test_sub_sat_char4",
3880         "test_sub_sat_char8",
3881         "test_sub_sat_char16",
3882         "test_sub_sat_uchar",
3883         "test_sub_sat_uchar2",
3884         "test_sub_sat_uchar3",
3885         "test_sub_sat_uchar4",
3886         "test_sub_sat_uchar8",
3887         "test_sub_sat_uchar16",
3888         "test_sub_sat_short",
3889         "test_sub_sat_short2",
3890         "test_sub_sat_short3",
3891         "test_sub_sat_short4",
3892         "test_sub_sat_short8",
3893         "test_sub_sat_short16",
3894         "test_sub_sat_ushort",
3895         "test_sub_sat_ushort2",
3896         "test_sub_sat_ushort3",
3897         "test_sub_sat_ushort4",
3898         "test_sub_sat_ushort8",
3899         "test_sub_sat_ushort16",
3900         "test_sub_sat_int",
3901         "test_sub_sat_int2",
3902         "test_sub_sat_int3",
3903         "test_sub_sat_int4",
3904         "test_sub_sat_int8",
3905         "test_sub_sat_int16",
3906         "test_sub_sat_uint",
3907         "test_sub_sat_uint2",
3908         "test_sub_sat_uint3",
3909         "test_sub_sat_uint4",
3910         "test_sub_sat_uint8",
3911         "test_sub_sat_uint16",
3912         "test_sub_sat_long",
3913         "test_sub_sat_long2",
3914         "test_sub_sat_long3",
3915         "test_sub_sat_long4",
3916         "test_sub_sat_long8",
3917         "test_sub_sat_long16",
3918         "test_sub_sat_ulong",
3919         "test_sub_sat_ulong2",
3920         "test_sub_sat_ulong3",
3921         "test_sub_sat_ulong4",
3922         "test_sub_sat_ulong8",
3923         "test_sub_sat_ulong16",
3924         "test_int_mul24",
3925         "test_int2_mul24",
3926         "test_int3_mul24",
3927         "test_int4_mul24",
3928         "test_int8_mul24",
3929         "test_int16_mul24",
3930         "test_uint_mul24",
3931         "test_uint2_mul24",
3932         "test_uint3_mul24",
3933         "test_uint4_mul24",
3934         "test_uint8_mul24",
3935         "test_uint16_mul24",
3936         "test_int_mad24",
3937         "test_int2_mad24",
3938         "test_int3_mad24",
3939         "test_int4_mad24",
3940         "test_int8_mad24",
3941         "test_int16_mad24",
3942         "test_uint_mad24",
3943         "test_uint2_mad24",
3944         "test_uint3_mad24",
3945         "test_uint4_mad24",
3946         "test_uint8_mad24",
3947         "test_uint16_mad24",
3948         "test_popcount_char",
3949         "test_popcount_char2",
3950         "test_popcount_char3",
3951         "test_popcount_char4",
3952         "test_popcount_char8",
3953         "test_popcount_char16",
3954         "test_popcount_uchar",
3955         "test_popcount_uchar2",
3956         "test_popcount_uchar3",
3957         "test_popcount_uchar4",
3958         "test_popcount_uchar8",
3959         "test_popcount_uchar16",
3960         "test_popcount_short",
3961         "test_popcount_short2",
3962         "test_popcount_short3",
3963         "test_popcount_short4",
3964         "test_popcount_short8",
3965         "test_popcount_short16",
3966         "test_popcount_ushort",
3967         "test_popcount_ushort2",
3968         "test_popcount_ushort3",
3969         "test_popcount_ushort4",
3970         "test_popcount_ushort8",
3971         "test_popcount_ushort16",
3972         "test_popcount_int",
3973         "test_popcount_int2",
3974         "test_popcount_int3",
3975         "test_popcount_int4",
3976         "test_popcount_int8",
3977         "test_popcount_int16",
3978         "test_popcount_uint",
3979         "test_popcount_uint2",
3980         "test_popcount_uint3",
3981         "test_popcount_uint4",
3982         "test_popcount_uint8",
3983         "test_popcount_uint16",
3984         "test_popcount_long",
3985         "test_popcount_long2",
3986         "test_popcount_long3",
3987         "test_popcount_long4",
3988         "test_popcount_long8",
3989         "test_popcount_long16",
3990         "test_popcount_ulong",
3991         "test_popcount_ulong2",
3992         "test_popcount_ulong3",
3993         "test_popcount_ulong4",
3994         "test_popcount_ulong8",
3995         "test_popcount_ulong16",
3996     };
3997 
3998     log_info("test_integer_ops\n");
3999     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
4000 }
4001 
4002 
test_math_brute_force(cl_device_id device,cl_uint size_t_width,const char * folder)4003 bool test_math_brute_force (cl_device_id device, cl_uint size_t_width, const char *folder)
4004 {
4005     static const char* test_name[] = {
4006         "math_kernel.acos_float",
4007         "math_kernel3.acos_float3",
4008         "math_kernel16.acos_float16",
4009         "math_kernel2.acos_float2",
4010         "math_kernel4.acos_float4",
4011         "math_kernel8.acos_float8",
4012         "math_kernel16.acosh_float16",
4013         "math_kernel8.acosh_float8",
4014         "math_kernel4.acosh_float4",
4015         "math_kernel2.acosh_float2",
4016         "math_kernel3.acosh_float3",
4017         "math_kernel.acosh_float",
4018         "math_kernel16.acospi_float16",
4019         "math_kernel8.acospi_float8",
4020         "math_kernel3.acospi_float3",
4021         "math_kernel4.acospi_float4",
4022         "math_kernel2.acospi_float2",
4023         "math_kernel.acospi_float",
4024         "math_kernel16.asin_float16",
4025         "math_kernel8.asin_float8",
4026         "math_kernel4.asin_float4",
4027         "math_kernel3.asin_float3",
4028         "math_kernel2.asin_float2",
4029         "math_kernel.asin_float",
4030         "math_kernel8.asinh_float8",
4031         "math_kernel16.asinh_float16",
4032         "math_kernel4.asinh_float4",
4033         "math_kernel3.asinh_float3",
4034         "math_kernel2.asinh_float2",
4035         "math_kernel.asinh_float",
4036         "math_kernel8.asinpi_float8",
4037         "math_kernel16.asinpi_float16",
4038         "math_kernel3.asinpi_float3",
4039         "math_kernel4.asinpi_float4",
4040         "math_kernel2.asinpi_float2",
4041         "math_kernel.asinpi_float",
4042         "math_kernel16.atan_float16",
4043         "math_kernel8.atan_float8",
4044         "math_kernel4.atan_float4",
4045         "math_kernel2.atan_float2",
4046         "math_kernel3.atan_float3",
4047         "math_kernel.atan_float",
4048         "math_kernel16.atanh_float16",
4049         "math_kernel4.atanh_float4",
4050         "math_kernel8.atanh_float8",
4051         "math_kernel3.atanh_float3",
4052         "math_kernel.atanh_float",
4053         "math_kernel2.atanh_float2",
4054         "math_kernel16.atanpi_float16",
4055         "math_kernel8.atanpi_float8",
4056         "math_kernel4.atanpi_float4",
4057         "math_kernel3.atanpi_float3",
4058         "math_kernel2.atanpi_float2",
4059         "math_kernel.atanpi_float",
4060         "math_kernel8.atan2_float8",
4061         "math_kernel16.atan2_float16",
4062         "math_kernel4.atan2_float4",
4063         "math_kernel3.atan2_float3",
4064         "math_kernel2.atan2_float2",
4065         "math_kernel.atan2_float",
4066         "math_kernel16.atan2pi_float16",
4067         "math_kernel8.atan2pi_float8",
4068         "math_kernel4.atan2pi_float4",
4069         "math_kernel3.atan2pi_float3",
4070         "math_kernel.atan2pi_float",
4071         "math_kernel2.atan2pi_float2",
4072         "math_kernel16.cbrt_float16",
4073         "math_kernel8.cbrt_float8",
4074         "math_kernel4.cbrt_float4",
4075         "math_kernel2.cbrt_float2",
4076         "math_kernel3.cbrt_float3",
4077         "math_kernel.cbrt_float",
4078         "math_kernel4.ceil_float4",
4079         "math_kernel8.ceil_float8",
4080         "math_kernel3.ceil_float3",
4081         "math_kernel16.ceil_float16",
4082         "math_kernel2.ceil_float2",
4083         "math_kernel.ceil_float",
4084         "math_kernel16.copysign_float16",
4085         "math_kernel4.copysign_float4",
4086         "math_kernel2.copysign_float2",
4087         "math_kernel8.copysign_float8",
4088         "math_kernel3.copysign_float3",
4089         "math_kernel.copysign_float",
4090         "math_kernel8.cos_float8",
4091         "math_kernel16.cos_float16",
4092         "math_kernel4.cos_float4",
4093         "math_kernel3.cos_float3",
4094         "math_kernel2.cos_float2",
4095         "math_kernel.cos_float",
4096         "math_kernel8.cosh_float8",
4097         "math_kernel16.cosh_float16",
4098         "math_kernel4.cosh_float4",
4099         "math_kernel3.cosh_float3",
4100         "math_kernel2.cosh_float2",
4101         "math_kernel.cosh_float",
4102         "math_kernel16.cospi_float16",
4103         "math_kernel8.cospi_float8",
4104         "math_kernel4.cospi_float4",
4105         "math_kernel3.cospi_float3",
4106         "math_kernel2.cospi_float2",
4107         "math_kernel.cospi_float",
4108         "math_kernel4.div_float4",
4109         "math_kernel16.div_float16",
4110         "math_kernel8.div_float8",
4111         "math_kernel2.div_float2",
4112         "math_kernel3.div_float3",
4113         "math_kernel.div_float",
4114         "math_kernel4.div_cr_float4",
4115         "math_kernel16.div_cr_float16",
4116         "math_kernel8.div_cr_float8",
4117         "math_kernel2.div_cr_float2",
4118         "math_kernel3.div_cr_float3",
4119         "math_kernel.div_cr_float",
4120         "math_kernel16.exp_float16",
4121         "math_kernel4.exp_float4",
4122         "math_kernel3.exp_float3",
4123         "math_kernel8.exp_float8",
4124         "math_kernel2.exp_float2",
4125         "math_kernel.exp_float",
4126         "math_kernel8.exp2_float8",
4127         "math_kernel16.exp2_float16",
4128         "math_kernel4.exp2_float4",
4129         "math_kernel2.exp2_float2",
4130         "math_kernel3.exp2_float3",
4131         "math_kernel.exp2_float",
4132         "math_kernel16.exp10_float16",
4133         "math_kernel8.exp10_float8",
4134         "math_kernel3.exp10_float3",
4135         "math_kernel4.exp10_float4",
4136         "math_kernel2.exp10_float2",
4137         "math_kernel.exp10_float",
4138         "math_kernel8.expm1_float8",
4139         "math_kernel4.expm1_float4",
4140         "math_kernel16.expm1_float16",
4141         "math_kernel2.expm1_float2",
4142         "math_kernel3.expm1_float3",
4143         "math_kernel.expm1_float",
4144         "math_kernel16.fabs_float16",
4145         "math_kernel8.fabs_float8",
4146         "math_kernel4.fabs_float4",
4147         "math_kernel3.fabs_float3",
4148         "math_kernel.fabs_float",
4149         "math_kernel2.fabs_float2",
4150         "math_kernel16.fdim_float16",
4151         "math_kernel4.fdim_float4",
4152         "math_kernel8.fdim_float8",
4153         "math_kernel2.fdim_float2",
4154         "math_kernel.fdim_float",
4155         "math_kernel3.fdim_float3",
4156         "math_kernel8.floor_float8",
4157         "math_kernel16.floor_float16",
4158         "math_kernel4.floor_float4",
4159         "math_kernel3.floor_float3",
4160         "math_kernel2.floor_float2",
4161         "math_kernel.floor_float",
4162         "math_kernel2.fma_float2",
4163         "math_kernel16.fma_float16",
4164         "math_kernel3.fma_float3",
4165         "math_kernel4.fma_float4",
4166         "math_kernel.fma_float",
4167         "math_kernel8.fma_float8",
4168         "math_kernel8.fmax_float8",
4169         "math_kernel4.fmax_float4",
4170         "math_kernel3.fmax_float3",
4171         "math_kernel.fmax_float",
4172         "math_kernel16.fmax_float16",
4173         "math_kernel2.fmax_float2",
4174         "math_kernel16.fmin_float16",
4175         "math_kernel8.fmin_float8",
4176         "math_kernel3.fmin_float3",
4177         "math_kernel4.fmin_float4",
4178         "math_kernel2.fmin_float2",
4179         "math_kernel.fmin_float",
4180         "math_kernel16.fmod_float16",
4181         "math_kernel8.fmod_float8",
4182         "math_kernel4.fmod_float4",
4183         "math_kernel2.fmod_float2",
4184         "math_kernel3.fmod_float3",
4185         "math_kernel.fmod_float",
4186         "math_kernel16.fract_float16",
4187         "math_kernel4.fract_float4",
4188         "math_kernel2.fract_float2",
4189         "math_kernel3.fract_float3",
4190         "math_kernel.fract_float",
4191         "math_kernel8.fract_float8",
4192         "math_kernel2.frexp_float2",
4193         "math_kernel.frexp_float",
4194         "math_kernel4.frexp_float4",
4195         "math_kernel8.frexp_float8",
4196         "math_kernel3.frexp_float3",
4197         "math_kernel16.frexp_float16",
4198         "math_kernel4.hypot_float4",
4199         "math_kernel16.hypot_float16",
4200         "math_kernel8.hypot_float8",
4201         "math_kernel3.hypot_float3",
4202         "math_kernel2.hypot_float2",
4203         "math_kernel.hypot_float",
4204         "math_kernel16.ilogb_float16",
4205         "math_kernel3.ilogb_float3",
4206         "math_kernel8.ilogb_float8",
4207         "math_kernel2.ilogb_float2",
4208         "math_kernel.ilogb_float",
4209         "math_kernel4.ilogb_float4",
4210         "math_kernel.isequal_float",
4211         "math_kernel4.isequal_float4",
4212         "math_kernel8.isequal_float8",
4213         "math_kernel16.isequal_float16",
4214         "math_kernel3.isequal_float3",
4215         "math_kernel2.isequal_float2",
4216         "math_kernel2.isfinite_float2",
4217         "math_kernel16.isfinite_float16",
4218         "math_kernel8.isfinite_float8",
4219         "math_kernel.isfinite_float",
4220         "math_kernel4.isfinite_float4",
4221         "math_kernel3.isfinite_float3",
4222         "math_kernel16.isgreater_float16",
4223         "math_kernel8.isgreater_float8",
4224         "math_kernel4.isgreater_float4",
4225         "math_kernel3.isgreater_float3",
4226         "math_kernel2.isgreater_float2",
4227         "math_kernel.isgreater_float",
4228         "math_kernel8.isgreaterequal_float8",
4229         "math_kernel16.isgreaterequal_float16",
4230         "math_kernel4.isgreaterequal_float4",
4231         "math_kernel.isgreaterequal_float",
4232         "math_kernel3.isgreaterequal_float3",
4233         "math_kernel2.isgreaterequal_float2",
4234         "math_kernel4.isinf_float4",
4235         "math_kernel16.isinf_float16",
4236         "math_kernel8.isinf_float8",
4237         "math_kernel3.isinf_float3",
4238         "math_kernel2.isinf_float2",
4239         "math_kernel.isinf_float",
4240         "math_kernel16.isless_float16",
4241         "math_kernel8.isless_float8",
4242         "math_kernel4.isless_float4",
4243         "math_kernel3.isless_float3",
4244         "math_kernel2.isless_float2",
4245         "math_kernel.isless_float",
4246         "math_kernel8.islessequal_float8",
4247         "math_kernel16.islessequal_float16",
4248         "math_kernel2.islessequal_float2",
4249         "math_kernel3.islessequal_float3",
4250         "math_kernel4.islessequal_float4",
4251         "math_kernel.islessequal_float",
4252         "math_kernel8.islessgreater_float8",
4253         "math_kernel16.islessgreater_float16",
4254         "math_kernel4.islessgreater_float4",
4255         "math_kernel3.islessgreater_float3",
4256         "math_kernel2.islessgreater_float2",
4257         "math_kernel.islessgreater_float",
4258         "math_kernel4.isnan_float4",
4259         "math_kernel16.isnan_float16",
4260         "math_kernel8.isnan_float8",
4261         "math_kernel3.isnan_float3",
4262         "math_kernel2.isnan_float2",
4263         "math_kernel.isnan_float",
4264         "math_kernel16.isnormal_float16",
4265         "math_kernel8.isnormal_float8",
4266         "math_kernel4.isnormal_float4",
4267         "math_kernel3.isnormal_float3",
4268         "math_kernel2.isnormal_float2",
4269         "math_kernel.isnormal_float",
4270         "math_kernel16.isnotequal_float16",
4271         "math_kernel8.isnotequal_float8",
4272         "math_kernel4.isnotequal_float4",
4273         "math_kernel3.isnotequal_float3",
4274         "math_kernel2.isnotequal_float2",
4275         "math_kernel.isnotequal_float",
4276         "math_kernel16.isordered_float16",
4277         "math_kernel8.isordered_float8",
4278         "math_kernel3.isordered_float3",
4279         "math_kernel4.isordered_float4",
4280         "math_kernel2.isordered_float2",
4281         "math_kernel.isordered_float",
4282         "math_kernel16.isunordered_float16",
4283         "math_kernel8.isunordered_float8",
4284         "math_kernel4.isunordered_float4",
4285         "math_kernel2.isunordered_float2",
4286         "math_kernel3.isunordered_float3",
4287         "math_kernel.isunordered_float",
4288         "math_kernel8.ldexp_float8",
4289         "math_kernel2.ldexp_float2",
4290         "math_kernel3.ldexp_float3",
4291         "math_kernel16.ldexp_float16",
4292         "math_kernel4.ldexp_float4",
4293         "math_kernel.ldexp_float",
4294         "math_kernel4.lgamma_float4",
4295         "math_kernel16.lgamma_float16",
4296         "math_kernel8.lgamma_float8",
4297         "math_kernel2.lgamma_float2",
4298         "math_kernel.lgamma_float",
4299         "math_kernel3.lgamma_float3",
4300         "math_kernel16.lgamma_r_float16",
4301         "math_kernel8.lgamma_r_float8",
4302         "math_kernel4.lgamma_r_float4",
4303         "math_kernel3.lgamma_r_float3",
4304         "math_kernel.lgamma_r_float",
4305         "math_kernel2.lgamma_r_float2",
4306         "math_kernel16.log_float16",
4307         "math_kernel4.log_float4",
4308         "math_kernel8.log_float8",
4309         "math_kernel2.log_float2",
4310         "math_kernel.log_float",
4311         "math_kernel3.log_float3",
4312         "math_kernel16.log2_float16",
4313         "math_kernel4.log2_float4",
4314         "math_kernel8.log2_float8",
4315         "math_kernel2.log2_float2",
4316         "math_kernel.log2_float",
4317         "math_kernel3.log2_float3",
4318         "math_kernel8.log10_float8",
4319         "math_kernel4.log10_float4",
4320         "math_kernel16.log10_float16",
4321         "math_kernel2.log10_float2",
4322         "math_kernel.log10_float",
4323         "math_kernel3.log10_float3",
4324         "math_kernel16.log1p_float16",
4325         "math_kernel8.log1p_float8",
4326         "math_kernel4.log1p_float4",
4327         "math_kernel3.log1p_float3",
4328         "math_kernel2.log1p_float2",
4329         "math_kernel.log1p_float",
4330         "math_kernel16.logb_float16",
4331         "math_kernel8.logb_float8",
4332         "math_kernel4.logb_float4",
4333         "math_kernel3.logb_float3",
4334         "math_kernel2.logb_float2",
4335         "math_kernel.logb_float",
4336         "math_kernel16.mad_float16",
4337         "math_kernel8.mad_float8",
4338         "math_kernel4.mad_float4",
4339         "math_kernel2.mad_float2",
4340         "math_kernel3.mad_float3",
4341         "math_kernel.mad_float",
4342         "math_kernel8.maxmag_float8",
4343         "math_kernel16.maxmag_float16",
4344         "math_kernel4.maxmag_float4",
4345         "math_kernel3.maxmag_float3",
4346         "math_kernel2.maxmag_float2",
4347         "math_kernel.maxmag_float",
4348         "math_kernel16.minmag_float16",
4349         "math_kernel8.minmag_float8",
4350         "math_kernel4.minmag_float4",
4351         "math_kernel3.minmag_float3",
4352         "math_kernel2.minmag_float2",
4353         "math_kernel.minmag_float",
4354         "math_kernel16.modf_float16",
4355         "math_kernel8.modf_float8",
4356         "math_kernel3.modf_float3",
4357         "math_kernel4.modf_float4",
4358         "math_kernel2.modf_float2",
4359         "math_kernel.modf_float",
4360         "math_kernel16.nan_float16",
4361         "math_kernel8.nan_float8",
4362         "math_kernel4.nan_float4",
4363         "math_kernel2.nan_float2",
4364         "math_kernel.nan_float",
4365         "math_kernel3.nan_float3",
4366         "math_kernel8.nextafter_float8",
4367         "math_kernel16.nextafter_float16",
4368         "math_kernel4.nextafter_float4",
4369         "math_kernel2.nextafter_float2",
4370         "math_kernel3.nextafter_float3",
4371         "math_kernel.nextafter_float",
4372         "math_kernel16.pow_float16",
4373         "math_kernel8.pow_float8",
4374         "math_kernel4.pow_float4",
4375         "math_kernel3.pow_float3",
4376         "math_kernel2.pow_float2",
4377         "math_kernel.pow_float",
4378         "math_kernel4.pown_float4",
4379         "math_kernel8.pown_float8",
4380         "math_kernel16.pown_float16",
4381         "math_kernel3.pown_float3",
4382         "math_kernel2.pown_float2",
4383         "math_kernel.pown_float",
4384         "math_kernel16.powr_float16",
4385         "math_kernel8.powr_float8",
4386         "math_kernel4.powr_float4",
4387         "math_kernel2.powr_float2",
4388         "math_kernel3.powr_float3",
4389         "math_kernel.powr_float",
4390         "math_kernel4.remainder_float4",
4391         "math_kernel8.remainder_float8",
4392         "math_kernel16.remainder_float16",
4393         "math_kernel3.remainder_float3",
4394         "math_kernel2.remainder_float2",
4395         "math_kernel.remainder_float",
4396         "math_kernel8.remquo_float8",
4397         "math_kernel2.remquo_float2",
4398         "math_kernel3.remquo_float3",
4399         "math_kernel16.remquo_float16",
4400         "math_kernel4.remquo_float4",
4401         "math_kernel.remquo_float",
4402         "math_kernel8.rint_float8",
4403         "math_kernel16.rint_float16",
4404         "math_kernel4.rint_float4",
4405         "math_kernel3.rint_float3",
4406         "math_kernel.rint_float",
4407         "math_kernel2.rint_float2",
4408         "math_kernel16.rootn_float16",
4409         "math_kernel8.rootn_float8",
4410         "math_kernel3.rootn_float3",
4411         "math_kernel4.rootn_float4",
4412         "math_kernel.rootn_float",
4413         "math_kernel2.rootn_float2",
4414         "math_kernel8.round_float8",
4415         "math_kernel16.round_float16",
4416         "math_kernel4.round_float4",
4417         "math_kernel2.round_float2",
4418         "math_kernel3.round_float3",
4419         "math_kernel.round_float",
4420         "math_kernel8.rsqrt_float8",
4421         "math_kernel4.rsqrt_float4",
4422         "math_kernel16.rsqrt_float16",
4423         "math_kernel3.rsqrt_float3",
4424         "math_kernel.rsqrt_float",
4425         "math_kernel2.rsqrt_float2",
4426         "math_kernel8.signbit_float8",
4427         "math_kernel16.signbit_float16",
4428         "math_kernel4.signbit_float4",
4429         "math_kernel3.signbit_float3",
4430         "math_kernel2.signbit_float2",
4431         "math_kernel.signbit_float",
4432         "math_kernel8.sin_float8",
4433         "math_kernel4.sin_float4",
4434         "math_kernel16.sin_float16",
4435         "math_kernel2.sin_float2",
4436         "math_kernel3.sin_float3",
4437         "math_kernel.sin_float",
4438         "math_kernel8.sincos_float8",
4439         "math_kernel4.sincos_float4",
4440         "math_kernel16.sincos_float16",
4441         "math_kernel2.sincos_float2",
4442         "math_kernel3.sincos_float3",
4443         "math_kernel.sincos_float",
4444         "math_kernel8.sinh_float8",
4445         "math_kernel16.sinh_float16",
4446         "math_kernel4.sinh_float4",
4447         "math_kernel3.sinh_float3",
4448         "math_kernel2.sinh_float2",
4449         "math_kernel.sinh_float",
4450         "math_kernel16.sinpi_float16",
4451         "math_kernel4.sinpi_float4",
4452         "math_kernel3.sinpi_float3",
4453         "math_kernel.sinpi_float",
4454         "math_kernel8.sinpi_float8",
4455         "math_kernel2.sinpi_float2",
4456         "math_kernel4.sqrt_float4",
4457         "math_kernel16.sqrt_float16",
4458         "math_kernel8.sqrt_float8",
4459         "math_kernel2.sqrt_float2",
4460         "math_kernel3.sqrt_float3",
4461         "math_kernel.sqrt_float",
4462         "math_kernel4.sqrt_cr_float4",
4463         "math_kernel16.sqrt_cr_float16",
4464         "math_kernel8.sqrt_cr_float8",
4465         "math_kernel2.sqrt_cr_float2",
4466         "math_kernel3.sqrt_cr_float3",
4467         "math_kernel.sqrt_cr_float",
4468         "math_kernel8.tan_float8",
4469         "math_kernel16.tan_float16",
4470         "math_kernel4.tan_float4",
4471         "math_kernel.tan_float",
4472         "math_kernel3.tan_float3",
4473         "math_kernel2.tan_float2",
4474         "math_kernel16.tanh_float16",
4475         "math_kernel8.tanh_float8",
4476         "math_kernel4.tanh_float4",
4477         "math_kernel2.tanh_float2",
4478         "math_kernel.tanh_float",
4479         "math_kernel3.tanh_float3",
4480         "math_kernel16.tanpi_float16",
4481         "math_kernel8.tanpi_float8",
4482         "math_kernel4.tanpi_float4",
4483         "math_kernel3.tanpi_float3",
4484         "math_kernel2.tanpi_float2",
4485         "math_kernel.tanpi_float",
4486         "math_kernel8.trunc_float8",
4487         "math_kernel4.trunc_float4",
4488         "math_kernel16.trunc_float16",
4489         "math_kernel2.trunc_float2",
4490         "math_kernel3.trunc_float3",
4491         "math_kernel.trunc_float",
4492         "math_kernel16.trunc_double16",
4493         "math_kernel16.half_cos_float16",
4494         "math_kernel8.half_cos_float8",
4495         "math_kernel4.half_cos_float4",
4496         "math_kernel3.half_cos_float3",
4497         "math_kernel2.half_cos_float2",
4498         "math_kernel.half_cos_float",
4499         "math_kernel16.half_divide_float16",
4500         "math_kernel8.half_divide_float8",
4501         "math_kernel4.half_divide_float4",
4502         "math_kernel3.half_divide_float3",
4503         "math_kernel2.half_divide_float2",
4504         "math_kernel.half_divide_float",
4505         "math_kernel8.half_exp_float8",
4506         "math_kernel16.half_exp_float16",
4507         "math_kernel4.half_exp_float4",
4508         "math_kernel3.half_exp_float3",
4509         "math_kernel2.half_exp_float2",
4510         "math_kernel.half_exp_float",
4511         "math_kernel16.half_exp2_float16",
4512         "math_kernel4.half_exp2_float4",
4513         "math_kernel8.half_exp2_float8",
4514         "math_kernel.half_exp2_float",
4515         "math_kernel3.half_exp2_float3",
4516         "math_kernel2.half_exp2_float2",
4517         "math_kernel8.half_exp10_float8",
4518         "math_kernel4.half_exp10_float4",
4519         "math_kernel16.half_exp10_float16",
4520         "math_kernel2.half_exp10_float2",
4521         "math_kernel3.half_exp10_float3",
4522         "math_kernel.half_exp10_float",
4523         "math_kernel8.half_log_float8",
4524         "math_kernel16.half_log_float16",
4525         "math_kernel3.half_log_float3",
4526         "math_kernel.half_log_float",
4527         "math_kernel2.half_log_float2",
4528         "math_kernel4.half_log_float4",
4529         "math_kernel16.half_log2_float16",
4530         "math_kernel4.half_log2_float4",
4531         "math_kernel8.half_log2_float8",
4532         "math_kernel2.half_log2_float2",
4533         "math_kernel3.half_log2_float3",
4534         "math_kernel.half_log2_float",
4535         "math_kernel4.half_log10_float4",
4536         "math_kernel8.half_log10_float8",
4537         "math_kernel16.half_log10_float16",
4538         "math_kernel2.half_log10_float2",
4539         "math_kernel3.half_log10_float3",
4540         "math_kernel.half_log10_float",
4541         "math_kernel8.half_powr_float8",
4542         "math_kernel16.half_powr_float16",
4543         "math_kernel4.half_powr_float4",
4544         "math_kernel3.half_powr_float3",
4545         "math_kernel2.half_powr_float2",
4546         "math_kernel.half_powr_float",
4547         "math_kernel16.half_recip_float16",
4548         "math_kernel8.half_recip_float8",
4549         "math_kernel4.half_recip_float4",
4550         "math_kernel3.half_recip_float3",
4551         "math_kernel2.half_recip_float2",
4552         "math_kernel.half_recip_float",
4553         "math_kernel16.half_rsqrt_float16",
4554         "math_kernel8.half_rsqrt_float8",
4555         "math_kernel4.half_rsqrt_float4",
4556         "math_kernel3.half_rsqrt_float3",
4557         "math_kernel2.half_rsqrt_float2",
4558         "math_kernel.half_rsqrt_float",
4559         "math_kernel16.half_sin_float16",
4560         "math_kernel8.half_sin_float8",
4561         "math_kernel4.half_sin_float4",
4562         "math_kernel3.half_sin_float3",
4563         "math_kernel2.half_sin_float2",
4564         "math_kernel.half_sin_float",
4565         "math_kernel8.half_sqrt_float8",
4566         "math_kernel4.half_sqrt_float4",
4567         "math_kernel3.half_sqrt_float3",
4568         "math_kernel16.half_sqrt_float16",
4569         "math_kernel2.half_sqrt_float2",
4570         "math_kernel.half_sqrt_float",
4571         "math_kernel16.half_tan_float16",
4572         "math_kernel8.half_tan_float8",
4573         "math_kernel4.half_tan_float4",
4574         "math_kernel3.half_tan_float3",
4575         "math_kernel2.half_tan_float2",
4576         "math_kernel.half_tan_float",
4577     };
4578 
4579     log_info("test_math_brute_force\n");
4580     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
4581 }
4582 
4583 
test_math_brute_force_double(cl_device_id device,cl_uint size_t_width,const char * folder)4584 bool test_math_brute_force_double (cl_device_id device, cl_uint size_t_width, const char *folder)
4585 {
4586     static const char* test_name[] = {
4587         "math_kernel8.acos_double8",
4588         "math_kernel4.acos_double4",
4589         "math_kernel16.acos_double16",
4590         "math_kernel2.acos_double2",
4591         "math_kernel3.acos_double3",
4592         "math_kernel.acos_double",
4593         "math_kernel16.acosh_double16",
4594         "math_kernel8.acosh_double8",
4595         "math_kernel4.acosh_double4",
4596         "math_kernel2.acosh_double2",
4597         "math_kernel3.acosh_double3",
4598         "math_kernel.acosh_double",
4599         "math_kernel8.acospi_double8",
4600         "math_kernel16.acospi_double16",
4601         "math_kernel4.acospi_double4",
4602         "math_kernel3.acospi_double3",
4603         "math_kernel2.acospi_double2",
4604         "math_kernel.acospi_double",
4605         "math_kernel16.asin_double16",
4606         "math_kernel8.asin_double8",
4607         "math_kernel4.asin_double4",
4608         "math_kernel3.asin_double3",
4609         "math_kernel.asin_double",
4610         "math_kernel2.asin_double2",
4611         "math_kernel16.asinh_double16",
4612         "math_kernel8.asinh_double8",
4613         "math_kernel4.asinh_double4",
4614         "math_kernel2.asinh_double2",
4615         "math_kernel3.asinh_double3",
4616         "math_kernel.asinh_double",
4617         "math_kernel4.asinpi_double4",
4618         "math_kernel8.asinpi_double8",
4619         "math_kernel16.asinpi_double16",
4620         "math_kernel2.asinpi_double2",
4621         "math_kernel3.asinpi_double3",
4622         "math_kernel.asinpi_double",
4623         "math_kernel16.atan_double16",
4624         "math_kernel8.atan_double8",
4625         "math_kernel4.atan_double4",
4626         "math_kernel2.atan_double2",
4627         "math_kernel3.atan_double3",
4628         "math_kernel.atan_double",
4629         "math_kernel16.atanh_double16",
4630         "math_kernel8.atanh_double8",
4631         "math_kernel4.atanh_double4",
4632         "math_kernel3.atanh_double3",
4633         "math_kernel2.atanh_double2",
4634         "math_kernel.atanh_double",
4635          "math_kernel8.atanpi_double8",
4636         "math_kernel16.atanpi_double16",
4637         "math_kernel3.atanpi_double3",
4638         "math_kernel4.atanpi_double4",
4639         "math_kernel2.atanpi_double2",
4640         "math_kernel.atanpi_double",
4641         "math_kernel16.atan2_double16",
4642         "math_kernel8.atan2_double8",
4643         "math_kernel4.atan2_double4",
4644         "math_kernel2.atan2_double2",
4645         "math_kernel3.atan2_double3",
4646         "math_kernel.atan2_double",
4647         "math_kernel8.atan2pi_double8",
4648         "math_kernel4.atan2pi_double4",
4649         "math_kernel16.atan2pi_double16",
4650         "math_kernel3.atan2pi_double3",
4651         "math_kernel2.atan2pi_double2",
4652         "math_kernel.atan2pi_double",
4653         "math_kernel4.cbrt_double4",
4654         "math_kernel8.cbrt_double8",
4655         "math_kernel3.cbrt_double3",
4656         "math_kernel16.cbrt_double16",
4657         "math_kernel2.cbrt_double2",
4658         "math_kernel.cbrt_double",
4659         "math_kernel16.ceil_double16",
4660         "math_kernel4.ceil_double4",
4661         "math_kernel2.ceil_double2",
4662         "math_kernel8.ceil_double8",
4663         "math_kernel3.ceil_double3",
4664         "math_kernel.ceil_double",
4665         "math_kernel16.copysign_double16",
4666         "math_kernel8.copysign_double8",
4667         "math_kernel4.copysign_double4",
4668         "math_kernel2.copysign_double2",
4669         "math_kernel3.copysign_double3",
4670         "math_kernel.copysign_double",
4671         "math_kernel8.cos_double8",
4672         "math_kernel16.cos_double16",
4673         "math_kernel4.cos_double4",
4674         "math_kernel3.cos_double3",
4675         "math_kernel2.cos_double2",
4676         "math_kernel.cos_double",
4677         "math_kernel16.cosh_double16",
4678         "math_kernel8.cosh_double8",
4679         "math_kernel4.cosh_double4",
4680         "math_kernel3.cosh_double3",
4681         "math_kernel2.cosh_double2",
4682         "math_kernel.cosh_double",
4683         "math_kernel4.cospi_double4",
4684         "math_kernel16.cospi_double16",
4685         "math_kernel8.cospi_double8",
4686         "math_kernel3.cospi_double3",
4687         "math_kernel.cospi_double",
4688         "math_kernel2.cospi_double2",
4689         "math_kernel16.exp_double16",
4690         "math_kernel8.exp_double8",
4691         "math_kernel4.exp_double4",
4692         "math_kernel2.exp_double2",
4693         "math_kernel3.exp_double3",
4694         "math_kernel.exp_double",
4695         "math_kernel8.exp2_double8",
4696         "math_kernel16.exp2_double16",
4697         "math_kernel4.exp2_double4",
4698         "math_kernel3.exp2_double3",
4699         "math_kernel2.exp2_double2",
4700         "math_kernel.exp2_double",
4701         "math_kernel8.exp10_double8",
4702         "math_kernel4.exp10_double4",
4703         "math_kernel16.exp10_double16",
4704         "math_kernel3.exp10_double3",
4705         "math_kernel.exp10_double",
4706         "math_kernel2.exp10_double2",
4707         "math_kernel16.expm1_double16",
4708         "math_kernel8.expm1_double8",
4709         "math_kernel2.expm1_double2",
4710         "math_kernel4.expm1_double4",
4711         "math_kernel3.expm1_double3",
4712         "math_kernel.expm1_double",
4713         "math_kernel16.fabs_double16",
4714         "math_kernel8.fabs_double8",
4715         "math_kernel4.fabs_double4",
4716         "math_kernel3.fabs_double3",
4717         "math_kernel2.fabs_double2",
4718         "math_kernel.fabs_double",
4719         "math_kernel8.fdim_double8",
4720         "math_kernel16.fdim_double16",
4721         "math_kernel4.fdim_double4",
4722         "math_kernel3.fdim_double3",
4723         "math_kernel2.fdim_double2",
4724         "math_kernel.fdim_double",
4725         "math_kernel4.floor_double4",
4726         "math_kernel16.floor_double16",
4727         "math_kernel8.floor_double8",
4728         "math_kernel3.floor_double3",
4729         "math_kernel2.floor_double2",
4730         "math_kernel.floor_double",
4731         "math_kernel4.fma_double4",
4732         "math_kernel16.fma_double16",
4733         "math_kernel8.fma_double8",
4734         "math_kernel2.fma_double2",
4735         "math_kernel3.fma_double3",
4736         "math_kernel.fma_double",
4737         "math_kernel8.fmax_float8",
4738         "math_kernel4.fmax_float4",
4739         "math_kernel3.fmax_float3",
4740         "math_kernel.fmax_float",
4741         "math_kernel16.fmax_float16",
4742         "math_kernel2.fmax_float2",
4743         "math_kernel8.fmax_double8",
4744         "math_kernel16.fmax_double16",
4745         "math_kernel2.fmax_double2",
4746         "math_kernel4.fmax_double4",
4747         "math_kernel3.fmax_double3",
4748         "math_kernel.fmax_double",
4749         "math_kernel16.fmin_double16",
4750         "math_kernel8.fmin_double8",
4751         "math_kernel4.fmin_double4",
4752         "math_kernel3.fmin_double3",
4753         "math_kernel2.fmin_double2",
4754         "math_kernel.fmin_double",
4755         "math_kernel8.fmod_double8",
4756         "math_kernel16.fmod_double16",
4757         "math_kernel3.fmod_double3",
4758         "math_kernel4.fmod_double4",
4759         "math_kernel2.fmod_double2",
4760         "math_kernel.fmod_double",
4761         "math_kernel16.fract_double16",
4762         "math_kernel8.fract_double8",
4763         "math_kernel4.fract_double4",
4764         "math_kernel2.fract_double2",
4765         "math_kernel3.fract_double3",
4766         "math_kernel.fract_double",
4767         "math_kernel4.frexp_double4",
4768         "math_kernel8.frexp_double8",
4769         "math_kernel2.frexp_double2",
4770         "math_kernel3.frexp_double3",
4771         "math_kernel16.frexp_double16",
4772         "math_kernel.frexp_double",
4773         "math_kernel4.hypot_double4",
4774         "math_kernel8.hypot_double8",
4775         "math_kernel16.hypot_double16",
4776         "math_kernel2.hypot_double2",
4777         "math_kernel3.hypot_double3",
4778         "math_kernel.hypot_double",
4779         "math_kernel16.ilogb_double16",
4780         "math_kernel8.ilogb_double8",
4781         "math_kernel4.ilogb_double4",
4782         "math_kernel3.ilogb_double3",
4783         "math_kernel.ilogb_double",
4784         "math_kernel2.ilogb_double2",
4785         "math_kernel16.isequal_double16",
4786         "math_kernel8.isequal_double8",
4787         "math_kernel4.isequal_double4",
4788         "math_kernel3.isequal_double3",
4789         "math_kernel.isequal_double",
4790         "math_kernel2.isequal_double2",
4791         "math_kernel16.isfinite_double16",
4792         "math_kernel8.isfinite_double8",
4793         "math_kernel4.isfinite_double4",
4794         "math_kernel3.isfinite_double3",
4795         "math_kernel2.isfinite_double2",
4796         "math_kernel.isfinite_double",
4797         "math_kernel16.isgreater_double16",
4798         "math_kernel8.isgreater_double8",
4799         "math_kernel4.isgreater_double4",
4800         "math_kernel3.isgreater_double3",
4801         "math_kernel.isgreater_double",
4802         "math_kernel2.isgreater_double2",
4803         "math_kernel16.isgreaterequal_double16",
4804         "math_kernel8.isgreaterequal_double8",
4805         "math_kernel4.isgreaterequal_double4",
4806         "math_kernel3.isgreaterequal_double3",
4807         "math_kernel2.isgreaterequal_double2",
4808         "math_kernel.isgreaterequal_double",
4809         "math_kernel8.isinf_double8",
4810         "math_kernel16.isinf_double16",
4811         "math_kernel3.isinf_double3",
4812         "math_kernel4.isinf_double4",
4813         "math_kernel2.isinf_double2",
4814         "math_kernel.isinf_double",
4815         "math_kernel8.isless_double8",
4816         "math_kernel4.isless_double4",
4817         "math_kernel16.isless_double16",
4818         "math_kernel2.isless_double2",
4819         "math_kernel3.isless_double3",
4820         "math_kernel.isless_double",
4821         "math_kernel16.islessequal_double16",
4822         "math_kernel8.islessequal_double8",
4823         "math_kernel4.islessequal_double4",
4824         "math_kernel2.islessequal_double2",
4825         "math_kernel3.islessequal_double3",
4826         "math_kernel.islessequal_double",
4827         "math_kernel16.islessgreater_double16",
4828         "math_kernel3.islessgreater_double3",
4829         "math_kernel8.islessgreater_double8",
4830         "math_kernel4.islessgreater_double4",
4831         "math_kernel2.islessgreater_double2",
4832         "math_kernel.islessgreater_double",
4833         "math_kernel8.isnan_double8",
4834         "math_kernel4.isnan_double4",
4835         "math_kernel16.isnan_double16",
4836         "math_kernel3.isnan_double3",
4837         "math_kernel2.isnan_double2",
4838         "math_kernel.isnan_double",
4839         "math_kernel16.isnormal_double16",
4840         "math_kernel8.isnormal_double8",
4841         "math_kernel4.isnormal_double4",
4842         "math_kernel2.isnormal_double2",
4843         "math_kernel3.isnormal_double3",
4844         "math_kernel.isnormal_double",
4845         "math_kernel16.isnotequal_double16",
4846         "math_kernel4.isnotequal_double4",
4847         "math_kernel8.isnotequal_double8",
4848         "math_kernel3.isnotequal_double3",
4849         "math_kernel2.isnotequal_double2",
4850         "math_kernel.isnotequal_double",
4851         "math_kernel16.isordered_double16",
4852         "math_kernel3.isordered_double3",
4853         "math_kernel4.isordered_double4",
4854         "math_kernel8.isordered_double8",
4855         "math_kernel2.isordered_double2",
4856         "math_kernel.isordered_double",
4857         "math_kernel8.isunordered_double8",
4858         "math_kernel16.isunordered_double16",
4859         "math_kernel4.isunordered_double4",
4860         "math_kernel3.isunordered_double3",
4861         "math_kernel2.isunordered_double2",
4862         "math_kernel.isunordered_double",
4863         "math_kernel16.ldexp_double16",
4864         "math_kernel4.ldexp_double4",
4865         "math_kernel8.ldexp_double8",
4866         "math_kernel2.ldexp_double2",
4867         "math_kernel.ldexp_double",
4868         "math_kernel3.ldexp_double3",
4869         "math_kernel8.lgamma_double8",
4870         "math_kernel16.lgamma_double16",
4871         "math_kernel4.lgamma_double4",
4872         "math_kernel2.lgamma_double2",
4873         "math_kernel.lgamma_double",
4874         "math_kernel3.lgamma_double3",
4875         "math_kernel16.lgamma_r_double16",
4876         "math_kernel8.lgamma_r_double8",
4877         "math_kernel3.lgamma_r_double3",
4878         "math_kernel4.lgamma_r_double4",
4879         "math_kernel.lgamma_r_double",
4880         "math_kernel2.lgamma_r_double2",
4881         "math_kernel8.log_double8",
4882         "math_kernel16.log_double16",
4883         "math_kernel4.log_double4",
4884         "math_kernel3.log_double3",
4885         "math_kernel2.log_double2",
4886         "math_kernel.log_double",
4887         "math_kernel8.log2_double8",
4888         "math_kernel16.log2_double16",
4889         "math_kernel4.log2_double4",
4890         "math_kernel3.log2_double3",
4891         "math_kernel.log2_double",
4892         "math_kernel2.log2_double2",
4893         "math_kernel16.log10_double16",
4894         "math_kernel4.log10_double4",
4895         "math_kernel8.log10_double8",
4896         "math_kernel3.log10_double3",
4897         "math_kernel2.log10_double2",
4898         "math_kernel.log10_double",
4899         "math_kernel16.log1p_double16",
4900         "math_kernel4.log1p_double4",
4901         "math_kernel8.log1p_double8",
4902         "math_kernel2.log1p_double2",
4903         "math_kernel3.log1p_double3",
4904         "math_kernel.log1p_double",
4905         "math_kernel16.logb_double16",
4906         "math_kernel8.logb_double8",
4907         "math_kernel4.logb_double4",
4908         "math_kernel2.logb_double2",
4909         "math_kernel3.logb_double3",
4910         "math_kernel.logb_double",
4911         "math_kernel8.mad_double8",
4912         "math_kernel16.mad_double16",
4913         "math_kernel4.mad_double4",
4914         "math_kernel3.mad_double3",
4915         "math_kernel2.mad_double2",
4916         "math_kernel.mad_double",
4917         "math_kernel8.maxmag_double8",
4918         "math_kernel16.maxmag_double16",
4919         "math_kernel4.maxmag_double4",
4920         "math_kernel3.maxmag_double3",
4921         "math_kernel2.maxmag_double2",
4922         "math_kernel.maxmag_double",
4923         "math_kernel16.minmag_double16",
4924         "math_kernel8.minmag_double8",
4925         "math_kernel4.minmag_double4",
4926         "math_kernel3.minmag_double3",
4927         "math_kernel2.minmag_double2",
4928         "math_kernel.minmag_double",
4929         "math_kernel16.modf_double16",
4930         "math_kernel8.modf_double8",
4931         "math_kernel4.modf_double4",
4932         "math_kernel2.modf_double2",
4933         "math_kernel3.modf_double3",
4934         "math_kernel.modf_double",
4935         "math_kernel8.nan_double8",
4936         "math_kernel16.nan_double16",
4937         "math_kernel4.nan_double4",
4938         "math_kernel3.nan_double3",
4939         "math_kernel2.nan_double2",
4940         "math_kernel.nan_double",
4941         "math_kernel8.nextafter_double8",
4942         "math_kernel4.nextafter_double4",
4943         "math_kernel16.nextafter_double16",
4944         "math_kernel3.nextafter_double3",
4945         "math_kernel2.nextafter_double2",
4946         "math_kernel.nextafter_double",
4947         "math_kernel4.pow_double4",
4948         "math_kernel8.pow_double8",
4949         "math_kernel16.pow_double16",
4950         "math_kernel3.pow_double3",
4951         "math_kernel2.pow_double2",
4952         "math_kernel.pow_double",
4953         "math_kernel4.pown_double4",
4954         "math_kernel8.pown_double8",
4955         "math_kernel2.pown_double2",
4956         "math_kernel3.pown_double3",
4957         "math_kernel.pown_double",
4958         "math_kernel16.pown_double16",
4959         "math_kernel16.powr_double16",
4960         "math_kernel8.powr_double8",
4961         "math_kernel4.powr_double4",
4962         "math_kernel3.powr_double3",
4963         "math_kernel2.powr_double2",
4964         "math_kernel.powr_double",
4965         "math_kernel4.remainder_double4",
4966         "math_kernel8.remainder_double8",
4967         "math_kernel16.remainder_double16",
4968         "math_kernel2.remainder_double2",
4969         "math_kernel3.remainder_double3",
4970         "math_kernel.remainder_double",
4971         "math_kernel8.remquo_double8",
4972         "math_kernel16.remquo_double16",
4973         "math_kernel3.remquo_double3",
4974         "math_kernel4.remquo_double4",
4975         "math_kernel2.remquo_double2",
4976         "math_kernel.remquo_double",
4977         "math_kernel8.rint_double8",
4978         "math_kernel4.rint_double4",
4979         "math_kernel16.rint_double16",
4980         "math_kernel3.rint_double3",
4981         "math_kernel2.rint_double2",
4982         "math_kernel.rint_double",
4983         "math_kernel16.rootn_double16",
4984         "math_kernel8.rootn_double8",
4985         "math_kernel4.rootn_double4",
4986         "math_kernel3.rootn_double3",
4987         "math_kernel2.rootn_double2",
4988         "math_kernel.rootn_double",
4989         "math_kernel16.round_double16",
4990         "math_kernel8.round_double8",
4991         "math_kernel4.round_double4",
4992         "math_kernel3.round_double3",
4993         "math_kernel2.round_double2",
4994         "math_kernel.round_double",
4995         "math_kernel8.rsqrt_double8",
4996         "math_kernel4.rsqrt_double4",
4997         "math_kernel16.rsqrt_double16",
4998         "math_kernel3.rsqrt_double3",
4999         "math_kernel.rsqrt_double",
5000         "math_kernel2.rsqrt_double2",
5001         "math_kernel8.signbit_double8",
5002         "math_kernel4.signbit_double4",
5003         "math_kernel16.signbit_double16",
5004         "math_kernel2.signbit_double2",
5005         "math_kernel3.signbit_double3",
5006         "math_kernel.signbit_double",
5007         "math_kernel16.sin_double16",
5008         "math_kernel4.sin_double4",
5009         "math_kernel8.sin_double8",
5010         "math_kernel2.sin_double2",
5011         "math_kernel3.sin_double3",
5012         "math_kernel.sin_double",
5013         "math_kernel16.sincos_double16",
5014         "math_kernel8.sincos_double8",
5015         "math_kernel4.sincos_double4",
5016         "math_kernel3.sincos_double3",
5017         "math_kernel2.sincos_double2",
5018         "math_kernel.sincos_double",
5019         "math_kernel16.sinh_double16",
5020         "math_kernel4.sinh_double4",
5021         "math_kernel2.sinh_double2",
5022         "math_kernel8.sinh_double8",
5023         "math_kernel3.sinh_double3",
5024         "math_kernel.sinh_double",
5025         "math_kernel16.sinpi_double16",
5026         "math_kernel8.sinpi_double8",
5027         "math_kernel3.sinpi_double3",
5028         "math_kernel4.sinpi_double4",
5029         "math_kernel2.sinpi_double2",
5030         "math_kernel.sinpi_double",
5031         "math_kernel16.sqrt_double16",
5032         "math_kernel8.sqrt_double8",
5033         "math_kernel4.sqrt_double4",
5034         "math_kernel2.sqrt_double2",
5035         "math_kernel3.sqrt_double3",
5036         "math_kernel.sqrt_double",
5037         "math_kernel8.tan_double8",
5038         "math_kernel16.tan_double16",
5039         "math_kernel.tan_double",
5040         "math_kernel3.tan_double3",
5041         "math_kernel4.tan_double4",
5042         "math_kernel2.tan_double2",
5043         "math_kernel4.tanh_double4",
5044         "math_kernel8.tanh_double8",
5045         "math_kernel2.tanh_double2",
5046         "math_kernel16.tanh_double16",
5047         "math_kernel3.tanh_double3",
5048         "math_kernel.tanh_double",
5049         "math_kernel16.tanpi_double16",
5050         "math_kernel4.tanpi_double4",
5051         "math_kernel8.tanpi_double8",
5052         "math_kernel3.tanpi_double3",
5053         "math_kernel.tanpi_double",
5054         "math_kernel2.tanpi_double2",
5055         "math_kernel16.trunc_double16",
5056         "math_kernel8.trunc_double8",
5057         "math_kernel4.trunc_double4",
5058         "math_kernel3.trunc_double3",
5059         "math_kernel2.trunc_double2",
5060         "math_kernel.trunc_double",
5061     };
5062 
5063     log_info("test_math_brute_force_double\n");
5064     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
5065 }
5066 
5067 
test_printf(cl_device_id device,cl_uint size_t_width,const char * folder)5068 bool test_printf (cl_device_id device, cl_uint size_t_width, const char *folder)
5069 {
5070     static const char* test_name[] = {
5071         "test0.testCaseInt",
5072         "test1.testCaseFloat",
5073         "test5.testCaseChar",
5074         "test6.testCaseString",
5075         "test7.testCaseVector_float",
5076         "test7.testCaseVector_long",
5077         "test7.testCaseVector_uchar",
5078         "test7.testCaseVector_uint",
5079         "test8.testCaseAddrSpace_constant",
5080         "test8.testCaseAddrSpace_global",
5081         "test8.testCaseAddrSpace_local",
5082         "test8.testCaseAddrSpace_private",
5083     };
5084 
5085     log_info("test_printf\n");
5086     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
5087 }
5088 
5089 
test_profiling(cl_device_id device,cl_uint size_t_width,const char * folder)5090 bool test_profiling (cl_device_id device, cl_uint size_t_width, const char *folder)
5091 {
5092     static const char* test_name[] = {
5093         "testReadf",
5094         "image_filter",
5095     };
5096 
5097     log_info("test_profiling\n");
5098     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
5099 }
5100 
5101 
test_relationals(cl_device_id device,cl_uint size_t_width,const char * folder)5102 bool test_relationals (cl_device_id device, cl_uint size_t_width, const char *folder)
5103 {
5104     static const char* test_name[] = {
5105         "sample_test.relational_any_char",
5106         "sample_test.relational_any_char2",
5107         "sample_test.relational_any_char3",
5108         "sample_test.relational_any_char4",
5109         "sample_test.relational_any_char8",
5110         "sample_test.relational_any_char16",
5111         "sample_test.relational_any_short",
5112         "sample_test.relational_any_short2",
5113         "sample_test.relational_any_short3",
5114         "sample_test.relational_any_short4",
5115         "sample_test.relational_any_short8",
5116         "sample_test.relational_any_short16",
5117         "sample_test.relational_any_int",
5118         "sample_test.relational_any_int2",
5119         "sample_test.relational_any_int3",
5120         "sample_test.relational_any_int4",
5121         "sample_test.relational_any_int8",
5122         "sample_test.relational_any_int16",
5123         "sample_test.relational_any_long",
5124         "sample_test.relational_any_long2",
5125         "sample_test.relational_any_long3",
5126         "sample_test.relational_any_long4",
5127         "sample_test.relational_any_long8",
5128         "sample_test.relational_any_long16",
5129         "sample_test.relational_all_char",
5130         "sample_test.relational_all_char2",
5131         "sample_test.relational_all_char3",
5132         "sample_test.relational_all_char4",
5133         "sample_test.relational_all_char8",
5134         "sample_test.relational_all_char16",
5135         "sample_test.relational_all_short",
5136         "sample_test.relational_all_short2",
5137         "sample_test.relational_all_short3",
5138         "sample_test.relational_all_short4",
5139         "sample_test.relational_all_short8",
5140         "sample_test.relational_all_short16",
5141         "sample_test.relational_all_int",
5142         "sample_test.relational_all_int2",
5143         "sample_test.relational_all_int3",
5144         "sample_test.relational_all_int4",
5145         "sample_test.relational_all_int8",
5146         "sample_test.relational_all_int16",
5147         "sample_test.relational_all_long",
5148         "sample_test.relational_all_long2",
5149         "sample_test.relational_all_long3",
5150         "sample_test.relational_all_long4",
5151         "sample_test.relational_all_long8",
5152         "sample_test.relational_all_long16",
5153         "sample_test.relational_bitselect_char",
5154         "sample_test.relational_bitselect_char2",
5155         "sample_test.relational_bitselect_char3",
5156         "sample_test.relational_bitselect_char4",
5157         "sample_test.relational_bitselect_char8",
5158         "sample_test.relational_bitselect_char16",
5159         "sample_test.relational_bitselect_uchar",
5160         "sample_test.relational_bitselect_uchar2",
5161         "sample_test.relational_bitselect_uchar3",
5162         "sample_test.relational_bitselect_uchar4",
5163         "sample_test.relational_bitselect_uchar8",
5164         "sample_test.relational_bitselect_uchar16",
5165         "sample_test.relational_bitselect_short",
5166         "sample_test.relational_bitselect_short2",
5167         "sample_test.relational_bitselect_short3",
5168         "sample_test.relational_bitselect_short4",
5169         "sample_test.relational_bitselect_short8",
5170         "sample_test.relational_bitselect_short16",
5171         "sample_test.relational_bitselect_ushort",
5172         "sample_test.relational_bitselect_ushort2",
5173         "sample_test.relational_bitselect_ushort3",
5174         "sample_test.relational_bitselect_ushort4",
5175         "sample_test.relational_bitselect_ushort8",
5176         "sample_test.relational_bitselect_ushort16",
5177         "sample_test.relational_bitselect_int",
5178         "sample_test.relational_bitselect_int2",
5179         "sample_test.relational_bitselect_int3",
5180         "sample_test.relational_bitselect_int4",
5181         "sample_test.relational_bitselect_int8",
5182         "sample_test.relational_bitselect_int16",
5183         "sample_test.relational_bitselect_uint",
5184         "sample_test.relational_bitselect_uint2",
5185         "sample_test.relational_bitselect_uint3",
5186         "sample_test.relational_bitselect_uint4",
5187         "sample_test.relational_bitselect_uint8",
5188         "sample_test.relational_bitselect_uint16",
5189         "sample_test.relational_bitselect_long",
5190         "sample_test.relational_bitselect_long2",
5191         "sample_test.relational_bitselect_long3",
5192         "sample_test.relational_bitselect_long4",
5193         "sample_test.relational_bitselect_long8",
5194         "sample_test.relational_bitselect_long16",
5195         "sample_test.relational_bitselect_ulong",
5196         "sample_test.relational_bitselect_ulong2",
5197         "sample_test.relational_bitselect_ulong3",
5198         "sample_test.relational_bitselect_ulong4",
5199         "sample_test.relational_bitselect_ulong8",
5200         "sample_test.relational_bitselect_ulong16",
5201         "sample_test.relational_bitselect_float",
5202         "sample_test.relational_bitselect_float2",
5203         "sample_test.relational_bitselect_float3",
5204         "sample_test.relational_bitselect_float4",
5205         "sample_test.relational_bitselect_float8",
5206         "sample_test.relational_bitselect_float16",
5207         "sample_test.relational_select_signed_char",
5208         "sample_test.relational_select_signed_char2",
5209         "sample_test.relational_select_signed_char4",
5210         "sample_test.relational_select_signed_char8",
5211         "sample_test.relational_select_signed_char16",
5212         "sample_test.relational_select_signed_short",
5213         "sample_test.relational_select_signed_short2",
5214         "sample_test.relational_select_signed_short4",
5215         "sample_test.relational_select_signed_short8",
5216         "sample_test.relational_select_signed_short16",
5217         "sample_test.relational_select_signed_int",
5218         "sample_test.relational_select_signed_int2",
5219         "sample_test.relational_select_signed_int4",
5220         "sample_test.relational_select_signed_int8",
5221         "sample_test.relational_select_signed_int16",
5222         "sample_test.relational_select_signed_long",
5223         "sample_test.relational_select_signed_long2",
5224         "sample_test.relational_select_signed_long4",
5225         "sample_test.relational_select_signed_long8",
5226         "sample_test.relational_select_signed_long16",
5227         "sample_test.relational_select_unsigned_uchar",
5228         "sample_test.relational_select_unsigned_uchar2",
5229         "sample_test.relational_select_unsigned_uchar4",
5230         "sample_test.relational_select_unsigned_uchar8",
5231         "sample_test.relational_select_unsigned_uchar16",
5232         "sample_test.relational_select_unsigned_ushort",
5233         "sample_test.relational_select_unsigned_ushort2",
5234         "sample_test.relational_select_unsigned_ushort4",
5235         "sample_test.relational_select_unsigned_ushort8",
5236         "sample_test.relational_select_unsigned_ushort16",
5237         "sample_test.relational_select_unsigned_uint",
5238         "sample_test.relational_select_unsigned_uint2",
5239         "sample_test.relational_select_unsigned_uint4",
5240         "sample_test.relational_select_unsigned_uint8",
5241         "sample_test.relational_select_unsigned_uint16",
5242         "sample_test.relational_select_unsigned_ulong",
5243         "sample_test.relational_select_unsigned_ulong2",
5244         "sample_test.relational_select_unsigned_ulong4",
5245         "sample_test.relational_select_unsigned_ulong8",
5246         "sample_test.relational_select_unsigned_ulong16",
5247         "sample_test.relational_isequal_float",
5248         "sample_test.relational_isequal_float2",
5249         "sample_test.relational_isequal_float3",
5250         "sample_test.relational_isequal_float4",
5251         "sample_test.relational_isequal_float8",
5252         "sample_test.relational_isequal_float16",
5253         "sample_test.relational_isnotequal_float",
5254         "sample_test.relational_isnotequal_float2",
5255         "sample_test.relational_isnotequal_float3",
5256         "sample_test.relational_isnotequal_float4",
5257         "sample_test.relational_isnotequal_float8",
5258         "sample_test.relational_isnotequal_float16",
5259         "sample_test.relational_isgreater_float",
5260         "sample_test.relational_isgreater_float2",
5261         "sample_test.relational_isgreater_float3",
5262         "sample_test.relational_isgreater_float4",
5263         "sample_test.relational_isgreater_float8",
5264         "sample_test.relational_isgreater_float16",
5265         "sample_test.relational_isgreaterequal_float",
5266         "sample_test.relational_isgreaterequal_float2",
5267         "sample_test.relational_isgreaterequal_float3",
5268         "sample_test.relational_isgreaterequal_float4",
5269         "sample_test.relational_isgreaterequal_float8",
5270         "sample_test.relational_isgreaterequal_float16",
5271         "sample_test.relational_isless_float",
5272         "sample_test.relational_isless_float2",
5273         "sample_test.relational_isless_float3",
5274         "sample_test.relational_isless_float4",
5275         "sample_test.relational_isless_float8",
5276         "sample_test.relational_isless_float16",
5277         "sample_test.relational_islessequal_float",
5278         "sample_test.relational_islessequal_float2",
5279         "sample_test.relational_islessequal_float3",
5280         "sample_test.relational_islessequal_float4",
5281         "sample_test.relational_islessequal_float8",
5282         "sample_test.relational_islessequal_float16",
5283         "sample_test.relational_islessgreater_float",
5284         "sample_test.relational_islessgreater_float2",
5285         "sample_test.relational_islessgreater_float3",
5286         "sample_test.relational_islessgreater_float4",
5287         "sample_test.relational_islessgreater_float8",
5288         "sample_test.relational_islessgreater_float16",
5289         "sample_test.shuffle_built_in_char2_char2",
5290         "sample_test.shuffle_built_in_char2_char4",
5291         "sample_test.shuffle_built_in_char2_char8",
5292         "sample_test.shuffle_built_in_char2_char16",
5293         "sample_test.shuffle_built_in_char4_char2",
5294         "sample_test.shuffle_built_in_char4_char4",
5295         "sample_test.shuffle_built_in_char4_char8",
5296         "sample_test.shuffle_built_in_char4_char16",
5297         "sample_test.shuffle_built_in_char8_char2",
5298         "sample_test.shuffle_built_in_char8_char4",
5299         "sample_test.shuffle_built_in_char8_char8",
5300         "sample_test.shuffle_built_in_char8_char16",
5301         "sample_test.shuffle_built_in_char16_char2",
5302         "sample_test.shuffle_built_in_char16_char4",
5303         "sample_test.shuffle_built_in_char16_char8",
5304         "sample_test.shuffle_built_in_char16_char16",
5305         "sample_test.shuffle_built_in_uchar2_uchar2",
5306         "sample_test.shuffle_built_in_uchar2_uchar4",
5307         "sample_test.shuffle_built_in_uchar2_uchar8",
5308         "sample_test.shuffle_built_in_uchar2_uchar16",
5309         "sample_test.shuffle_built_in_uchar4_uchar2",
5310         "sample_test.shuffle_built_in_uchar4_uchar4",
5311         "sample_test.shuffle_built_in_uchar4_uchar8",
5312         "sample_test.shuffle_built_in_uchar4_uchar16",
5313         "sample_test.shuffle_built_in_uchar8_uchar2",
5314         "sample_test.shuffle_built_in_uchar8_uchar4",
5315         "sample_test.shuffle_built_in_uchar8_uchar8",
5316         "sample_test.shuffle_built_in_uchar8_uchar16",
5317         "sample_test.shuffle_built_in_uchar16_uchar2",
5318         "sample_test.shuffle_built_in_uchar16_uchar4",
5319         "sample_test.shuffle_built_in_uchar16_uchar8",
5320         "sample_test.shuffle_built_in_uchar16_uchar16",
5321         "sample_test.shuffle_built_in_short2_short2",
5322         "sample_test.shuffle_built_in_short2_short4",
5323         "sample_test.shuffle_built_in_short2_short8",
5324         "sample_test.shuffle_built_in_short2_short16",
5325         "sample_test.shuffle_built_in_short4_short2",
5326         "sample_test.shuffle_built_in_short4_short4",
5327         "sample_test.shuffle_built_in_short4_short8",
5328         "sample_test.shuffle_built_in_short4_short16",
5329         "sample_test.shuffle_built_in_short8_short2",
5330         "sample_test.shuffle_built_in_short8_short4",
5331         "sample_test.shuffle_built_in_short8_short8",
5332         "sample_test.shuffle_built_in_short8_short16",
5333         "sample_test.shuffle_built_in_short16_short2",
5334         "sample_test.shuffle_built_in_short16_short4",
5335         "sample_test.shuffle_built_in_short16_short8",
5336         "sample_test.shuffle_built_in_short16_short16",
5337         "sample_test.shuffle_built_in_ushort2_ushort2",
5338         "sample_test.shuffle_built_in_ushort2_ushort4",
5339         "sample_test.shuffle_built_in_ushort2_ushort8",
5340         "sample_test.shuffle_built_in_ushort2_ushort16",
5341         "sample_test.shuffle_built_in_ushort4_ushort2",
5342         "sample_test.shuffle_built_in_ushort4_ushort4",
5343         "sample_test.shuffle_built_in_ushort4_ushort8",
5344         "sample_test.shuffle_built_in_ushort4_ushort16",
5345         "sample_test.shuffle_built_in_ushort8_ushort2",
5346         "sample_test.shuffle_built_in_ushort8_ushort4",
5347         "sample_test.shuffle_built_in_ushort8_ushort8",
5348         "sample_test.shuffle_built_in_ushort8_ushort16",
5349         "sample_test.shuffle_built_in_ushort16_ushort2",
5350         "sample_test.shuffle_built_in_ushort16_ushort4",
5351         "sample_test.shuffle_built_in_ushort16_ushort8",
5352         "sample_test.shuffle_built_in_ushort16_ushort16",
5353         "sample_test.shuffle_built_in_int2_int2",
5354         "sample_test.shuffle_built_in_int2_int4",
5355         "sample_test.shuffle_built_in_int2_int8",
5356         "sample_test.shuffle_built_in_int2_int16",
5357         "sample_test.shuffle_built_in_int4_int2",
5358         "sample_test.shuffle_built_in_int4_int4",
5359         "sample_test.shuffle_built_in_int4_int8",
5360         "sample_test.shuffle_built_in_int4_int16",
5361         "sample_test.shuffle_built_in_int8_int2",
5362         "sample_test.shuffle_built_in_int8_int4",
5363         "sample_test.shuffle_built_in_int8_int8",
5364         "sample_test.shuffle_built_in_int8_int16",
5365         "sample_test.shuffle_built_in_int16_int2",
5366         "sample_test.shuffle_built_in_int16_int4",
5367         "sample_test.shuffle_built_in_int16_int8",
5368         "sample_test.shuffle_built_in_int16_int16",
5369         "sample_test.shuffle_built_in_uint2_uint2",
5370         "sample_test.shuffle_built_in_uint2_uint4",
5371         "sample_test.shuffle_built_in_uint2_uint8",
5372         "sample_test.shuffle_built_in_uint2_uint16",
5373         "sample_test.shuffle_built_in_uint4_uint2",
5374         "sample_test.shuffle_built_in_uint4_uint4",
5375         "sample_test.shuffle_built_in_uint4_uint8",
5376         "sample_test.shuffle_built_in_uint4_uint16",
5377         "sample_test.shuffle_built_in_uint8_uint2",
5378         "sample_test.shuffle_built_in_uint8_uint4",
5379         "sample_test.shuffle_built_in_uint8_uint8",
5380         "sample_test.shuffle_built_in_uint8_uint16",
5381         "sample_test.shuffle_built_in_uint16_uint2",
5382         "sample_test.shuffle_built_in_uint16_uint4",
5383         "sample_test.shuffle_built_in_uint16_uint8",
5384         "sample_test.shuffle_built_in_uint16_uint16",
5385         "sample_test.shuffle_built_in_long2_long2",
5386         "sample_test.shuffle_built_in_long2_long4",
5387         "sample_test.shuffle_built_in_long2_long8",
5388         "sample_test.shuffle_built_in_long2_long16",
5389         "sample_test.shuffle_built_in_long4_long2",
5390         "sample_test.shuffle_built_in_long4_long4",
5391         "sample_test.shuffle_built_in_long4_long8",
5392         "sample_test.shuffle_built_in_long4_long16",
5393         "sample_test.shuffle_built_in_long8_long2",
5394         "sample_test.shuffle_built_in_long8_long4",
5395         "sample_test.shuffle_built_in_long8_long8",
5396         "sample_test.shuffle_built_in_long8_long16",
5397         "sample_test.shuffle_built_in_long16_long2",
5398         "sample_test.shuffle_built_in_long16_long4",
5399         "sample_test.shuffle_built_in_long16_long8",
5400         "sample_test.shuffle_built_in_long16_long16",
5401         "sample_test.shuffle_built_in_ulong2_ulong2",
5402         "sample_test.shuffle_built_in_ulong2_ulong4",
5403         "sample_test.shuffle_built_in_ulong2_ulong8",
5404         "sample_test.shuffle_built_in_ulong2_ulong16",
5405         "sample_test.shuffle_built_in_ulong4_ulong2",
5406         "sample_test.shuffle_built_in_ulong4_ulong4",
5407         "sample_test.shuffle_built_in_ulong4_ulong8",
5408         "sample_test.shuffle_built_in_ulong4_ulong16",
5409         "sample_test.shuffle_built_in_ulong8_ulong2",
5410         "sample_test.shuffle_built_in_ulong8_ulong4",
5411         "sample_test.shuffle_built_in_ulong8_ulong8",
5412         "sample_test.shuffle_built_in_ulong8_ulong16",
5413         "sample_test.shuffle_built_in_ulong16_ulong2",
5414         "sample_test.shuffle_built_in_ulong16_ulong4",
5415         "sample_test.shuffle_built_in_ulong16_ulong8",
5416         "sample_test.shuffle_built_in_ulong16_ulong16",
5417         "sample_test.shuffle_built_in_float2_float2",
5418         "sample_test.shuffle_built_in_float2_float4",
5419         "sample_test.shuffle_built_in_float2_float8",
5420         "sample_test.shuffle_built_in_float2_float16",
5421         "sample_test.shuffle_built_in_float4_float2",
5422         "sample_test.shuffle_built_in_float4_float4",
5423         "sample_test.shuffle_built_in_float4_float8",
5424         "sample_test.shuffle_built_in_float4_float16",
5425         "sample_test.shuffle_built_in_float8_float2",
5426         "sample_test.shuffle_built_in_float8_float4",
5427         "sample_test.shuffle_built_in_float8_float8",
5428         "sample_test.shuffle_built_in_float8_float16",
5429         "sample_test.shuffle_built_in_float16_float2",
5430         "sample_test.shuffle_built_in_float16_float4",
5431         "sample_test.shuffle_built_in_float16_float8",
5432         "sample_test.shuffle_built_in_float16_float16",
5433         "sample_test.shuffle_built_in_dual_input_char2_char2",
5434         "sample_test.shuffle_built_in_dual_input_char2_char4",
5435         "sample_test.shuffle_built_in_dual_input_char2_char8",
5436         "sample_test.shuffle_built_in_dual_input_char2_char16",
5437         "sample_test.shuffle_built_in_dual_input_char4_char2",
5438         "sample_test.shuffle_built_in_dual_input_char4_char4",
5439         "sample_test.shuffle_built_in_dual_input_char4_char8",
5440         "sample_test.shuffle_built_in_dual_input_char4_char16",
5441         "sample_test.shuffle_built_in_dual_input_char8_char2",
5442         "sample_test.shuffle_built_in_dual_input_char8_char4",
5443         "sample_test.shuffle_built_in_dual_input_char8_char8",
5444         "sample_test.shuffle_built_in_dual_input_char8_char16",
5445         "sample_test.shuffle_built_in_dual_input_char16_char2",
5446         "sample_test.shuffle_built_in_dual_input_char16_char4",
5447         "sample_test.shuffle_built_in_dual_input_char16_char8",
5448         "sample_test.shuffle_built_in_dual_input_char16_char16",
5449         "sample_test.shuffle_built_in_dual_input_uchar2_uchar2",
5450         "sample_test.shuffle_built_in_dual_input_uchar2_uchar4",
5451         "sample_test.shuffle_built_in_dual_input_uchar2_uchar8",
5452         "sample_test.shuffle_built_in_dual_input_uchar2_uchar16",
5453         "sample_test.shuffle_built_in_dual_input_uchar4_uchar2",
5454         "sample_test.shuffle_built_in_dual_input_uchar4_uchar4",
5455         "sample_test.shuffle_built_in_dual_input_uchar4_uchar8",
5456         "sample_test.shuffle_built_in_dual_input_uchar4_uchar16",
5457         "sample_test.shuffle_built_in_dual_input_uchar8_uchar2",
5458         "sample_test.shuffle_built_in_dual_input_uchar8_uchar4",
5459         "sample_test.shuffle_built_in_dual_input_uchar8_uchar8",
5460         "sample_test.shuffle_built_in_dual_input_uchar8_uchar16",
5461         "sample_test.shuffle_built_in_dual_input_uchar16_uchar2",
5462         "sample_test.shuffle_built_in_dual_input_uchar16_uchar4",
5463         "sample_test.shuffle_built_in_dual_input_uchar16_uchar8",
5464         "sample_test.shuffle_built_in_dual_input_uchar16_uchar16",
5465         "sample_test.shuffle_built_in_dual_input_short2_short2",
5466         "sample_test.shuffle_built_in_dual_input_short2_short4",
5467         "sample_test.shuffle_built_in_dual_input_short2_short8",
5468         "sample_test.shuffle_built_in_dual_input_short2_short16",
5469         "sample_test.shuffle_built_in_dual_input_short4_short2",
5470         "sample_test.shuffle_built_in_dual_input_short4_short4",
5471         "sample_test.shuffle_built_in_dual_input_short4_short8",
5472         "sample_test.shuffle_built_in_dual_input_short4_short16",
5473         "sample_test.shuffle_built_in_dual_input_short8_short2",
5474         "sample_test.shuffle_built_in_dual_input_short8_short4",
5475         "sample_test.shuffle_built_in_dual_input_short8_short8",
5476         "sample_test.shuffle_built_in_dual_input_short8_short16",
5477         "sample_test.shuffle_built_in_dual_input_short16_short2",
5478         "sample_test.shuffle_built_in_dual_input_short16_short4",
5479         "sample_test.shuffle_built_in_dual_input_short16_short8",
5480         "sample_test.shuffle_built_in_dual_input_short16_short16",
5481         "sample_test.shuffle_built_in_dual_input_ushort2_ushort2",
5482         "sample_test.shuffle_built_in_dual_input_ushort2_ushort4",
5483         "sample_test.shuffle_built_in_dual_input_ushort2_ushort8",
5484         "sample_test.shuffle_built_in_dual_input_ushort2_ushort16",
5485         "sample_test.shuffle_built_in_dual_input_ushort4_ushort2",
5486         "sample_test.shuffle_built_in_dual_input_ushort4_ushort4",
5487         "sample_test.shuffle_built_in_dual_input_ushort4_ushort8",
5488         "sample_test.shuffle_built_in_dual_input_ushort4_ushort16",
5489         "sample_test.shuffle_built_in_dual_input_ushort8_ushort2",
5490         "sample_test.shuffle_built_in_dual_input_ushort8_ushort4",
5491         "sample_test.shuffle_built_in_dual_input_ushort8_ushort8",
5492         "sample_test.shuffle_built_in_dual_input_ushort8_ushort16",
5493         "sample_test.shuffle_built_in_dual_input_ushort16_ushort2",
5494         "sample_test.shuffle_built_in_dual_input_ushort16_ushort4",
5495         "sample_test.shuffle_built_in_dual_input_ushort16_ushort8",
5496         "sample_test.shuffle_built_in_dual_input_ushort16_ushort16",
5497         "sample_test.shuffle_built_in_dual_input_int2_int2",
5498         "sample_test.shuffle_built_in_dual_input_int2_int4",
5499         "sample_test.shuffle_built_in_dual_input_int2_int8",
5500         "sample_test.shuffle_built_in_dual_input_int2_int16",
5501         "sample_test.shuffle_built_in_dual_input_int4_int2",
5502         "sample_test.shuffle_built_in_dual_input_int4_int4",
5503         "sample_test.shuffle_built_in_dual_input_int4_int8",
5504         "sample_test.shuffle_built_in_dual_input_int4_int16",
5505         "sample_test.shuffle_built_in_dual_input_int8_int2",
5506         "sample_test.shuffle_built_in_dual_input_int8_int4",
5507         "sample_test.shuffle_built_in_dual_input_int8_int8",
5508         "sample_test.shuffle_built_in_dual_input_int8_int16",
5509         "sample_test.shuffle_built_in_dual_input_int16_int2",
5510         "sample_test.shuffle_built_in_dual_input_int16_int4",
5511         "sample_test.shuffle_built_in_dual_input_int16_int8",
5512         "sample_test.shuffle_built_in_dual_input_int16_int16",
5513         "sample_test.shuffle_built_in_dual_input_uint2_uint2",
5514         "sample_test.shuffle_built_in_dual_input_uint2_uint4",
5515         "sample_test.shuffle_built_in_dual_input_uint2_uint8",
5516         "sample_test.shuffle_built_in_dual_input_uint2_uint16",
5517         "sample_test.shuffle_built_in_dual_input_uint4_uint2",
5518         "sample_test.shuffle_built_in_dual_input_uint4_uint4",
5519         "sample_test.shuffle_built_in_dual_input_uint4_uint8",
5520         "sample_test.shuffle_built_in_dual_input_uint4_uint16",
5521         "sample_test.shuffle_built_in_dual_input_uint8_uint2",
5522         "sample_test.shuffle_built_in_dual_input_uint8_uint4",
5523         "sample_test.shuffle_built_in_dual_input_uint8_uint8",
5524         "sample_test.shuffle_built_in_dual_input_uint8_uint16",
5525         "sample_test.shuffle_built_in_dual_input_uint16_uint2",
5526         "sample_test.shuffle_built_in_dual_input_uint16_uint4",
5527         "sample_test.shuffle_built_in_dual_input_uint16_uint8",
5528         "sample_test.shuffle_built_in_dual_input_uint16_uint16",
5529         "sample_test.shuffle_built_in_dual_input_long2_long2",
5530         "sample_test.shuffle_built_in_dual_input_long2_long4",
5531         "sample_test.shuffle_built_in_dual_input_long2_long8",
5532         "sample_test.shuffle_built_in_dual_input_long2_long16",
5533         "sample_test.shuffle_built_in_dual_input_long4_long2",
5534         "sample_test.shuffle_built_in_dual_input_long4_long4",
5535         "sample_test.shuffle_built_in_dual_input_long4_long8",
5536         "sample_test.shuffle_built_in_dual_input_long4_long16",
5537         "sample_test.shuffle_built_in_dual_input_long8_long2",
5538         "sample_test.shuffle_built_in_dual_input_long8_long4",
5539         "sample_test.shuffle_built_in_dual_input_long8_long8",
5540         "sample_test.shuffle_built_in_dual_input_long8_long16",
5541         "sample_test.shuffle_built_in_dual_input_long16_long2",
5542         "sample_test.shuffle_built_in_dual_input_long16_long4",
5543         "sample_test.shuffle_built_in_dual_input_long16_long8",
5544         "sample_test.shuffle_built_in_dual_input_long16_long16",
5545         "sample_test.shuffle_built_in_dual_input_ulong2_ulong2",
5546         "sample_test.shuffle_built_in_dual_input_ulong2_ulong4",
5547         "sample_test.shuffle_built_in_dual_input_ulong2_ulong8",
5548         "sample_test.shuffle_built_in_dual_input_ulong2_ulong16",
5549         "sample_test.shuffle_built_in_dual_input_ulong4_ulong2",
5550         "sample_test.shuffle_built_in_dual_input_ulong4_ulong4",
5551         "sample_test.shuffle_built_in_dual_input_ulong4_ulong8",
5552         "sample_test.shuffle_built_in_dual_input_ulong4_ulong16",
5553         "sample_test.shuffle_built_in_dual_input_ulong8_ulong2",
5554         "sample_test.shuffle_built_in_dual_input_ulong8_ulong4",
5555         "sample_test.shuffle_built_in_dual_input_ulong8_ulong8",
5556         "sample_test.shuffle_built_in_dual_input_ulong8_ulong16",
5557         "sample_test.shuffle_built_in_dual_input_ulong16_ulong2",
5558         "sample_test.shuffle_built_in_dual_input_ulong16_ulong4",
5559         "sample_test.shuffle_built_in_dual_input_ulong16_ulong8",
5560         "sample_test.shuffle_built_in_dual_input_ulong16_ulong16",
5561         "sample_test.shuffle_built_in_dual_input_float2_float2",
5562         "sample_test.shuffle_built_in_dual_input_float2_float4",
5563         "sample_test.shuffle_built_in_dual_input_float2_float8",
5564         "sample_test.shuffle_built_in_dual_input_float2_float16",
5565         "sample_test.shuffle_built_in_dual_input_float4_float2",
5566         "sample_test.shuffle_built_in_dual_input_float4_float4",
5567         "sample_test.shuffle_built_in_dual_input_float4_float8",
5568         "sample_test.shuffle_built_in_dual_input_float4_float16",
5569         "sample_test.shuffle_built_in_dual_input_float8_float2",
5570         "sample_test.shuffle_built_in_dual_input_float8_float4",
5571         "sample_test.shuffle_built_in_dual_input_float8_float8",
5572         "sample_test.shuffle_built_in_dual_input_float8_float16",
5573         "sample_test.shuffle_built_in_dual_input_float16_float2",
5574         "sample_test.shuffle_built_in_dual_input_float16_float4",
5575         "sample_test.shuffle_built_in_dual_input_float16_float8",
5576         "sample_test.shuffle_built_in_dual_input_float16_float16",
5577     };
5578 
5579     log_info("test_relationals\n");
5580     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
5581 }
5582 
5583 
test_relationals_double(cl_device_id device,cl_uint size_t_width,const char * folder)5584 bool test_relationals_double (cl_device_id device, cl_uint size_t_width, const char *folder)
5585 {
5586     static const char* test_name[] = {
5587         "sample_test.relational_bitselect_double",
5588         "sample_test.relational_bitselect_double2",
5589         "sample_test.relational_bitselect_double3",
5590         "sample_test.relational_bitselect_double4",
5591         "sample_test.relational_bitselect_double8",
5592         "sample_test.relational_bitselect_double16",
5593         "sample_test.relational_isequal_double",
5594         "sample_test.relational_isequal_double2",
5595         "sample_test.relational_isequal_double3",
5596         "sample_test.relational_isequal_double4",
5597         "sample_test.relational_isequal_double8",
5598         "sample_test.relational_isequal_double16",
5599         "sample_test.relational_isnotequal_double",
5600         "sample_test.relational_isnotequal_double2",
5601         "sample_test.relational_isnotequal_double3",
5602         "sample_test.relational_isnotequal_double4",
5603         "sample_test.relational_isnotequal_double8",
5604         "sample_test.relational_isnotequal_double16",
5605         "sample_test.relational_isgreater_double",
5606         "sample_test.relational_isgreater_double2",
5607         "sample_test.relational_isgreater_double3",
5608         "sample_test.relational_isgreater_double4",
5609         "sample_test.relational_isgreater_double8",
5610         "sample_test.relational_isgreater_double16",
5611         "sample_test.relational_isgreaterequal_double",
5612         "sample_test.relational_isgreaterequal_double2",
5613         "sample_test.relational_isgreaterequal_double3",
5614         "sample_test.relational_isgreaterequal_double4",
5615         "sample_test.relational_isgreaterequal_double8",
5616         "sample_test.relational_isgreaterequal_double16",
5617         "sample_test.relational_isless_double",
5618         "sample_test.relational_isless_double2",
5619         "sample_test.relational_isless_double3",
5620         "sample_test.relational_isless_double4",
5621         "sample_test.relational_isless_double8",
5622         "sample_test.relational_isless_double16",
5623         "sample_test.relational_islessequal_double",
5624         "sample_test.relational_islessequal_double2",
5625         "sample_test.relational_islessequal_double3",
5626         "sample_test.relational_islessequal_double4",
5627         "sample_test.relational_islessequal_double8",
5628         "sample_test.relational_islessequal_double16",
5629         "sample_test.relational_islessgreater_double",
5630         "sample_test.relational_islessgreater_double2",
5631         "sample_test.relational_islessgreater_double3",
5632         "sample_test.relational_islessgreater_double4",
5633         "sample_test.relational_islessgreater_double8",
5634         "sample_test.relational_islessgreater_double16",
5635         "sample_test.shuffle_built_in_double2_double2",
5636         "sample_test.shuffle_built_in_double2_double4",
5637         "sample_test.shuffle_built_in_double2_double8",
5638         "sample_test.shuffle_built_in_double2_double16",
5639         "sample_test.shuffle_built_in_double4_double2",
5640         "sample_test.shuffle_built_in_double4_double4",
5641         "sample_test.shuffle_built_in_double4_double8",
5642         "sample_test.shuffle_built_in_double4_double16",
5643         "sample_test.shuffle_built_in_double8_double2",
5644         "sample_test.shuffle_built_in_double8_double4",
5645         "sample_test.shuffle_built_in_double8_double8",
5646         "sample_test.shuffle_built_in_double8_double16",
5647         "sample_test.shuffle_built_in_double16_double2",
5648         "sample_test.shuffle_built_in_double16_double4",
5649         "sample_test.shuffle_built_in_double16_double8",
5650         "sample_test.shuffle_built_in_double16_double16",
5651         "sample_test.shuffle_built_in_dual_input_double2_double2",
5652         "sample_test.shuffle_built_in_dual_input_double2_double4",
5653         "sample_test.shuffle_built_in_dual_input_double2_double8",
5654         "sample_test.shuffle_built_in_dual_input_double2_double16",
5655         "sample_test.shuffle_built_in_dual_input_double4_double2",
5656         "sample_test.shuffle_built_in_dual_input_double4_double4",
5657         "sample_test.shuffle_built_in_dual_input_double4_double8",
5658         "sample_test.shuffle_built_in_dual_input_double4_double16",
5659         "sample_test.shuffle_built_in_dual_input_double8_double2",
5660         "sample_test.shuffle_built_in_dual_input_double8_double4",
5661         "sample_test.shuffle_built_in_dual_input_double8_double8",
5662         "sample_test.shuffle_built_in_dual_input_double8_double16",
5663         "sample_test.shuffle_built_in_dual_input_double16_double2",
5664         "sample_test.shuffle_built_in_dual_input_double16_double4",
5665         "sample_test.shuffle_built_in_dual_input_double16_double8",
5666         "sample_test.shuffle_built_in_dual_input_double16_double16",
5667     };
5668 
5669     log_info("test_relationals_double\n");
5670     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
5671 }
5672 
5673 
test_select(cl_device_id device,cl_uint size_t_width,const char * folder)5674 bool test_select (cl_device_id device, cl_uint size_t_width, const char *folder)
5675 {
5676     static const char* test_name[] = {
5677         "select_uchar_uchar",
5678         "select_uchar2_uchar2",
5679         "select_uchar3_uchar3",
5680         "select_uchar4_uchar4",
5681         "select_uchar8_uchar8",
5682         "select_uchar16_uchar16",
5683         "select_uchar_char",
5684         "select_uchar2_char2",
5685         "select_uchar3_char3",
5686         "select_uchar4_char4",
5687         "select_uchar8_char8",
5688         "select_uchar16_char16",
5689         "select_char_uchar",
5690         "select_char2_uchar2",
5691         "select_char3_uchar3",
5692         "select_char4_uchar4",
5693         "select_char8_uchar8",
5694         "select_char16_uchar16",
5695         "select_char_char",
5696         "select_char2_char2",
5697         "select_char3_char3",
5698         "select_char4_char4",
5699         "select_char8_char8",
5700         "select_char16_char16",
5701         "select_ushort_ushort",
5702         "select_ushort2_ushort2",
5703         "select_ushort3_ushort3",
5704         "select_ushort4_ushort4",
5705         "select_ushort8_ushort8",
5706         "select_ushort16_ushort16",
5707         "select_ushort_short",
5708         "select_ushort2_short2",
5709         "select_ushort3_short3",
5710         "select_ushort4_short4",
5711         "select_ushort8_short8",
5712         "select_ushort16_short16",
5713         "select_short_ushort",
5714         "select_short2_ushort2",
5715         "select_short3_ushort3",
5716         "select_short4_ushort4",
5717         "select_short8_ushort8",
5718         "select_short16_ushort16",
5719         "select_short_short",
5720         "select_short2_short2",
5721         "select_short3_short3",
5722         "select_short4_short4",
5723         "select_short8_short8",
5724         "select_short16_short16",
5725         "select_uint_uint",
5726         "select_uint2_uint2",
5727         "select_uint3_uint3",
5728         "select_uint4_uint4",
5729         "select_uint8_uint8",
5730         "select_uint16_uint16",
5731         "select_uint_int",
5732         "select_uint2_int2",
5733         "select_uint3_int3",
5734         "select_uint4_int4",
5735         "select_uint8_int8",
5736         "select_uint16_int16",
5737         "select_int_uint",
5738         "select_int2_uint2",
5739         "select_int3_uint3",
5740         "select_int4_uint4",
5741         "select_int8_uint8",
5742         "select_int16_uint16",
5743         "select_int_int",
5744         "select_int2_int2",
5745         "select_int3_int3",
5746         "select_int4_int4",
5747         "select_int8_int8",
5748         "select_int16_int16",
5749         "select_float_uint",
5750         "select_float2_uint2",
5751         "select_float3_uint3",
5752         "select_float4_uint4",
5753         "select_float8_uint8",
5754         "select_float16_uint16",
5755         "select_float_int",
5756         "select_float2_int2",
5757         "select_float3_int3",
5758         "select_float4_int4",
5759         "select_float8_int8",
5760         "select_float16_int16",
5761         "select_ulong_ulong",
5762         "select_ulong2_ulong2",
5763         "select_ulong3_ulong3",
5764         "select_ulong4_ulong4",
5765         "select_ulong8_ulong8",
5766         "select_ulong16_ulong16",
5767         "select_ulong_long",
5768         "select_ulong2_long2",
5769         "select_ulong3_long3",
5770         "select_ulong4_long4",
5771         "select_ulong8_long8",
5772         "select_ulong16_long16",
5773         "select_long_ulong",
5774         "select_long2_ulong2",
5775         "select_long3_ulong3",
5776         "select_long4_ulong4",
5777         "select_long8_ulong8",
5778         "select_long16_ulong16",
5779         "select_long_long",
5780         "select_long2_long2",
5781         "select_long3_long3",
5782         "select_long4_long4",
5783         "select_long8_long8",
5784         "select_long16_long16",
5785     };
5786 
5787     log_info("test_select\n");
5788     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
5789 }
5790 
5791 
test_select_double(cl_device_id device,cl_uint size_t_width,const char * folder)5792 bool test_select_double (cl_device_id device, cl_uint size_t_width, const char *folder)
5793 {
5794     static const char* test_name[] = {
5795         "select_double_ulong",
5796         "select_double2_ulong2",
5797         "select_double3_ulong3",
5798         "select_double4_ulong4",
5799         "select_double8_ulong8",
5800         "select_double16_ulong16",
5801         "select_double_long",
5802         "select_double2_long2",
5803         "select_double3_long3",
5804         "select_double4_long4",
5805         "select_double8_long8",
5806         "select_double16_long16",
5807     };
5808 
5809     log_info("test_select_double\n");
5810     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
5811 }
5812 
test_vec_align(cl_device_id device,cl_uint size_t_width,const char * folder)5813 bool test_vec_align (cl_device_id device, cl_uint size_t_width, const char *folder)
5814 {
5815     static const char* test_name[] = {
5816         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_char2",
5817         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_char3",
5818         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_char4",
5819         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_char8",
5820         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_char16",
5821         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uchar2",
5822         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uchar3",
5823         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uchar4",
5824         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uchar8",
5825         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uchar16",
5826         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_short2",
5827         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_short3",
5828         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_short4",
5829         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_short8",
5830         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_short16",
5831         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ushort2",
5832         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ushort3",
5833         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ushort4",
5834         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ushort8",
5835         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ushort16",
5836         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_int2",
5837         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_int3",
5838         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_int4",
5839         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_int8",
5840         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_int16",
5841         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uint2",
5842         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uint3",
5843         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uint4",
5844         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uint8",
5845         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uint16",
5846         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_long2",
5847         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_long3",
5848         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_long4",
5849         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_long8",
5850         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_long16",
5851         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ulong2",
5852         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ulong3",
5853         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ulong4",
5854         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ulong8",
5855         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ulong16",
5856         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_float2",
5857         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_float3",
5858         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_float4",
5859         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_float8",
5860         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_float16",
5861         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_char",
5862         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_charp",
5863         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ucharp",
5864         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_shortp",
5865         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ushortp",
5866         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_intp",
5867         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_uintp",
5868         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_longp",
5869         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_ulongp",
5870         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_floatp",
5871     };
5872 
5873     log_info("vec_align\n");
5874     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
5875 }
5876 
5877 
test_vec_align_double(cl_device_id device,cl_uint size_t_width,const char * folder)5878 bool test_vec_align_double (cl_device_id device, cl_uint size_t_width, const char *folder)
5879 {
5880     static const char* test_name[] = {
5881         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_double2",
5882         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_double3",
5883         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_double4",
5884         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_double8",
5885         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_double16",
5886         "test_vec_align_packed_struct_arr.vec_align_packed_struct_arr_doublep",
5887     };
5888 
5889     log_info("vec_align_double\n");
5890     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
5891 }
5892 
5893 
test_vec_step(cl_device_id device,cl_uint size_t_width,const char * folder)5894 bool test_vec_step (cl_device_id device, cl_uint size_t_width, const char *folder)
5895 {
5896     static const char* test_name[] = {
5897         "test_step_var.step_var_char",
5898         "test_step_var.step_var_char2",
5899         "test_step_var.step_var_char3",
5900         "test_step_var.step_var_char4",
5901         "test_step_var.step_var_char8",
5902         "test_step_var.step_var_char16",
5903         "test_step_var.step_var_uchar",
5904         "test_step_var.step_var_uchar2",
5905         "test_step_var.step_var_uchar3",
5906         "test_step_var.step_var_uchar4",
5907         "test_step_var.step_var_uchar8",
5908         "test_step_var.step_var_uchar16",
5909         "test_step_var.step_var_short",
5910         "test_step_var.step_var_short2",
5911         "test_step_var.step_var_short3",
5912         "test_step_var.step_var_short4",
5913         "test_step_var.step_var_short8",
5914         "test_step_var.step_var_short16",
5915         "test_step_var.step_var_ushort",
5916         "test_step_var.step_var_ushort2",
5917         "test_step_var.step_var_ushort3",
5918         "test_step_var.step_var_ushort4",
5919         "test_step_var.step_var_ushort8",
5920         "test_step_var.step_var_ushort16",
5921         "test_step_var.step_var_int",
5922         "test_step_var.step_var_int2",
5923         "test_step_var.step_var_int3",
5924         "test_step_var.step_var_int4",
5925         "test_step_var.step_var_int8",
5926         "test_step_var.step_var_int16",
5927         "test_step_var.step_var_uint",
5928         "test_step_var.step_var_uint2",
5929         "test_step_var.step_var_uint3",
5930         "test_step_var.step_var_uint4",
5931         "test_step_var.step_var_uint8",
5932         "test_step_var.step_var_uint16",
5933         "test_step_var.step_var_long",
5934         "test_step_var.step_var_long2",
5935         "test_step_var.step_var_long3",
5936         "test_step_var.step_var_long4",
5937         "test_step_var.step_var_long8",
5938         "test_step_var.step_var_long16",
5939         "test_step_var.step_var_ulong",
5940         "test_step_var.step_var_ulong2",
5941         "test_step_var.step_var_ulong3",
5942         "test_step_var.step_var_ulong4",
5943         "test_step_var.step_var_ulong8",
5944         "test_step_var.step_var_ulong16",
5945         "test_step_var.step_var_float",
5946         "test_step_var.step_var_float2",
5947         "test_step_var.step_var_float3",
5948         "test_step_var.step_var_float4",
5949         "test_step_var.step_var_float8",
5950         "test_step_var.step_var_float16",
5951     };
5952 
5953     log_info("vec_step\n");
5954     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
5955 }
5956 
test_vec_step_double(cl_device_id device,cl_uint size_t_width,const char * folder)5957 bool test_vec_step_double (cl_device_id device, cl_uint size_t_width, const char *folder)
5958 {
5959     static const char* test_name[] = {
5960         "test_step_var.step_var_double",
5961         "test_step_var.step_var_double2",
5962         "test_step_var.step_var_double3",
5963         "test_step_var.step_var_double4",
5964         "test_step_var.step_var_double8",
5965         "test_step_var.step_var_double16",
5966     };
5967 
5968     log_info("vec_step_double\n");
5969     return test_suite(device, size_t_width, folder, test_name, sizeof(test_name) / sizeof(const char *), "cl_khr_fp64");
5970 }
5971 
5972 template<typename T>
getT(const TestResult & res,unsigned arg,T & out)5973 void getT(const TestResult& res, unsigned arg, T& out)
5974 {
5975     out = *(T*)(res.kernelArgs().getArg(arg)->getBuffer());
5976 }
5977 
5978 class LinkageTestService {
5979     std::vector<const char*> m_moduleNames;
5980     const char* m_kernelName;
5981     int m_expectedResult;
5982     const char *m_name;
5983 
5984 public:
LinkageTestService(const char ** moduleNames,int numModules,const char * kernelName)5985     LinkageTestService(const char **moduleNames, int numModules,
5986                        const char *kernelName) :
5987     m_moduleNames(numModules),
5988     m_kernelName(kernelName),
5989     m_expectedResult(-1),
5990     m_name(NULL) {
5991         std::copy(moduleNames, moduleNames+numModules, m_moduleNames.begin());
5992     }
5993 
setExpectedResult(int expectedRes)5994     void setExpectedResult(int expectedRes) {
5995         m_expectedResult = expectedRes;
5996     }
5997 
compareResult(cl_device_id dev,cl_uint width)5998     bool compareResult(cl_device_id dev, cl_uint width) {
5999         clContextWrapper context;
6000         clCommandQueueWrapper queue;
6001         size_t num_modules = m_moduleNames.size();
6002         std::vector<cl_program> programs(num_modules);
6003         create_context_and_queue(dev, &context, &queue);
6004 
6005         for (size_t i=0; i<num_modules; i++)
6006         {
6007             std::string filepath;
6008             get_bc_file_path("compile_and_link", m_moduleNames[i], filepath, width);
6009             programs[i] = create_program_from_bc(context, filepath);
6010         }
6011         // Linking to the modules together.
6012         LinkTask linkTask(&programs[0], num_modules, context, dev);
6013         if (!linkTask.execute()) {
6014             std::cerr << "Failed due to the following link error: "
6015                       << linkTask.getErrorLog() << std::endl;
6016             return false;
6017         }
6018 
6019         // Running the Kernel.
6020         cl_program exec = linkTask.getExecutable();
6021         clKernelWrapper kernel = create_kernel_helper(exec, m_kernelName);
6022         TestResult res;
6023         WorkSizeInfo ws;
6024         generate_kernel_data(context, kernel, ws, res);
6025         run_kernel(kernel, queue, ws, res);
6026 
6027         // Checking the result.
6028         res.readToHost(queue);
6029         int actual_value;
6030         getT(res, 0, actual_value);
6031         return (m_expectedResult == actual_value);
6032     }
6033 
setName(const char * name)6034     void setName(const char* name)
6035     {
6036         m_name = name;
6037     }
6038 
getName() const6039     const char* getName()const
6040     {
6041         return m_name;
6042     }
6043 };
6044 
test_compile_and_link(cl_device_id device,cl_uint width,const char * folder)6045 bool test_compile_and_link (cl_device_id device, cl_uint width, const char *folder)
6046 {
6047     try_extract(folder);
6048     std::cout << "Running tests:" << std::endl;
6049 
6050     // Each array represents a testcast in compile and link. The first element
6051     // is the name of the 'main' module, as the second is the module being
6052     // linked.
6053     const char* private_files[]  = {"private_link", "private"};
6054     const char* internal_files[] = {"internal_linkage", "internal_linkage.mod"};
6055     const char* external_files[] = {"external_linkage", "external_linkage.mod"};
6056     const char* available_externally_files[] = {"available_externally", "global"};
6057 
6058     std::vector<LinkageTestService*> linkageTests;
6059     linkageTests.push_back(new LinkageTestService(private_files, 2, "k"));
6060     linkageTests.push_back(new LinkageTestService(internal_files, 2, "internal_linkage"));
6061     linkageTests.push_back(new LinkageTestService(external_files, 2, "external_linkage"));
6062     linkageTests.push_back(new LinkageTestService(available_externally_files, 2, "k"));
6063     // Set tests Names.
6064     linkageTests[0]->setName("private_linkage");
6065     linkageTests[1]->setName("internal_linkage");
6066     linkageTests[2]->setName("external_linkage");
6067     linkageTests[3]->setName("available_externally");
6068     // Set expected results.
6069     linkageTests[0]->setExpectedResult(std::string("spir_conformance").size());
6070     linkageTests[1]->setExpectedResult(1);
6071     linkageTests[2]->setExpectedResult(42);
6072     linkageTests[3]->setExpectedResult(42);
6073 
6074     unsigned int tests_passed = 0;
6075     CounterEventHandler SuccE(tests_passed, linkageTests.size());
6076     std::list<std::string> ErrList;
6077 
6078     for (size_t i=0; i<linkageTests.size(); i++)
6079     {
6080         AccumulatorEventHandler FailE(ErrList, linkageTests[i]->getName());
6081         std::cout << linkageTests[i]->getName() << "..." << std::endl;
6082         if(linkageTests[i]->compareResult(device, width))
6083         {
6084             (SuccE)(linkageTests[i]->getName(), "");
6085             std::cout << linkageTests[i]->getName() << " passed." << std::endl;
6086         }
6087         else
6088         {
6089 
6090             (FailE)(linkageTests[i]->getName(), "");
6091             std::cout << linkageTests[i]->getName() << " FAILED" << std::endl;
6092         }
6093     }
6094 
6095     std::cout << std::endl;
6096     std::cout << "PASSED " << tests_passed << " of " << SuccE.TN << " tests.\n" << std::endl;
6097     // Deallocating.
6098     std::for_each(linkageTests.begin(), linkageTests.end(), dealloc<LinkageTestService>);
6099     return tests_passed == SuccE.TN;
6100 }
6101 
test_sampler_enumeration(cl_device_id device,cl_uint width,const char * folder)6102 static bool test_sampler_enumeration(cl_device_id device, cl_uint width, const char *folder)
6103 {
6104   static const char* test_name[] = {
6105       "sampler_NormF_AddrC_FilterL",
6106       "sampler_NormF_AddrC_FilterN",
6107       "sampler_NormF_AddrE_FilterL",
6108       "sampler_NormF_AddrE_FilterN",
6109       // "sampler_NormF_AddrM_FilterL" - Invalid combination
6110       // "sampler_NormF_AddrM_FilterN" - Invalid combination
6111       "sampler_NormF_AddrN_FilterL",
6112       "sampler_NormF_AddrN_FilterN",
6113       // "sampler_NormF_AddrR_FilterL" - Invalid combination
6114       // "sampler_NormF_AddrR_FilterN" - Invalid combination
6115       "sampler_NormT_AddrC_FilterL",
6116       "sampler_NormT_AddrC_FilterN",
6117       "sampler_NormT_AddrE_FilterL",
6118       "sampler_NormT_AddrE_FilterN",
6119       "sampler_NormT_AddrM_FilterL",
6120       "sampler_NormT_AddrM_FilterN",
6121       "sampler_NormT_AddrN_FilterL",
6122       "sampler_NormT_AddrN_FilterN",
6123       "sampler_NormT_AddrR_FilterL",
6124       "sampler_NormT_AddrR_FilterN"
6125   };
6126 
6127   log_info("test_sampler_enum_values\n");
6128   return test_suite(device, width, folder, test_name, sizeof(test_name) / sizeof(const char *), "");
6129 }
6130 
6131 const char* HOSTVAL_SAMPLER    = "hostval_sampler";
6132 const char* HOSTVAL_IMAGE_DESC = "hostval_image_desc";
6133 const char* HOSTVAL_IMAGE_DESC_3D = "hostval_image_desc_3d";
6134 
test_image_enumeration(cl_context context,cl_command_queue queue,cl_program prog,cl_device_id device,CounterEventHandler & SuccE,std::list<std::string> & ErrList)6135 static bool test_image_enumeration(cl_context context, cl_command_queue queue,
6136                                    cl_program prog, cl_device_id device,
6137                                    CounterEventHandler &SuccE, std::list<std::string> &ErrList)
6138 {
6139     // Creating image descriptor value generator.
6140     ImageValuesGenerator imgVals;
6141     bool success = true;
6142 
6143     for(ImageValuesGenerator::iterator it = imgVals.begin(), e = imgVals.end(); it != e; ++it)
6144     {
6145         bool currentSuccess = true;
6146         AccumulatorEventHandler FailE(ErrList, it.toString());
6147 
6148         std::string kernelName(HOSTVAL_IMAGE_DESC);
6149         kernelName.append("_");
6150         kernelName.append(it.getImageTypeName());
6151 
6152         if (it.getImageTypeName() == "image3d")
6153         {
6154             // If the type is a 3D image we continue to the next one
6155             continue;
6156         }
6157 
6158         // Saving the original image generator, for later restoration.
6159         std::string baseGenName = it.getBaseImageGeneratorName();
6160         KernelArgInfo baseInfo;
6161         baseInfo.setTypeName(baseGenName.c_str());
6162         DataGenerator *pDataGen = DataGenerator::getInstance();
6163         KernelArgGenerator* pOrig = pDataGen->getArgGenerator(baseInfo);
6164 
6165         try
6166         {
6167             // Creating the kernel for this specific enumeration.
6168             WorkSizeInfo ws;
6169             clKernelWrapper kernel = create_kernel_helper(prog, kernelName);
6170 
6171             // Acquiring a reference to the image generator we need for this image
6172             // type.
6173             KernelArgInfo typedInfo;
6174             const std::string tyName = it.getImageGeneratorName();
6175             typedInfo.setTypeName(tyName.c_str());
6176             KernelArgGeneratorImage* pImgGen = (KernelArgGeneratorImage*)pDataGen->getArgGenerator(typedInfo);
6177 
6178             // If the channel order is not valid for the current image type, we
6179             // continue to the next one.
6180             if (!pImgGen->isValidChannelOrder(context, it.getOpenCLChannelOrder()))
6181                 continue;
6182 
6183             // Due to unknown number of types at the beggining count them on the fly
6184             SuccE.TN++;
6185 
6186             // Configuring the image generator so it will produce the correct image
6187             // descriptor.
6188             pImgGen->setChannelOrder(it.getOpenCLChannelOrder());
6189             pDataGen->setArgGenerator(baseInfo, pImgGen);
6190 
6191             // Generate the arguments and run the kernel.
6192             TestResult res;
6193             generate_kernel_data(context, kernel, ws, res);
6194             run_kernel(kernel, queue, ws, res);
6195 
6196             // Informing the result.
6197             std::cout << "enum_" << it.toString() << "..." << std::endl;
6198             int actualOrder = 0, actualTy = 0;
6199             getT<int>(res, 1U, actualOrder), getT<int>(res, 2U, actualTy);
6200             if (actualOrder != it.getSPIRChannelOrder())
6201             {
6202                 std::cout << " expected channel order: " << it.getSPIRChannelOrder()
6203                           << " but received " << actualOrder << "." << std::endl;
6204                 success = currentSuccess = false;
6205             }
6206 
6207             if (actualTy != it.getDataType())
6208             {
6209                 std::cout << " expected data type: " << it.getDataType()
6210                           << " but received " << actualTy << "." << std::endl;
6211                 success = currentSuccess = false;
6212             }
6213 
6214             if (currentSuccess)
6215             {
6216                 (SuccE)(it.toString(), kernelName);
6217                 std::cout << "enum_" << it.toString() << " passed." << std::endl;
6218             }
6219             else
6220             {
6221                 (FailE)(it.toString(), kernelName);
6222                 std::cout << "enum_" << it.toString() << " FAILED" << std::endl;
6223             }
6224         } catch (const std::exception &e)
6225         {
6226             (FailE)(it.toString(), kernelName);
6227             print_error(1, e.what());
6228             success = currentSuccess = false;
6229         }
6230 
6231         // Restore the base image generator to its original value.
6232         pDataGen->setArgGenerator(baseInfo, pOrig);
6233     }
6234 
6235     return success;
6236 }
6237 
test_image_enumeration_3d(cl_context context,cl_command_queue queue,cl_program prog,cl_device_id device,CounterEventHandler & SuccE,std::list<std::string> & ErrList)6238 static bool test_image_enumeration_3d(cl_context context, cl_command_queue queue,
6239                                    cl_program prog, cl_device_id device,
6240                                    CounterEventHandler &SuccE, std::list<std::string> &ErrList)
6241 {
6242     // Creating image descriptor value generator.
6243     ImageValuesGenerator imgVals;
6244     bool success = true;
6245 
6246     for(ImageValuesGenerator::iterator it = imgVals.begin(), e = imgVals.end(); it != e; ++it)
6247     {
6248         bool currentSuccess = true;
6249         AccumulatorEventHandler FailE(ErrList, it.toString());
6250 
6251         std::string kernelName(HOSTVAL_IMAGE_DESC);
6252         kernelName.append("_");
6253         kernelName.append(it.getImageTypeName());
6254 
6255         if (it.getImageTypeName() != "image3d")
6256         {
6257             // If the type is not a 3D image we continue to the next one
6258             continue;
6259         }
6260 
6261         // Saving the original image generator, for later restoration.
6262         std::string baseGenName = it.getBaseImageGeneratorName();
6263         KernelArgInfo baseInfo;
6264         baseInfo.setTypeName(baseGenName.c_str());
6265         DataGenerator *pDataGen = DataGenerator::getInstance();
6266         KernelArgGenerator* pOrig = pDataGen->getArgGenerator(baseInfo);
6267 
6268         try
6269         {
6270             // Creating the kernel for this specific enumeration.
6271             WorkSizeInfo ws;
6272             clKernelWrapper kernel = create_kernel_helper(prog, kernelName);
6273 
6274             // Acquiring a reference to the image generator we need for this image
6275             // type.
6276             KernelArgInfo typedInfo;
6277             const std::string tyName = it.getImageGeneratorName();
6278             typedInfo.setTypeName(tyName.c_str());
6279             KernelArgGeneratorImage* pImgGen = (KernelArgGeneratorImage*)pDataGen->getArgGenerator(typedInfo);
6280 
6281             // If the channel order is not valid for the current image type, we
6282             // continue to the next one.
6283             if (!pImgGen->isValidChannelOrder(context, it.getOpenCLChannelOrder()))
6284                 continue;
6285 
6286             // Due to unknown number of types at the beggining count them on the fly
6287             SuccE.TN++;
6288 
6289             // Configuring the image generator so it will produce the correct image
6290             // descriptor.
6291             pImgGen->setChannelOrder(it.getOpenCLChannelOrder());
6292             pDataGen->setArgGenerator(baseInfo, pImgGen);
6293 
6294             // Generate the arguments and run the kernel.
6295             TestResult res;
6296             generate_kernel_data(context, kernel, ws, res);
6297             run_kernel(kernel, queue, ws, res);
6298 
6299             // Informing the result.
6300             std::cout << "enum_" << it.toString() << "..." << std::endl;
6301             int actualOrder = 0, actualTy = 0;
6302             getT<int>(res, 1U, actualOrder), getT<int>(res, 2U, actualTy);
6303             if (actualOrder != it.getSPIRChannelOrder())
6304             {
6305                 std::cout << " expected channel order: " << it.getSPIRChannelOrder()
6306                           << " but received " << actualOrder << "." << std::endl;
6307                 success = currentSuccess = false;
6308             }
6309 
6310             if (actualTy != it.getDataType())
6311             {
6312                 std::cout << " expected data type: " << it.getDataType()
6313                           << " but received " << actualTy << "." << std::endl;
6314                 success = currentSuccess = false;
6315             }
6316 
6317             if (currentSuccess)
6318             {
6319                 (SuccE)(it.toString(), kernelName);
6320                 std::cout << "enum_" << it.toString() << " passed." << std::endl;
6321             }
6322             else
6323             {
6324                 (FailE)(it.toString(), kernelName);
6325                 std::cout << "enum_" << it.toString() << " FAILED" << std::endl;
6326             }
6327         } catch (const std::exception &e)
6328         {
6329             (FailE)(it.toString(), kernelName);
6330             print_error(1, e.what());
6331             success = currentSuccess = false;
6332         }
6333 
6334         // Restore the base image generator to its original value.
6335         pDataGen->setArgGenerator(baseInfo, pOrig);
6336     }
6337 
6338     return success;
6339 }
6340 
test_enum_values(cl_device_id device,cl_uint width,const char * folder)6341 static bool test_enum_values(cl_device_id device, cl_uint width, const char *folder)
6342 {
6343     try_extract(folder);
6344     std::cout << "Running tests:" << std::endl;
6345     bool success = true;
6346     typedef bool (*EnumTest)(cl_context, cl_command_queue, cl_program, cl_device_id, CounterEventHandler &SuccE, std::list<std::string> &ErrList);
6347     EnumTest test_functions[] = { test_image_enumeration, test_image_enumeration_3d };
6348     const char *enum_tests[] = { HOSTVAL_IMAGE_DESC, HOSTVAL_IMAGE_DESC_3D };
6349     const size_t TEST_NUM = sizeof(enum_tests)/sizeof(char*);
6350 
6351     unsigned int tests_passed = 0;
6352     CounterEventHandler SuccE(tests_passed, 0);
6353     std::list<std::string> ErrList;
6354 
6355     // Composing the name of the CSV file.
6356     char* dir = get_exe_dir();
6357     std::string csvName(dir);
6358     csvName.append(dir_sep());
6359     csvName.append("khr.csv");
6360     free(dir);
6361 
6362     // Figure out whether the test can run on the device. If not, we skip it.
6363     const KhrSupport& khrDb = *KhrSupport::get(csvName);
6364 
6365     for (size_t i=0; i<TEST_NUM; i++)
6366     {
6367         const char *cur_test = enum_tests[i];
6368         cl_bool images = khrDb.isImagesRequired(folder, cur_test);
6369         cl_bool images3D = khrDb.isImages3DRequired(folder, cur_test);
6370         if(images == CL_TRUE && checkForImageSupport(device) != 0)
6371         {
6372             std::cout << cur_test << " Skipped. (Cannot run on device due to Images is not supported)." << std::endl;
6373             continue;
6374         }
6375 
6376         if(images3D == CL_TRUE && checkFor3DImageSupport(device) != 0)
6377         {
6378             std::cout << cur_test << " Skipped. (Cannot run on device as 3D images are not supported)." << std::endl;
6379             continue;
6380         }
6381 
6382         std::string bc_file_path;
6383         get_bc_file_path(folder, cur_test, bc_file_path, width);
6384         clContextWrapper context;
6385         clCommandQueueWrapper queue;
6386         create_context_and_queue(device, &context, &queue);
6387         clProgramWrapper bcprog = create_program_from_bc(context, bc_file_path);
6388 
6389         // Build the kernel.
6390         SpirBuildTask build_task(bcprog, device, "-x spir -spir-std=1.2 -cl-kernel-arg-info");
6391         if (!build_task.execute())
6392         {
6393             std::cerr << "Cannot run enum_values suite due to the "
6394                       << "following build error: "
6395                       << build_task.getErrorLog()
6396                       << std::endl;
6397             return false;
6398         }
6399 
6400         success &= test_functions[i](context, queue, bcprog, device, SuccE, ErrList);
6401     }
6402 
6403     std::cout << std::endl;
6404     std::cout << "PASSED " << tests_passed << " of " << SuccE.TN << " tests.\n" << std::endl;
6405 
6406     if (!ErrList.empty())
6407     {
6408         std::cout << "Failed tests:" << std::endl;
6409         std::for_each(ErrList.begin(), ErrList.end(), printError);
6410     }
6411     std::cout << std::endl;
6412     return success;
6413 }
6414 
split(const std::string & s,char delim,std::vector<std::string> & elems)6415 std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems)
6416 {
6417     std::stringstream ss(s);
6418     std::string item;
6419     while (std::getline(ss, item, delim)) {
6420         elems.push_back(item);
6421     }
6422     return elems;
6423 }
6424 
6425 // Temporarily disabled, see GitHub #1284
6426 #if 0
6427 static bool
6428 test_kernel_attributes(cl_device_id device, cl_uint width, const char *folder)
6429 {
6430     try_extract(folder);
6431     std::cout << "Running tests:" << std::endl;
6432     bool success = true;
6433     clContextWrapper context;
6434     std::string bc_file_path;
6435     clCommandQueueWrapper queue;
6436     clKernelWrapper kernel;
6437     char attributes[256] = {0};
6438     size_t i, res_size = 0;
6439 
6440     unsigned int tests_passed = 0;
6441     CounterEventHandler SuccE(tests_passed, 1);
6442     std::list<std::string> ErrList;
6443     std::string test_name("kernel_attributes");
6444 
6445     log_info("kernel_attributes...\n");
6446     AccumulatorEventHandler FailE(ErrList, test_name);
6447 
6448     try
6449     {
6450         create_context_and_queue(device, &context, &queue);
6451         get_bc_file_path(folder, "kernel_attributes", bc_file_path, width);
6452         clProgramWrapper bcprog = create_program_from_bc(context, bc_file_path);
6453 
6454         // Building the program, so we could create the kernel.
6455         SpirBuildTask build_task(bcprog, device, "-x spir -spir-std=1.2 -cl-kernel-arg-info");
6456         if (!build_task.execute())
6457         {
6458             std::cerr << "Cannot run kernel_attributes suite due to the following build error: "
6459                       << build_task.getErrorLog()
6460                       << std::endl;
6461             throw std::exception();
6462         }
6463 
6464         // Querying the kernel for its attributes.
6465         kernel = create_kernel_helper(bcprog, "test");
6466         cl_int err_code = clGetKernelInfo(kernel, CL_KERNEL_ATTRIBUTES, sizeof(attributes), attributes, &res_size);
6467         if (err_code != CL_SUCCESS)
6468         {
6469             std::cerr << "clGetKernelInfo unable retrieve kernel attributes (error code: " << err_code << " )\n";
6470             throw std::exception();
6471         }
6472 
6473         // Building the expected attributes vector.
6474         std::vector<std::string> expected;
6475         expected.push_back(std::string("work_group_size_hint(64,1,1)"));
6476         expected.push_back(std::string("vec_type_hint(float4)"));
6477 
6478         std::vector<std::string> actual;
6479         split(attributes, ' ', actual);
6480 
6481         for(i = 0; i < expected.size(); ++i)
6482         {
6483             if(std::find(actual.begin(), actual.end(), expected[i]) == actual.end())
6484             {
6485                 // Attribute not found
6486                 std::cout << "Extracted from kernel: " << attributes << std::endl;
6487                 std::cerr << "expected " << expected[i] << " attribute not found" << std::endl;
6488                 throw std::exception();
6489             }
6490         }
6491         (SuccE)(test_name, "");
6492         log_info("kernel_attributes passed.\n");
6493     } catch (const std::exception &e)
6494     {
6495         (FailE)(test_name, "");
6496         log_info("kernel_attributes FAILED\n");
6497         success = false;
6498     }
6499 
6500     std::cout << std::endl;
6501     std::cout << "PASSED " << tests_passed << " of " << 1 << " tests.\n" << std::endl;
6502 
6503     if (!ErrList.empty())
6504     {
6505         std::cout << "Failed tests:" << std::endl;
6506         std::for_each(ErrList.begin(), ErrList.end(), printError);
6507     }
6508     std::cout << std::endl;
6509     return success;
6510 }
6511 #endif
6512 
test_binary_type(cl_device_id device,cl_uint width,const char * folder)6513 static bool test_binary_type(cl_device_id device, cl_uint width, const char *folder)
6514 {
6515     std::string bc_file_path;
6516     clContextWrapper context;
6517     clCommandQueueWrapper queue;
6518 
6519     // Extract the suite if needed.
6520     try_extract(folder);
6521     std::cout << "Running tests:" << std::endl;
6522     bool success = true;
6523     unsigned int tests_passed = 0;
6524     CounterEventHandler SuccE(tests_passed, 1);
6525     std::list<std::string> ErrList;
6526     std::string test_name("binary_type");
6527 
6528     log_info("binary_type...\n");
6529     AccumulatorEventHandler FailE(ErrList, test_name);
6530 
6531     try
6532     {
6533         // Creating the program object.
6534         get_bc_file_path(folder, "simple", bc_file_path, width);
6535         create_context_and_queue(device, &context, &queue);
6536         clProgramWrapper clprog = create_program_from_bc(context, bc_file_path);
6537 
6538         // Checking the attribute matches the requierment in Section 9.15.2 of the
6539         // extensions SPEC.
6540         cl_int binary_type = 0;
6541         size_t ret_size = 0;
6542         if (cl_int err_code = clGetProgramBuildInfo(clprog, device, CL_PROGRAM_BINARY_TYPE, sizeof(cl_int), &binary_type, &ret_size))
6543         {
6544             std::cerr << "Cannot run test_binary_type suite due to the "
6545                       << "following build error: "
6546                       << err_code << std::endl;
6547             throw std::exception();
6548         }
6549 
6550         assert(ret_size == sizeof(cl_int) && "Return size doesn't match.");
6551         if (binary_type != CL_PROGRAM_BINARY_TYPE_INTERMEDIATE)
6552         {
6553             std::cerr << "binary type is " << binary_type
6554                       << " as opposed to " << CL_PROGRAM_BINARY_TYPE_INTERMEDIATE
6555                       << " which is the expected value." << std::endl;
6556             throw std::exception();
6557         }
6558         (SuccE)(test_name, "");
6559         log_info("binary_type passed.\n");
6560     } catch (const std::exception &e)
6561     {
6562         (FailE)(test_name, "");
6563         log_info("binary_type FAILED\n");
6564         success = false;
6565     }
6566 
6567 
6568     std::cout << std::endl;
6569     std::cout << "PASSED " << tests_passed << " of " << 1 << " tests.\n" << std::endl;
6570 
6571     if (!ErrList.empty())
6572     {
6573         std::cout << "Failed tests:" << std::endl;
6574         std::for_each(ErrList.begin(), ErrList.end(), printError);
6575     }
6576     std::cout << std::endl;
6577     return success;
6578 }
6579 
6580 struct sub_suite
6581 {
6582     const char *name;
6583     const char *folder;
6584     const testfn test_function;
6585 };
6586 
6587 static const sub_suite spir_suites[] = {
6588     { "api", "api", test_api },
6589     { "api_double", "api", test_api_double },
6590     { "atomics", "atomics", test_atomics },
6591     { "basic", "basic", test_basic },
6592     { "basic_double", "basic", test_basic_double },
6593     { "commonfns", "commonfns", test_commonfns },
6594     { "commonfns_double", "commonfns", test_commonfns_double },
6595     { "conversions", "conversions", test_conversions },
6596     { "conversions_double", "conversions", test_conversions_double },
6597     { "geometrics", "geometrics", test_geometrics },
6598     { "geometrics_double", "geometrics", test_geometrics_double },
6599     { "half", "half", test_half },
6600     { "half_double", "half", test_half_double },
6601     { "kernel_image_methods", "kernel_image_methods",
6602       test_kernel_image_methods },
6603     { "images_kernel_read_write", "images_kernel_read_write",
6604       test_images_kernel_read_write },
6605     { "images_samplerlessRead", "images_samplerlessRead",
6606       test_images_samplerless_read },
6607     { "integer_ops", "integer_ops", test_integer_ops },
6608     { "math_brute_force", "math_brute_force", test_math_brute_force },
6609     { "math_brute_force_double", "math_brute_force",
6610       test_math_brute_force_double },
6611     { "printf", "printf", test_printf },
6612     { "profiling", "profiling", test_profiling },
6613     { "relationals", "relationals", test_relationals },
6614     { "relationals_double", "relationals", test_relationals_double },
6615     { "select", "select", test_select },
6616     { "select_double", "select", test_select_double },
6617     { "vec_align", "vec_align", test_vec_align },
6618     { "vec_align_double", "vec_align", test_vec_align_double },
6619     { "vec_step", "vec_step", test_vec_step },
6620     { "vec_step_double", "vec_step", test_vec_step_double },
6621     { "compile_and_link", "compile_and_link", test_compile_and_link },
6622     { "sampler_enumeration", "sampler_enumeration", test_sampler_enumeration },
6623     { "enum_values", "enum_values", test_enum_values },
6624     // {"kernel_attributes",           "kernel_attributes",
6625     // test_kernel_attributes}, // disabling temporarily, see GitHub #1284
6626     { "binary_type", "binary_type", test_binary_type },
6627 };
6628 
6629 
6630 /**
6631 Utility function using to find a specific sub-suite name in the SPIR tests.
6632 Called in case the user asked for running a specific sub-suite or specific tests.
6633  */
find_suite_name(std::string suite_name)6634 static int find_suite_name (std::string suite_name)
6635 {
6636     for (unsigned int i = 0; i < sizeof(spir_suites) / sizeof(sub_suite); ++i)
6637     {
6638         if (0 == suite_name.compare(spir_suites[i].name))
6639         {
6640             return i;
6641         }
6642     }
6643     return -1;
6644 }
6645 
6646 
6647 /**
6648 Look for the first device from the first platform .
6649  */
get_platform_device(cl_device_type device_type,cl_uint choosen_device_index,cl_uint choosen_platform_index)6650 cl_device_id get_platform_device (cl_device_type device_type, cl_uint choosen_device_index, cl_uint choosen_platform_index)
6651 {
6652     int error = CL_SUCCESS;
6653     cl_uint num_platforms = 0;
6654     cl_platform_id *platforms;
6655     cl_uint num_devices = 0;
6656     cl_device_id *devices = NULL;
6657 
6658     /* Get the platform */
6659     error = clGetPlatformIDs(0, NULL, &num_platforms);
6660     if ( error != CL_SUCCESS )
6661     {
6662         throw std::runtime_error("clGetPlatformIDs failed: " + std::string(IGetErrorString(error)));
6663     }
6664     if ( choosen_platform_index >= num_platforms )
6665     {
6666         throw std::runtime_error("platform index out of range");
6667     }
6668 
6669     platforms = (cl_platform_id *) malloc( num_platforms * sizeof( cl_platform_id ) );
6670     if ( !platforms )
6671     {
6672         throw std::runtime_error("platform malloc failed");
6673     }
6674     BufferOwningPtr<cl_platform_id> platformsBuf(platforms);
6675 
6676     error = clGetPlatformIDs(num_platforms, platforms, NULL);
6677     if ( error != CL_SUCCESS )
6678     {
6679         throw std::runtime_error("clGetPlatformIDs failed: " + std::string(IGetErrorString(error)));
6680     }
6681 
6682     /* Get the number of requested devices */
6683     error = clGetDeviceIDs(platforms[choosen_platform_index],  device_type, 0, NULL, &num_devices );
6684     if ( error != CL_SUCCESS )
6685     {
6686         throw std::runtime_error("clGetDeviceIDs failed: " + std::string(IGetErrorString(error)));
6687     }
6688     if ( choosen_device_index >= num_devices )
6689     {
6690         throw std::runtime_error("device index out of rangen");
6691     }
6692 
6693     devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) );
6694     if ( !devices )
6695     {
6696         throw std::runtime_error("device malloc failed");
6697     }
6698     BufferOwningPtr<cl_device_id> devicesBuf(devices);
6699 
6700     /* Get the requested device */
6701     error = clGetDeviceIDs(platforms[choosen_platform_index],  device_type, num_devices, devices, NULL );
6702     if ( error != CL_SUCCESS )
6703     {
6704         throw std::runtime_error("clGetDeviceIDs failed: " + std::string(IGetErrorString(error)));
6705     }
6706 
6707     return devices[choosen_device_index];
6708 }
6709 
6710 
6711 /**
6712  Parses the command line parameters and set the
6713  appropriate global variables accordingly
6714  The valid options are:
6715     a) none - run all SPIR tests
6716     b) one argument (tests-suite name) - run one SPIR tests-suite
6717     c) two arguments (tests-suite name and test name) - run one SPIR test
6718  */
ParseCommandLine(int argc,const char * argv[],std::string & suite_name,std::string & test_name,cl_device_type * device_type,cl_uint * device_index,cl_uint * platform_index,cl_uint * size_t_width)6719 static int ParseCommandLine (int argc, const char *argv[],
6720     std::string& suite_name, std::string& test_name, cl_device_type *device_type, cl_uint *device_index, cl_uint *platform_index, cl_uint *size_t_width)
6721 {
6722     int based_on_env_var = 0;
6723 
6724     /* Check for environment variable to set device type */
6725     char *env_mode = getenv( "CL_DEVICE_TYPE" );
6726     if( env_mode != NULL )
6727     {
6728         based_on_env_var = 1;
6729         if( strcmp( env_mode, "gpu" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_GPU" ) == 0 )
6730             *device_type = CL_DEVICE_TYPE_GPU;
6731         else if( strcmp( env_mode, "cpu" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_CPU" ) == 0 )
6732             *device_type = CL_DEVICE_TYPE_CPU;
6733         else if( strcmp( env_mode, "accelerator" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
6734             *device_type = CL_DEVICE_TYPE_ACCELERATOR;
6735         else if( strcmp( env_mode, "default" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
6736             *device_type = CL_DEVICE_TYPE_DEFAULT;
6737         else
6738         {
6739             throw Exceptions::CmdLineError( "Unknown CL_DEVICE_TYPE env variable setting\n");
6740         }
6741     }
6742 
6743     env_mode = getenv( "CL_DEVICE_INDEX" );
6744     if( env_mode != NULL )
6745     {
6746         *device_index = atoi(env_mode);
6747     }
6748 
6749     env_mode = getenv( "CL_PLATFORM_INDEX" );
6750     if( env_mode != NULL )
6751     {
6752         *platform_index = atoi(env_mode);
6753     }
6754 
6755         /* Process the command line arguments */
6756 
6757     /* Special case: just list the tests */
6758     if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" )))
6759     {
6760         log_info( "Usage: %s [<suite name>] [pid<num>] [id<num>] [<device type>] [w32] [no-unzip]\n", argv[0] );
6761         log_info( "\t<suite name>\tOne or more of: (default all)\n");
6762         log_info( "\tpid<num>\t\tIndicates platform at index <num> should be used (default 0).\n" );
6763         log_info( "\tid<num>\t\tIndicates device at index <num> should be used (default 0).\n" );
6764         log_info( "\t<device_type>\tcpu|gpu|accelerator|<CL_DEVICE_TYPE_*> (default CL_DEVICE_TYPE_DEFAULT)\n" );
6765         log_info( "\tw32\t\tIndicates device address bits is 32.\n" );
6766         log_info( "\tno-unzip\t\tDo not extract test files from Zip; use existing.\n" );
6767 
6768         for( unsigned int i = 0; i < (sizeof(spir_suites) / sizeof(sub_suite)); i++ )
6769         {
6770             log_info( "\t\t%s\n", spir_suites[i].name );
6771         }
6772         return 0;
6773     }
6774 
6775     /* Do we have a CPU/GPU specification? */
6776     while( argc > 1 )
6777     {
6778         if( strcmp( argv[ argc - 1 ], "gpu" ) == 0 || strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_GPU" ) == 0 )
6779         {
6780             *device_type = CL_DEVICE_TYPE_GPU;
6781             argc--;
6782         }
6783         else if( strcmp( argv[ argc - 1 ], "cpu" ) == 0 || strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_CPU" ) == 0 )
6784         {
6785             *device_type = CL_DEVICE_TYPE_CPU;
6786             argc--;
6787         }
6788         else if( strcmp( argv[ argc - 1 ], "accelerator" ) == 0 || strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 )
6789         {
6790             *device_type = CL_DEVICE_TYPE_ACCELERATOR;
6791             argc--;
6792         }
6793         else if( strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_DEFAULT" ) == 0 )
6794         {
6795             *device_type = CL_DEVICE_TYPE_DEFAULT;
6796             argc--;
6797         }
6798         else if( strcmp( argv[ argc - 1 ], "w32" ) == 0 )
6799         {
6800             *size_t_width = 32;
6801             argc--;
6802         }
6803         else if( strcmp( argv[ argc - 1 ], "no-unzip" ) == 0 )
6804         {
6805             no_unzip = 1;
6806             argc--;
6807         }
6808         else break;
6809     }
6810 
6811     /* Did we choose a specific device index? */
6812     if( argc > 1 )
6813     {
6814         if( strlen( argv[ argc - 1 ] ) >= 3 && argv[ argc - 1 ][0] == 'i' && argv[ argc - 1 ][1] == 'd' )
6815         {
6816             *device_index = atoi( &(argv[ argc - 1 ][2]) );
6817             argc--;
6818         }
6819     }
6820 
6821     /* Did we choose a specific platform index? */
6822     if( argc > 1 )
6823     {
6824         if( strlen( argv[ argc - 1 ] ) >= 3 && argv[ argc - 1 ][0] == 'p' && argv[ argc - 1 ][1] == 'i' && argv[ argc - 1 ][2] == 'd')
6825         {
6826             *platform_index = atoi( &(argv[ argc - 1 ][3]) );
6827             argc--;
6828         }
6829     }
6830 
6831     switch( *device_type )
6832     {
6833         case CL_DEVICE_TYPE_GPU:
6834             log_info( "Requesting GPU device " );
6835             break;
6836         case CL_DEVICE_TYPE_CPU:
6837             log_info( "Requesting CPU device " );
6838             break;
6839         case CL_DEVICE_TYPE_ACCELERATOR:
6840             log_info( "Requesting Accelerator device " );
6841             break;
6842         case CL_DEVICE_TYPE_DEFAULT:
6843             log_info( "Requesting Default device " );
6844             break;
6845         default:
6846             throw Exceptions::CmdLineError( "Requesting unknown device ");
6847             break;
6848     }
6849     log_info( based_on_env_var ? "based on environment variable " : "based on command line " );
6850     log_info( "for platform index %d and device index %d\n", *platform_index, *device_index);
6851 
6852     if (argc > 3)
6853     {
6854         throw Exceptions::CmdLineError("Command line error. Unrecognized token\n");
6855     }
6856     else {
6857         if (argc > 1)
6858         {
6859             suite_name.assign(argv[1]);
6860         }
6861         if (argc == 3)
6862         {
6863             test_name.assign(argv[2]);
6864         }
6865     }
6866 
6867     return 1;
6868 }
6869 
6870 struct WLMsg: EventHandler
6871 {
6872     const char* Msg;
6873 
WLMsgWLMsg6874     WLMsg(const char* M): Msg(M){}
6875 
operator ()WLMsg6876     void operator()(const std::string& T, const std::string& K)
6877     {
6878         std::cout << "Test " << T << " Kernel " << K << "\t" << Msg << std::endl;
6879     }
6880 };
6881 
6882 
main(int argc,const char * argv[])6883 int main (int argc, const char* argv[])
6884 {
6885     std::string test_suite_name;                       // name of the selected tests-suite (NULL for all)
6886     std::string test_file_name;                        // name of the .selected test (NULL for all)
6887     cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;
6888     cl_uint choosen_device_index = 0;
6889     cl_uint choosen_platform_index = 0;
6890     cl_uint size_t_width = 0;                            // device address bits (32 or 64).
6891     cl_int err;
6892     int failed = 0;
6893     size_t ntests = 0;
6894     custom_cout atf_info;
6895     custom_cerr atf_error;
6896     override_buff atf_cout(std::cout, atf_info);
6897     override_buff atf_err(std::cerr, atf_error);
6898 
6899     WLMsg Success("\t\tPassed"), Failure("\t\tFailure");
6900     try
6901     {
6902         if (ParseCommandLine(argc, argv, test_suite_name, test_file_name, &device_type, &choosen_device_index, &choosen_platform_index, &size_t_width) == 0)
6903             return 0;
6904 
6905         cl_device_id device = get_platform_device(device_type, choosen_device_index, choosen_platform_index);
6906         printDeviceHeader(device);
6907 
6908         std::vector<Version> versions;
6909         get_spir_version(device, versions);
6910 
6911         if (!is_extension_available(device, "cl_khr_spir")
6912             || (std::find(versions.begin(), versions.end(), Version{ 1, 2 })
6913                 == versions.end()))
6914         {
6915             log_info("Spir extension version 1.2 is not supported by the device\n");
6916             return 0;
6917         }
6918 
6919         // size_t_width <> 0 - device address bits is forced by command line argument
6920         if ((0 == size_t_width) && ((err = clGetDeviceInfo(device, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), &size_t_width, NULL))))
6921         {
6922             print_error( err, "Unable to obtain device address bits" );
6923             return -1;
6924         }
6925 
6926         if (! test_suite_name.empty())
6927         {
6928             // command line is not empty - do not run all the tests
6929             int tsn = find_suite_name(test_suite_name);
6930             ntests = 1;
6931             if (tsn < 0)
6932             {
6933                 throw Exceptions::CmdLineError("Command line error. Error in SPIR sub-suite name\n");
6934             }
6935             else if (test_file_name.empty())
6936             {
6937                 if (!spir_suites[tsn].test_function(device, size_t_width, spir_suites[tsn].folder))
6938                     failed++;
6939             }
6940             else
6941             {
6942                 OclExtensions devExt = OclExtensions::getDeviceCapabilities(device);
6943                 TestRunner runner(&Success, &Failure, devExt);
6944                 std::string folder = getTestFolder(test_suite_name.c_str());
6945                 try_extract(folder.c_str());
6946                 if (!runner.runBuildTest(device, folder.c_str(), test_file_name.c_str(), size_t_width))
6947                     failed++;
6948             }
6949         }
6950         else
6951         {
6952             // Run all the tests
6953             ntests = (sizeof(spir_suites) / sizeof(spir_suites[0]));
6954             for (unsigned int i = 0; i < ntests; ++i)
6955             {
6956                 if (!spir_suites[i].test_function(device, size_t_width, spir_suites[i].folder))
6957                     failed++;
6958             }
6959         }
6960         if (failed)
6961             std::cout << "FAILED " << failed << " of " << ntests << " test suites.\n" << std::endl;
6962         else
6963             std::cout << "PASSED " << ntests << " of " << ntests << " test suites.\n" << std::endl;
6964         return failed;
6965     }
6966     catch(const Exceptions::CmdLineError& e)
6967     {
6968         print_error(1, e.what());
6969         return 1;
6970     }
6971     catch(const std::runtime_error& e)
6972     {
6973         print_error(2, e.what());
6974         return 2;
6975     }
6976     catch(const std::exception& e)
6977     {
6978         print_error(3, e.what());
6979         return 3;
6980     }
6981 }
6982 
6983