LZScene

Форк
0
/
GLSCLPlatform.pas 
187 строк · 6.1 Кб
1
//
2
// This unit is part of the GLScene Engine https://github.com/glscene
3
//
4
{
5
  Conversion of OpenCL header file: cl_platform.h to Delphi,
6
  from http://www.khronos.org/registry/cl/.
7

8
   History :  
9
   01/11/09 - DanB - Creation
10
   
11
}
12
// *****************************************************************************
13
// * Copyright (c) 2008-2009 The Khronos Group Inc.
14
// *
15
// * Permission is hereby granted, free of charge, to any person obtaining a
16
// * copy of this software and/or associated documentation files (the
17
// * "Materials"), to deal in the Materials without restriction, including
18
// * without limitation the rights to use, copy, modify, merge, publish,
19
// * distribute, sublicense, and/or sell copies of the Materials, and to
20
// * permit persons to whom the Materials are furnished to do so, subject to
21
// * the following conditions:
22
// *
23
// * The above copyright notice and this permission notice shall be included
24
// * in all copies or substantial portions of the Materials.
25
// *
26
// * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27
// * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
// * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29
// * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
30
// * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31
// * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32
// * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
33
// ****************************************************************************/
34

35
unit GLSCLPlatform;
36

37
interface
38

39
{$I GLScene.inc}
40

41
type
42

43
  TSize_T = SizeInt;
44
  Psize_t = PSizeInt;
45
  intptr_t = PtrInt;
46

47
  // Pintptr_t = ^intptr_t;
48

49
  // scalar types
50
  Tcl_char = ShortInt;
51
  Tcl_uchar = Byte;
52
  Tcl_short = SmallInt;
53
  Tcl_ushort = Word;
54
  Tcl_int = LongInt;
55
  Tcl_uint = LongWord;
56
  Tcl_long = Int64;
57
  Tcl_ulong = UInt64;
58

59
  Tcl_half = Word; // hmmm, no half precision floating point in Delphi
60
  Tcl_float = Single;
61
  Tcl_double = Double;
62

63
  Pcl_char = ^Tcl_char;
64
  Pcl_uchar = ^Tcl_uchar;
65
  Pcl_short = ^Tcl_short;
66
  Pcl_ushort = ^Tcl_ushort;
67
  Pcl_int = ^Tcl_int;
68
  Pcl_uint = ^Tcl_uint;
69
  Pcl_long = ^Tcl_long;
70
  Pcl_ulong = ^Tcl_ulong;
71

72
  Pcl_half = ^Tcl_half;
73
  Pcl_float = ^Tcl_float;
74
  Pcl_double = ^Tcl_double;
75

76
  // and a few goodies to go with them
77
const
78

79
  CL_CHAR_BIT = 8;
80
  CL_SCHAR_MAX = 127;
81
  CL_SCHAR_MIN = (-127 - 1);
82
  CL_CHAR_MAX = CL_SCHAR_MAX;
83
  CL_CHAR_MIN = CL_SCHAR_MIN;
84
  CL_UCHAR_MAX = 255;
85
  CL_SHRT_MAX = 32767;
86
  CL_SHRT_MIN = (-32767 - 1);
87
  CL_USHRT_MAX = 65535;
88
  CL_INT_MAX = 2147483647;
89
  CL_INT_MIN = (-2147483647 - 1);
90
  CL_UINT_MAX = $FFFFFFFF;
91
  CL_LONG_MAX = $7FFFFFFFFFFFFFFF;
92
  CL_LONG_MIN = -$7FFFFFFFFFFFFFFF - 1;
93
  CL_ULONG_MAX = $FFFFFFFFFFFFFFFF;
94

95
  CL_FLT_DIG = 6;
96
  CL_FLT_MANT_DIG = 24;
97
  CL_FLT_MAX_10_EXP = +38;
98
  CL_FLT_MAX_EXP = +128;
99
  CL_FLT_MIN_10_EXP = -37;
100
  CL_FLT_MIN_EXP = -125;
101
  CL_FLT_RADIX = 2;
102
  CL_FLT_MAX = 1.7E38; // 0x1.fffffep127f;
103
  CL_FLT_MIN = 1.17E-38; // 0x1.0p-126f;
104
  CL_FLT_EPSILON = 1.0E-7; // 0x1.0p-23f;
105

106
  CL_DBL_DIG = 15;
107
  CL_DBL_MANT_DIG = 53;
108
  CL_DBL_MAX_10_EXP = +308;
109
  CL_DBL_MAX_EXP = +1024;
