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