|
1 |
| -# OpenCL built-in library: type conversion functions |
| 1 | +##===----------------------------------------------------------------------===## |
2 | 2 | #
|
3 |
| -# Copyright (c) 2013 Victor Oliveira <[email protected]> |
4 |
| -# Copyright (c) 2013 Jesse Towner <[email protected]> |
5 |
| -# Copyright (c) 2024 Romaric Jodin <[email protected]> |
| 3 | +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +# See https://llvm.org/LICENSE.txt for license information. |
| 5 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | 6 | #
|
7 |
| -# Permission is hereby granted, free of charge, to any person obtaining a copy |
8 |
| -# of this software and associated documentation files (the "Software"), to deal |
9 |
| -# in the Software without restriction, including without limitation the rights |
10 |
| -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
11 |
| -# copies of the Software, and to permit persons to whom the Software is |
12 |
| -# furnished to do so, subject to the following conditions: |
| 7 | +##===----------------------------------------------------------------------===## |
13 | 8 | #
|
14 |
| -# The above copyright notice and this permission notice shall be included in |
15 |
| -# all copies or substantial portions of the Software. |
16 |
| -# |
17 |
| -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
18 |
| -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
19 |
| -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
20 |
| -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
21 |
| -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
22 |
| -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
23 |
| -# THE SOFTWARE. |
24 |
| - |
25 |
| -# This script generates the file convert_type.cl, which contains all of the |
| 9 | +# This script generates OpenCL type conversion builtins, which are all of the |
26 | 10 | # OpenCL functions in the form:
|
27 | 11 | #
|
28 |
| -# convert_<destTypen><_sat><_roundingMode>(<sourceTypen>) |
| 12 | +# <prefix>convert_<destTypen><_sat><_roundingMode>(<sourceTypen>) |
| 13 | +# |
| 14 | +# The internal "CLC" versions of these builtins, with the <prefix> '__clc_' |
| 15 | +# contain the actual implementations. These are generated by passing the |
| 16 | +# '--clc' flag to the script. |
| 17 | +# |
| 18 | +# The OpenCL builtins, without any prefix, forward on to the CLC versions. |
| 19 | +# |
| 20 | +##===----------------------------------------------------------------------===## |
29 | 21 |
|
30 | 22 | import argparse
|
31 | 23 | from sys import stderr
|
| 24 | +from os import path |
32 | 25 |
|
33 | 26 | parser = argparse.ArgumentParser()
|
34 | 27 | parser.add_argument(
|
@@ -196,34 +189,19 @@ def conditional_guard(src, dst):
|
196 | 189 | )
|
197 | 190 |
|
198 | 191 | print(
|
199 |
| - f"""/* !!!! AUTOGENERATED FILE generated by convert_type.py !!!!! |
200 |
| -
|
201 |
| - DON'T CHANGE THIS FILE. MAKE YOUR CHANGES TO convert_type.py AND RUN: |
202 |
| - $ ./generate-conversion-type-cl.sh |
203 |
| -
|
204 |
| - OpenCL type conversion functions |
205 |
| -
|
206 |
| - Copyright (c) 2013 Victor Oliveira <[email protected]> |
207 |
| - Copyright (c) 2013 Jesse Towner <[email protected]> |
208 |
| -
|
209 |
| - Permission is hereby granted, free of charge, to any person obtaining a copy |
210 |
| - of this software and associated documentation files (the "Software"), to deal |
211 |
| - in the Software without restriction, including without limitation the rights |
212 |
| - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
213 |
| - copies of the Software, and to permit persons to whom the Software is |
214 |
| - furnished to do so, subject to the following conditions: |
215 |
| -
|
216 |
| - The above copyright notice and this permission notice shall be included in |
217 |
| - all copies or substantial portions of the Software. |
218 |
| -
|
219 |
| - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
220 |
| - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
221 |
| - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
222 |
| - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
223 |
| - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
224 |
| - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
225 |
| - THE SOFTWARE. |
226 |
| -*/ |
| 192 | + f"""//===----------------------------------------------------------------------===// |
| 193 | +// |
| 194 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 195 | +// See https://llvm.org/LICENSE.txt for license information. |
| 196 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 197 | +// |
| 198 | +//===----------------------------------------------------------------------===// |
| 199 | +// |
| 200 | +// Automatically generated from {path.basename(__file__)}, do not edit! |
| 201 | +// |
| 202 | +// OpenCL type conversion functions |
| 203 | +// |
| 204 | +//===----------------------------------------------------------------------===// |
227 | 205 |
|
228 | 206 | {nl.join(['#include ' + f for f in includes])}
|
229 | 207 | #include <clc/clc_convert.h>
|
|
0 commit comments