110
  CL_DBL_MIN_10_EXP = -307;
111
  CL_DBL_MIN_EXP = -1021;
112
  CL_DBL_RADIX = 2;
113
  CL_DBL_MAX = 8.98E307; // 0x1.fffffffffffffp1023;
114
  CL_DBL_MIN = 2.2E-308; // 0x1.0p-1022;
115
  CL_DBL_EPSILON = 2.2E-26; // 0x1.0p-52;
116

117
  /// *
118
  // * Vector types
119
  // *
120
  // *  Note:   OpenCL requires that all types be naturally aligned.
121
  // *          This means that vector types must be naturally aligned.
122
  // *          For example, a vector of four floats must be aligned to
123
  // *          a 16 byte boundary (calculated as 4 * the natural 4-byte
124
  // *          alignment of the float).  The alignment qualifiers here
125
  // *          will only function properly if your compiler supports them
126
  // *          and if you don't actively work to defeat them.  For example,
127
  // *          in order for a cl_float4 to be 16 byte aligned in a struct,
128
  // *          the start of the struct must itself be 16-byte aligned.
129
  // *
130
  // *          Maintaining proper alignment is the user's responsibility.
131
  // */
132

133
type
134
  Tcl_char2 = array [0 .. 1] of Tcl_char;
135
  Tcl_char4 = array [0 .. 3] of Tcl_char;
136
  Tcl_char8 = array [0 .. 7] of Tcl_char;
137
  Tcl_char16 = array [0 .. 15] of Tcl_char;
138

139
  Tcl_uchar2 = array [0 .. 1] of Tcl_uchar;
140
  Tcl_uchar4 = array [0 .. 3] of Tcl_uchar;
141
  Tcl_uchar8 = array [0 .. 7] of Tcl_uchar;
142
  Tcl_uchar16 = array [0 .. 15] of Tcl_uchar;
143

144
  Tcl_short2 = array [0 .. 1] of Tcl_short;
145
  Tcl_short4 = array [0 .. 3] of Tcl_short;
146
  Tcl_short8 = array [0 .. 7] of Tcl_short;
147
  Tcl_short16 = array [0 .. 15] of Tcl_short;
148

149
  Tcl_ushort2 = array [0 .. 1] of Tcl_ushort;
150
  Tcl_ushort4 = array [0 .. 3] of Tcl_ushort;
151
  Tcl_ushort8 = array [0 .. 7] of Tcl_ushort;
152
  Tcl_ushort16 = array [0 .. 15] of Tcl_ushort;
153

154
  Tcl_int2 = array [0 .. 1] of Tcl_int;
155
  Tcl_int4 = array [0 .. 3] of Tcl_int;
156
  Tcl_int8 = array [0 .. 7] of Tcl_int;
157
  Tcl_int16 = array [0 .. 15] of Tcl_int;
158

159
  Tcl_uint2 = array [0 .. 1] of Tcl_uint;
160
  Tcl_uint4 = array [0 .. 3] of Tcl_uint;
161
  Tcl_uint8 = array [0 .. 7] of Tcl_uint;
162
  Tcl_uint16 = array [0 .. 15] of Tcl_uint;
163

164
  Tcl_long2 = array [0 .. 1] of Tcl_long;
165
  Tcl_long4 = array [0 .. 3] of Tcl_long;
166
  Tcl_long8 = array [0 .. 7] of Tcl_long;
167
  Tcl_long16 = array [0 .. 15] of Tcl_long;
168

169
  Tcl_ulong2 = array [0 .. 1] of Tcl_ulong;
170
  Tcl_ulong4 = array [0 .. 3] of Tcl_ulong;
171
  Tcl_ulong8 = array [0 .. 7] of Tcl_ulong;
172
  Tcl_ulong16 = array [0 .. 15] of Tcl_ulong;
173

174
  Tcl_float2 = array [0 .. 1] of Tcl_float;
175
  Tcl_float4 = array [0 .. 3] of Tcl_float;
176
  Tcl_float8 = array [0 .. 7] of Tcl_float;
177
  Tcl_float16 = array [0 .. 15] of Tcl_float;
178

179
  Tcl_double2 = array [0 .. 1] of Tcl_double;
180
  Tcl_double4 = array [0 .. 3] of Tcl_double;
181
  Tcl_double8 = array [0 .. 7] of Tcl_double;
182
  Tcl_double16 = array [0 .. 15] of Tcl_double;
183
  // There are no vector types for half
184

185
implementation
186

187
end.
188

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.