1
- From 1ed55ebdc8181c67b9cf1cfa3a977f069413dd89 Mon Sep 17 00:00:00 2001
1
+ From 9625ef3fea5f587558965a2a40dd51f8fee9eb05 Mon Sep 17 00:00:00 2001
2
2
From: Ilya Mashkov <
[email protected] >
3
3
Date: Thu, 12 Dec 2019 14:33:41 +0300
4
4
Subject: [PATCH] Add support for cl_khr_mipmap_image_writes
5
5
6
+ This is backporting of https://reviews.llvm.org/D71460
7
+
8
+ Signed-off-by: haonanya <
[email protected] >
6
9
---
7
10
clang/include/clang/Basic/OpenCLExtensions.def | 1 +
8
- clang/lib/Headers/opencl-c.h | 22 ++++ ++++++++++--------
11
+ clang/lib/Headers/opencl-c.h | 18 ++++++++++--------
9
12
clang/test/SemaOpenCL/extension-version.cl | 12 ++++++++++++
10
- 3 files changed, 27 insertions(+), 8 deletions(-)
13
+ 3 files changed, 23 insertions(+), 8 deletions(-)
11
14
12
15
diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def
13
- index 5536a6e..5174815 100644
16
+ index 5536a6e8e4df..517481584313 100644
14
17
--- a/clang/include/clang/Basic/OpenCLExtensions.def
15
18
+++ b/clang/include/clang/Basic/OpenCLExtensions.def
16
19
@@ -70,6 +70,7 @@ OPENCLEXT_INTERNAL(cl_khr_spir, 120, ~0U)
@@ -22,20 +25,19 @@ index 5536a6e..5174815 100644
22
25
OPENCLEXT_INTERNAL(cl_khr_subgroups, 200, ~0U)
23
26
OPENCLEXT_INTERNAL(cl_khr_terminate_context, 200, ~0U)
24
27
diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
25
- index 06c5ab6..d3ae0dd 100644
28
+ index 06c5ab6a72f0..1985a361168b 100644
26
29
--- a/clang/lib/Headers/opencl-c.h
27
30
+++ b/clang/lib/Headers/opencl-c.h
28
- @@ -14682,7 +14682,8 @@ void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, flo
31
+ @@ -14682,7 +14682,7 @@ void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, flo
29
32
30
33
// OpenCL Extension v2.0 s9.18 - Mipmaps
31
34
#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
32
35
- #ifdef cl_khr_mipmap_image
33
36
+ #if defined(cl_khr_mipmap_image_writes)
34
- + #pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : begin
35
37
void __ovld write_imagef(write_only image1d_t image, int coord, int lod, float4 color);
36
38
void __ovld write_imagei(write_only image1d_t image, int coord, int lod, int4 color);
37
39
void __ovld write_imageui(write_only image1d_t image, int coord, int lod, uint4 color);
38
- @@ -14699,15 +14700,17 @@ void __ovld write_imagef(write_only image2d_array_t image_array, int4 coord, int
40
+ @@ -14699,15 +14699,16 @@ void __ovld write_imagef(write_only image2d_array_t image_array, int4 coord, int
39
41
void __ovld write_imagei(write_only image2d_array_t image_array, int4 coord, int lod, int4 color);
40
42
void __ovld write_imageui(write_only image2d_array_t image_array, int4 coord, int lod, uint4 color);
41
43
@@ -52,42 +54,40 @@ index 06c5ab6..d3ae0dd 100644
52
54
- #endif //cl_khr_mipmap_image
53
55
+ #endif //cl_khr_3d_image_writes
54
56
+
55
- + #pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : end
56
57
+ #endif //defined(cl_khr_mipmap_image_writes)
57
58
#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
58
59
59
60
// Image write functions for half4 type
60
- @@ -14756,7 +14759,8 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, flo
61
+ @@ -14756,7 +14757,7 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, flo
61
62
#endif //cl_khr_depth_images
62
63
63
64
#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
64
65
- #ifdef cl_khr_mipmap_image
65
66
+ #ifdef cl_khr_mipmap_image_writes
66
- + #pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : begin
67
67
void __ovld write_imagef(read_write image1d_t image, int coord, int lod, float4 color);
68
68
void __ovld write_imagei(read_write image1d_t image, int coord, int lod, int4 color);
69
69
void __ovld write_imageui(read_write image1d_t image, int coord, int lod, uint4 color);
70
- @@ -14780,8 +14784,10 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int
70
+ @@ -14780,8 +14781,9 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int
71
71
void __ovld write_imagef(read_write image3d_t image, int4 coord, int lod, float4 color);
72
72
void __ovld write_imagei(read_write image3d_t image, int4 coord, int lod, int4 color);
73
73
void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4 color);
74
74
- #endif
75
75
- #endif //cl_khr_mipmap_image
76
76
+ #endif //cl_khr_3d_image_writes
77
77
+
78
- + #pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : end
79
78
+ #endif //cl_khr_mipmap_image_writes
80
79
#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
81
80
82
81
// Image write functions for half4 type
83
82
diff --git a/clang/test/SemaOpenCL/extension-version.cl b/clang/test/SemaOpenCL/extension-version.cl
84
- index 19d0884..0e6bbb7 100644
83
+ index 19d088495350..0e6bbb7d3bcd 100644
85
84
--- a/clang/test/SemaOpenCL/extension-version.cl
86
85
+++ b/clang/test/SemaOpenCL/extension-version.cl
87
- @@ -243,6 +243,18 @@
86
+ @@ -242,6 +242,18 @@
87
+ #endif
88
88
#pragma OPENCL EXTENSION cl_khr_mipmap_image : enable
89
89
90
- #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
90
+ + #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
91
91
+ #ifndef cl_khr_mipmap_image_writes
92
92
+ #error "Missing cl_khr_mipmap_image_writes define"
93
93
+ #endif
@@ -99,10 +99,9 @@ index 19d0884..0e6bbb7 100644
99
99
+ #endif
100
100
+ #pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : enable
101
101
+
102
- + #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
102
+ #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
103
103
#ifndef cl_khr_srgb_image_writes
104
104
#error "Missing cl_khr_srgb_image_writes define"
105
- #endif
106
105
- -
107
- 2.7.4
106
+ 2.17.1
108
107
0 commit comments