"Fossies" - the Fresh Open Source Software Archive

Member "pocl-1.8/lib/kernel/all.cl" (12 Oct 2021, 2875 Bytes) of package /linux/misc/pocl-1.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 /* OpenCL built-in library: all()
    2 
    3    Copyright (c) 2011 Universidad Rey Juan Carlos
    4    
    5    Permission is hereby granted, free of charge, to any person obtaining a copy
    6    of this software and associated documentation files (the "Software"), to deal
    7    in the Software without restriction, including without limitation the rights
    8    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    9    copies of the Software, and to permit persons to whom the Software is
   10    furnished to do so, subject to the following conditions:
   11    
   12    The above copyright notice and this permission notice shall be included in
   13    all copies or substantial portions of the Software.
   14    
   15    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   16    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   17    FITNESS FOR A PARTICULAR PURPOSE AND NONORDEREDRINGEMENT. IN NO EVENT SHALL THE
   18    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   19    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   20    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   21    THE SOFTWARE.
   22 */
   23 
   24 int _CL_OVERLOADABLE all(char a)
   25 {
   26   return a < (char)0;
   27 }
   28 
   29 int _CL_OVERLOADABLE all(char2 a)
   30 {
   31   return all(a.lo) && all(a.hi);
   32 }
   33 
   34 int _CL_OVERLOADABLE all(char3 a)
   35 {
   36   return all(a.s01) && all(a.s2);
   37 }
   38 
   39 int _CL_OVERLOADABLE all(char4 a)
   40 {
   41   return all(a.lo) && all(a.hi);
   42 }
   43 
   44 int _CL_OVERLOADABLE all(char8 a)
   45 {
   46   return all(a.lo) && all(a.hi);
   47 }
   48 
   49 int _CL_OVERLOADABLE all(char16 a)
   50 {
   51   return all(a.lo) && all(a.hi);
   52 }
   53 
   54 int _CL_OVERLOADABLE all(short a)
   55 {
   56   return a < (short)0;
   57 }
   58 
   59 int _CL_OVERLOADABLE all(short2 a)
   60 {
   61   return all(a.lo) && all(a.hi);
   62 }
   63 
   64 int _CL_OVERLOADABLE all(short3 a)
   65 {
   66   return all(a.s01) && all(a.s2);
   67 }
   68 
   69 int _CL_OVERLOADABLE all(short4 a)
   70 {
   71   return all(a.lo) && all(a.hi);
   72 }
   73 
   74 int _CL_OVERLOADABLE all(short8 a)
   75 {
   76   return all(a.lo) && all(a.hi);
   77 }
   78 
   79 int _CL_OVERLOADABLE all(short16 a)
   80 {
   81   return all(a.lo) && all(a.hi);
   82 }
   83 
   84 int _CL_OVERLOADABLE all(int a)
   85 {
   86   return a < 0;
   87 }
   88 
   89 int _CL_OVERLOADABLE all(int2 a)
   90 {
   91   return all(a.lo) && all(a.hi);
   92 }
   93 
   94 int _CL_OVERLOADABLE all(int3 a)
   95 {
   96   return all(a.s01) && all(a.s2);
   97 }
   98 
   99 int _CL_OVERLOADABLE all(int4 a)
  100 {
  101   return all(a.lo) && all(a.hi);
  102 }
  103 
  104 int _CL_OVERLOADABLE all(int8 a)
  105 {
  106   return all(a.lo) && all(a.hi);
  107 }
  108 
  109 int _CL_OVERLOADABLE all(int16 a)
  110 {
  111   return all(a.lo) && all(a.hi);
  112 }
  113 
  114 #ifdef cl_khr_int64
  115 int _CL_OVERLOADABLE all(long a)
  116 {
  117   return a < 0L;
  118 }
  119 
  120 int _CL_OVERLOADABLE all(long2 a)
  121 {
  122   return all(a.lo) && all(a.hi);
  123 }
  124 
  125 int _CL_OVERLOADABLE all(long3 a)
  126 {
  127   return all(a.s01) && all(a.s2);
  128 }
  129 
  130 int _CL_OVERLOADABLE all(long4 a)
  131 {
  132   return all(a.lo) && all(a.hi);
  133 }
  134 
  135 int _CL_OVERLOADABLE all(long8 a)
  136 {
  137   return all(a.lo) && all(a.hi);
  138 }
  139 
  140 int _CL_OVERLOADABLE all(long16 a)
  141 {
  142   return all(a.lo) && all(a.hi);
  143 }
  144 #endif