1 | //===-- OpenCLImageTypes.def - Metadata about BuiltinTypes ------*- C++ -*-===// |
2 | // |
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 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // This file extends builtin types database with OpenCL image singleton types. |
9 | // Custom code should define one of those three macros: |
10 | // GENERIC_IMAGE_TYPE(Type, Id) - a generic image with its Id without an |
11 | // access type |
12 | // IMAGE_TYPE(Type, Id, SingletonId, AccessType, CGSuffix) - an image type |
13 | // with given ID, singleton ID access type and a codegen suffix |
14 | // GENERIC_IMAGE_TYPE_EXT(Type, Id, Ext) - a generic image with its Id and |
15 | // required extension without an access type |
16 | |
17 | #ifdef GENERIC_IMAGE_TYPE |
18 | |
19 | #define IMAGE_READ_TYPE(Type, Id, Ext) GENERIC_IMAGE_TYPE(Type, Id) |
20 | #define IMAGE_WRITE_TYPE(Type, Id, Ext) |
21 | #define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) |
22 | |
23 | #elif defined(GENERIC_IMAGE_TYPE_EXT) |
24 | #define IMAGE_READ_TYPE(Type, Id, Ext) GENERIC_IMAGE_TYPE_EXT(Type, Id##ROTy, Ext) |
25 | #define IMAGE_WRITE_TYPE(Type, Id, Ext) GENERIC_IMAGE_TYPE_EXT(Type, Id##WOTy, Ext) |
26 | #define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) GENERIC_IMAGE_TYPE_EXT(Type, Id##RWTy, Ext) |
27 | |
28 | #else |
29 | #ifndef IMAGE_READ_TYPE |
30 | #define IMAGE_READ_TYPE(Type, Id, Ext) \ |
31 | IMAGE_TYPE(Type, Id##RO, Id##ROTy, read_only, ro) |
32 | #endif |
33 | #ifndef IMAGE_WRITE_TYPE |
34 | #define IMAGE_WRITE_TYPE(Type, Id, Ext) \ |
35 | IMAGE_TYPE(Type, Id##WO, Id##WOTy, write_only, wo) |
36 | #endif |
37 | #ifndef IMAGE_READ_WRITE_TYPE |
38 | #define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) \ |
39 | IMAGE_TYPE(Type, Id##RW, Id##RWTy, read_write, rw) |
40 | #endif |
41 | |
42 | #endif |
43 | |
44 | IMAGE_READ_TYPE(image1d, OCLImage1d, "" ) |
45 | IMAGE_READ_TYPE(image1d_array, OCLImage1dArray, "" ) |
46 | IMAGE_READ_TYPE(image1d_buffer, OCLImage1dBuffer, "" ) |
47 | IMAGE_READ_TYPE(image2d, OCLImage2d, "" ) |
48 | IMAGE_READ_TYPE(image2d_array, OCLImage2dArray, "" ) |
49 | IMAGE_READ_TYPE(image2d_depth, OCLImage2dDepth, "" ) |
50 | IMAGE_READ_TYPE(image2d_array_depth, OCLImage2dArrayDepth, "" ) |
51 | IMAGE_READ_TYPE(image2d_msaa, OCLImage2dMSAA, "cl_khr_gl_msaa_sharing" ) |
52 | IMAGE_READ_TYPE(image2d_array_msaa, OCLImage2dArrayMSAA, "cl_khr_gl_msaa_sharing" ) |
53 | IMAGE_READ_TYPE(image2d_msaa_depth, OCLImage2dMSAADepth, "cl_khr_gl_msaa_sharing" ) |
54 | IMAGE_READ_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth, "cl_khr_gl_msaa_sharing" ) |
55 | IMAGE_READ_TYPE(image3d, OCLImage3d, "" ) |
56 | |
57 | IMAGE_WRITE_TYPE(image1d, OCLImage1d, "" ) |
58 | IMAGE_WRITE_TYPE(image1d_array, OCLImage1dArray, "" ) |
59 | IMAGE_WRITE_TYPE(image1d_buffer, OCLImage1dBuffer, "" ) |
60 | IMAGE_WRITE_TYPE(image2d, OCLImage2d, "" ) |
61 | IMAGE_WRITE_TYPE(image2d_array, OCLImage2dArray, "" ) |
62 | IMAGE_WRITE_TYPE(image2d_depth, OCLImage2dDepth, "" ) |
63 | IMAGE_WRITE_TYPE(image2d_array_depth, OCLImage2dArrayDepth, "" ) |
64 | IMAGE_WRITE_TYPE(image2d_msaa, OCLImage2dMSAA, "cl_khr_gl_msaa_sharing" ) |
65 | IMAGE_WRITE_TYPE(image2d_array_msaa, OCLImage2dArrayMSAA, "cl_khr_gl_msaa_sharing" ) |
66 | IMAGE_WRITE_TYPE(image2d_msaa_depth, OCLImage2dMSAADepth, "cl_khr_gl_msaa_sharing" ) |
67 | IMAGE_WRITE_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth, "cl_khr_gl_msaa_sharing" ) |
68 | IMAGE_WRITE_TYPE(image3d, OCLImage3d, "" ) |
69 | |
70 | IMAGE_READ_WRITE_TYPE(image1d, OCLImage1d, "" ) |
71 | IMAGE_READ_WRITE_TYPE(image1d_array, OCLImage1dArray, "" ) |
72 | IMAGE_READ_WRITE_TYPE(image1d_buffer, OCLImage1dBuffer, "" ) |
73 | IMAGE_READ_WRITE_TYPE(image2d, OCLImage2d, "" ) |
74 | IMAGE_READ_WRITE_TYPE(image2d_array, OCLImage2dArray, "" ) |
75 | IMAGE_READ_WRITE_TYPE(image2d_depth, OCLImage2dDepth, "" ) |
76 | IMAGE_READ_WRITE_TYPE(image2d_array_depth, OCLImage2dArrayDepth, "" ) |
77 | IMAGE_READ_WRITE_TYPE(image2d_msaa, OCLImage2dMSAA, "cl_khr_gl_msaa_sharing" ) |
78 | IMAGE_READ_WRITE_TYPE(image2d_array_msaa, OCLImage2dArrayMSAA, "cl_khr_gl_msaa_sharing" ) |
79 | IMAGE_READ_WRITE_TYPE(image2d_msaa_depth, OCLImage2dMSAADepth, "cl_khr_gl_msaa_sharing" ) |
80 | IMAGE_READ_WRITE_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth, "cl_khr_gl_msaa_sharing" ) |
81 | IMAGE_READ_WRITE_TYPE(image3d, OCLImage3d, "" ) |
82 | |
83 | #undef IMAGE_TYPE |
84 | #undef GENERIC_IMAGE_TYPE |
85 | #undef IMAGE_READ_TYPE |
86 | #undef IMAGE_WRITE_TYPE |
87 | #undef IMAGE_READ_WRITE_TYPE |
88 | |