PageRenderTime 79ms CodeModel.GetById 40ms app.highlight 37ms RepoModel.GetById 1ms app.codeStats 0ms

/extra/cuda/types/types.factor

http://github.com/abeaumont/factor
Unknown | 292 lines | 268 code | 24 blank | 0 comment | 0 complexity | 846a87143de4dd0c21036fe66a5e1788 MD5 | raw file
  1! (c)2010 Joe Groff bsd license
  2USING: accessors alien.c-types classes.struct kernel math ;
  3FROM: alien.c-types => float ;
  4IN: cuda.types
  5
  6STRUCT: char1
  7    { x char } ;
  8STRUCT: char2
  9    { x char }
 10    { y char } ;
 11STRUCT: char3
 12    { x char }
 13    { y char }
 14    { z char } ;
 15STRUCT: char4
 16    { x char }
 17    { y char }
 18    { z char }
 19    { w char } ;
 20
 21STRUCT: uchar1
 22    { x uchar } ;
 23STRUCT: uchar2
 24    { x uchar }
 25    { y uchar } ;
 26STRUCT: uchar3
 27    { x uchar }
 28    { y uchar }
 29    { z uchar } ;
 30STRUCT: uchar4
 31    { x uchar }
 32    { y uchar }
 33    { z uchar }
 34    { w uchar } ;
 35
 36STRUCT: short1
 37    { x short } ;
 38STRUCT: short2
 39    { x short }
 40    { y short } ;
 41STRUCT: short3
 42    { x short }
 43    { y short }
 44    { z short } ;
 45STRUCT: short4
 46    { x short }
 47    { y short }
 48    { z short }
 49    { w short } ;
 50
 51STRUCT: ushort1
 52    { x ushort } ;
 53STRUCT: ushort2
 54    { x ushort }
 55    { y ushort } ;
 56STRUCT: ushort3
 57    { x ushort }
 58    { y ushort }
 59    { z ushort } ;
 60STRUCT: ushort4
 61    { x ushort }
 62    { y ushort }
 63    { z ushort }
 64    { w ushort } ;
 65
 66STRUCT: int1
 67    { x int } ;
 68STRUCT: int2
 69    { x int }
 70    { y int } ;
 71STRUCT: int3
 72    { x int }
 73    { y int }
 74    { z int } ;
 75STRUCT: int4
 76    { x int }
 77    { y int }
 78    { z int }
 79    { w int } ;
 80
 81STRUCT: uint1
 82    { x uint } ;
 83STRUCT: uint2
 84    { x uint }
 85    { y uint } ;
 86STRUCT: uint3
 87    { x uint }
 88    { y uint }
 89    { z uint } ;
 90STRUCT: uint4
 91    { x uint }
 92    { y uint }
 93    { z uint }
 94    { w uint } ;
 95
 96STRUCT: long1
 97    { x long } ;
 98STRUCT: long2
 99    { x long }
100    { y long } ;
101STRUCT: long3
102    { x long }
103    { y long }
104    { z long } ;
105STRUCT: long4
106    { x long }
107    { y long }
108    { z long }
109    { w long } ;
110
111STRUCT: ulong1
112    { x ulong } ;
113STRUCT: ulong2
114    { x ulong }
115    { y ulong } ;
116STRUCT: ulong3
117    { x ulong }
118    { y ulong }
119    { z ulong } ;
120STRUCT: ulong4
121    { x ulong }
122    { y ulong }
123    { z ulong }
124    { w ulong } ;
125
126STRUCT: longlong1
127    { x longlong } ;
128STRUCT: longlong2
129    { x longlong }
130    { y longlong } ;
131STRUCT: longlong3
132    { x longlong }
133    { y longlong }
134    { z longlong } ;
135STRUCT: longlong4
136    { x longlong }
137    { y longlong }
138    { z longlong }
139    { w longlong } ;
140
141STRUCT: ulonglong1
142    { x ulonglong } ;
143STRUCT: ulonglong2
144    { x ulonglong }
145    { y ulonglong } ;
146STRUCT: ulonglong3
147    { x ulonglong }
148    { y ulonglong }
149    { z ulonglong } ;
150STRUCT: ulonglong4
151    { x ulonglong }
152    { y ulonglong }
153    { z ulonglong }
154    { w ulonglong } ;
155
156STRUCT: float1
157    { x float } ;
158STRUCT: float2
159    { x float }
160    { y float } ;
161STRUCT: float3
162    { x float }
163    { y float }
164    { z float } ;
165STRUCT: float4
166    { x float }
167    { y float }
168    { z float }
169    { w float } ;
170
171STRUCT: double1
172    { x double } ;
173STRUCT: double2
174    { x double }
175    { y double } ;
176STRUCT: double3
177    { x double }
178    { y double }
179    { z double } ;
180STRUCT: double4
181    { x double }
182    { y double }
183    { z double }
184    { w double } ;
185
186char2 lookup-c-type 
187    2 >>align
188    2 >>align-first
189    drop
190char4 lookup-c-type 
191    4 >>align
192    4 >>align-first
193    drop
194
195uchar2 lookup-c-type 
196    2 >>align
197    2 >>align-first
198    drop
199uchar4 lookup-c-type 
200    4 >>align
201    4 >>align-first
202    drop
203
204short2 lookup-c-type 
205    4 >>align
206    4 >>align-first
207    drop
208short4 lookup-c-type 
209    8 >>align
210    8 >>align-first
211    drop
212
213ushort2 lookup-c-type 
214    4 >>align
215    4 >>align-first
216    drop
217ushort4 lookup-c-type 
218    8 >>align
219    8 >>align-first
220    drop
221
222int2 lookup-c-type 
223    8 >>align
224    8 >>align-first
225    drop
226int4 lookup-c-type 
227    16 >>align
228    16 >>align-first
229    drop
230
231uint2 lookup-c-type 
232    8 >>align
233    8 >>align-first
234    drop
235uint4 lookup-c-type 
236    16 >>align
237    16 >>align-first
238    drop
239
240long2 lookup-c-type 
241    long heap-size 2 * >>align
242    long heap-size 2 * >>align-first
243    drop
244long4 lookup-c-type 
245    16 >>align
246    16 >>align-first
247    drop
248
249ulong2 lookup-c-type 
250    long heap-size 2 * >>align
251    long heap-size 2 * >>align-first
252    drop
253ulong4 lookup-c-type 
254    16 >>align
255    16 >>align-first
256    drop
257
258longlong2 lookup-c-type 
259    16 >>align
260    16 >>align-first
261    drop
262longlong4 lookup-c-type 
263    16 >>align
264    16 >>align-first
265    drop
266
267ulonglong2 lookup-c-type 
268    16 >>align
269    16 >>align-first
270    drop
271ulonglong4 lookup-c-type 
272    16 >>align
273    16 >>align-first
274    drop
275
276float2 lookup-c-type 
277    8 >>align
278    8 >>align-first
279    drop
280float4 lookup-c-type 
281    16 >>align
282    16 >>align-first
283    drop
284
285double2 lookup-c-type 
286    16 >>align
287    16 >>align-first
288    drop
289double4 lookup-c-type 
290    16 >>align
291    16 >>align-first
292    drop