Mercurial > projects > cl4d
comparison opencl/c/platform.d @ 0:3cea44337083
initial commit
author | Trass3r |
---|---|
date | Wed, 02 Dec 2009 17:40:59 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3cea44337083 |
---|---|
1 /********************************************************************************** | |
2 * Copyright (c) 2008-2009 The Khronos Group Inc. | |
3 * | |
4 * Permission is hereby granted, free of charge, to any person obtaining a | |
5 * copy of this software and/or associated documentation files (the | |
6 * "Materials"), to deal in the Materials without restriction, including | |
7 * without limitation the rights to use, copy, modify, merge, publish, | |
8 * distribute, sublicense, and/or sell copies of the Materials, and to | |
9 * permit persons to whom the Materials are furnished to do so, subject to | |
10 * the following conditions: | |
11 * | |
12 * The above copyright notice and this permission notice shall be included | |
13 * in all copies or substantial portions of the Materials. | |
14 * | |
15 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | |
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
21 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. | |
22 **********************************************************************************/ | |
23 | |
24 // $Revision: 9283 $ on $Date: 2009-10-14 10:18:57 -0700 (Wed, 14 Oct 2009) $ | |
25 | |
26 module opencl.c.platform; | |
27 | |
28 /* scalar types */ | |
29 alias byte cl_char; | |
30 alias ubyte cl_uchar; | |
31 alias short cl_short; | |
32 alias ushort cl_ushort; | |
33 alias int cl_int; | |
34 alias uint cl_uint; | |
35 alias long cl_long; | |
36 alias ulong cl_ulong; | |
37 | |
38 alias ushort cl_half; | |
39 alias float cl_float; | |
40 alias double cl_double; | |
41 | |
42 /* | |
43 * Vector types | |
44 * | |
45 * Note: OpenCL requires that all types be naturally aligned. | |
46 * This means that vector types must be naturally aligned. | |
47 * For example, a vector of four floats must be aligned to | |
48 * a 16 byte boundary (calculated as 4 * the natural 4-byte | |
49 * alignment of the float). The alignment qualifiers here | |
50 * will only function properly if your compiler supports them | |
51 * and if you don't actively work to defeat them. For example, | |
52 * in order for a cl_float4 to be 16 byte aligned in a struct, | |
53 * the start of the struct must itself be 16-byte aligned. | |
54 * | |
55 * Maintaining proper alignment is the user's responsibility. | |
56 */ | |
57 | |
58 alias byte[2] cl_char2; | |
59 alias byte[4] cl_char4; | |
60 alias byte[8] cl_char8; | |
61 alias byte[16] cl_char16; | |
62 alias ubyte[2] cl_uchar2; | |
63 alias ubyte[4] cl_uchar4; | |
64 alias ubyte[8] cl_uchar8; | |
65 alias ubyte[16] cl_uchar16; | |
66 | |
67 alias short[2] cl_short2; | |
68 alias short[4] cl_short4; | |
69 alias short[8] cl_short8; | |
70 alias short[16] cl_short16; | |
71 alias ushort[2] cl_ushort2; | |
72 alias ushort[4] cl_ushort4; | |
73 alias ushort[8] cl_ushort8; | |
74 alias ushort[16] cl_ushort16; | |
75 | |
76 alias int[2] cl_int2; | |
77 alias int[4] cl_int4; | |
78 alias int[8] cl_int8; | |
79 alias int[16] cl_int16; | |
80 alias uint[2] cl_uint2; | |
81 alias uint[4] cl_uint4; | |
82 alias uint[8] cl_uint8; | |
83 alias uint[16] cl_uint16; | |
84 | |
85 alias long[2] cl_long2; | |
86 alias long[4] cl_long4; | |
87 alias long[8] cl_long8; | |
88 alias long[16] cl_long16; | |
89 alias ulong[2] cl_ulong2; | |
90 alias ulong[4] cl_ulong4; | |
91 alias ulong[8] cl_ulong8; | |
92 alias ulong[16] cl_ulong16; | |
93 | |
94 alias float[2] cl_float2; | |
95 alias float[4] cl_float4; | |
96 alias float[8] cl_float8; | |
97 alias float[16] cl_float16; | |
98 | |
99 alias double[2] cl_double2; | |
100 alias double[4] cl_double4; | |
101 alias double[8] cl_double8; | |
102 alias double[16] cl_double16; | |
103 | |
104 /* There are no vector types for half */ | |
105 | |
106 enum | |
107 { | |
108 CL_CHAR_BIT = 8, | |
109 CL_SCHAR_MAX = 127, | |
110 CL_SCHAR_MIN = (-127-1), | |
111 CL_CHAR_MAX = CL_SCHAR_MAX, | |
112 CL_CHAR_MIN = CL_SCHAR_MIN, | |
113 CL_UCHAR_MAX = 255, | |
114 CL_SHRT_MAX = 32767, | |
115 CL_SHRT_MIN = (-32767-1), | |
116 CL_USHRT_MAX = 65535, | |
117 CL_INT_MAX = 2147483647, | |
118 CL_INT_MIN = (-2147483647-1), | |
119 CL_UINT_MAX = 0xffffffffU, | |
120 CL_LONG_MAX = 0x7FFFFFFFFFFFFFFFL, | |
121 CL_LONG_MIN = -0x7FFFFFFFFFFFFFFFL - 1L, | |
122 CL_ULONG_MAX = 0xFFFFFFFFFFFFFFFFUL, | |
123 | |
124 CL_FLT_DIG = 6, | |
125 CL_FLT_MANT_DIG = 24, | |
126 CL_FLT_MAX_10_EXP = +38, | |
127 CL_FLT_MAX_EXP = +128, | |
128 CL_FLT_MIN_10_EXP = -37, | |
129 CL_FLT_MIN_EXP = -125, | |
130 CL_FLT_RADIX = 2, | |
131 CL_FLT_MAX = 0x1.fffffep127f, | |
132 CL_FLT_MIN = 0x1.0p-126f, | |
133 CL_FLT_EPSILON = 0x1.0p-23f, | |
134 | |
135 CL_DBL_DIG = 15, | |
136 CL_DBL_MANT_DIG = 53, | |
137 CL_DBL_MAX_10_EXP = +308, | |
138 CL_DBL_MAX_EXP = +1024, | |
139 CL_DBL_MIN_10_EXP = -307, | |
140 CL_DBL_MIN_EXP = -1021, | |
141 CL_DBL_RADIX = 2, | |
142 CL_DBL_MAX = 0x1.fffffffffffffp1023, | |
143 CL_DBL_MIN = 0x1.0p-1022, | |
144 CL_DBL_EPSILON = 0x1.0p-52 | |
145 } |