diff options
Diffstat (limited to 'recipes-devtools/clang/clang/0026-OpenCL-Fix-support-for-cl_khr_mipmap_image_writes.patch')
-rw-r--r-- | recipes-devtools/clang/clang/0026-OpenCL-Fix-support-for-cl_khr_mipmap_image_writes.patch | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0026-OpenCL-Fix-support-for-cl_khr_mipmap_image_writes.patch b/recipes-devtools/clang/clang/0026-OpenCL-Fix-support-for-cl_khr_mipmap_image_writes.patch new file mode 100644 index 0000000..a8798fb --- /dev/null +++ b/recipes-devtools/clang/clang/0026-OpenCL-Fix-support-for-cl_khr_mipmap_image_writes.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From 4770490fa38a03624376b3c3973705a4bf8cc193 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexey Sotkin <alexey.sotkin@intel.com> | ||
3 | Date: Mon, 27 Jan 2020 12:25:03 +0300 | ||
4 | Subject: [PATCH] [OpenCL] Fix support for cl_khr_mipmap_image_writes | ||
5 | |||
6 | Text of the extension is available here: | ||
7 | https://github.com/KhronosGroup/OpenCL-Docs/blob/master/ext/cl_khr_mipmap_image.asciidoc | ||
8 | |||
9 | Patch by Ilya Mashkov | ||
10 | |||
11 | Differential Revision: https://reviews.llvm.org/D71460 | ||
12 | |||
13 | Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/f780e15caf1bed0a9fbc87fde70bd5ab3d80a439] | ||
14 | |||
15 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
16 | --- | ||
17 | clang/include/clang/Basic/OpenCLExtensions.def | 1 + | ||
18 | clang/lib/Headers/opencl-c.h | 18 ++++++++++-------- | ||
19 | clang/test/SemaOpenCL/extension-version.cl | 12 ++++++++++++ | ||
20 | 3 files changed, 23 insertions(+), 8 deletions(-) | ||
21 | |||
22 | diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def | ||
23 | index 5536a6e8e4d..51748158431 100644 | ||
24 | --- a/clang/include/clang/Basic/OpenCLExtensions.def | ||
25 | +++ b/clang/include/clang/Basic/OpenCLExtensions.def | ||
26 | @@ -70,6 +70,7 @@ OPENCLEXT_INTERNAL(cl_khr_spir, 120, ~0U) | ||
27 | OPENCLEXT_INTERNAL(cl_khr_egl_event, 200, ~0U) | ||
28 | OPENCLEXT_INTERNAL(cl_khr_egl_image, 200, ~0U) | ||
29 | OPENCLEXT_INTERNAL(cl_khr_mipmap_image, 200, ~0U) | ||
30 | +OPENCLEXT_INTERNAL(cl_khr_mipmap_image_writes, 200, ~0U) | ||
31 | OPENCLEXT_INTERNAL(cl_khr_srgb_image_writes, 200, ~0U) | ||
32 | OPENCLEXT_INTERNAL(cl_khr_subgroups, 200, ~0U) | ||
33 | OPENCLEXT_INTERNAL(cl_khr_terminate_context, 200, ~0U) | ||
34 | diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h | ||
35 | index 06c5ab6a72f..3210f93cc85 100644 | ||
36 | --- a/clang/lib/Headers/opencl-c.h | ||
37 | +++ b/clang/lib/Headers/opencl-c.h | ||
38 | @@ -14682,7 +14682,7 @@ void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, flo | ||
39 | |||
40 | // OpenCL Extension v2.0 s9.18 - Mipmaps | ||
41 | #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) | ||
42 | -#ifdef cl_khr_mipmap_image | ||
43 | +#if defined(cl_khr_mipmap_image_writes) | ||
44 | void __ovld write_imagef(write_only image1d_t image, int coord, int lod, float4 color); | ||
45 | void __ovld write_imagei(write_only image1d_t image, int coord, int lod, int4 color); | ||
46 | void __ovld write_imageui(write_only image1d_t image, int coord, int lod, uint4 color); | ||
47 | @@ -14699,15 +14699,16 @@ void __ovld write_imagef(write_only image2d_array_t image_array, int4 coord, int | ||
48 | void __ovld write_imagei(write_only image2d_array_t image_array, int4 coord, int lod, int4 color); | ||
49 | void __ovld write_imageui(write_only image2d_array_t image_array, int4 coord, int lod, uint4 color); | ||
50 | |||
51 | -void __ovld write_imagef(write_only image2d_depth_t image, int2 coord, int lod, float color); | ||
52 | -void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, int lod, float color); | ||
53 | +void __ovld write_imagef(write_only image2d_depth_t image, int2 coord, int lod, float depth); | ||
54 | +void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, int lod, float depth); | ||
55 | |||
56 | #ifdef cl_khr_3d_image_writes | ||
57 | void __ovld write_imagef(write_only image3d_t image, int4 coord, int lod, float4 color); | ||
58 | void __ovld write_imagei(write_only image3d_t image, int4 coord, int lod, int4 color); | ||
59 | void __ovld write_imageui(write_only image3d_t image, int4 coord, int lod, uint4 color); | ||
60 | -#endif | ||
61 | -#endif //cl_khr_mipmap_image | ||
62 | +#endif //cl_khr_3d_image_writes | ||
63 | + | ||
64 | +#endif //defined(cl_khr_mipmap_image_writes) | ||
65 | #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) | ||
66 | |||
67 | // Image write functions for half4 type | ||
68 | @@ -14756,7 +14757,7 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, flo | ||
69 | #endif //cl_khr_depth_images | ||
70 | |||
71 | #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) | ||
72 | -#ifdef cl_khr_mipmap_image | ||
73 | +#if defined(cl_khr_mipmap_image_writes) | ||
74 | void __ovld write_imagef(read_write image1d_t image, int coord, int lod, float4 color); | ||
75 | void __ovld write_imagei(read_write image1d_t image, int coord, int lod, int4 color); | ||
76 | void __ovld write_imageui(read_write image1d_t image, int coord, int lod, uint4 color); | ||
77 | @@ -14780,8 +14781,9 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int | ||
78 | void __ovld write_imagef(read_write image3d_t image, int4 coord, int lod, float4 color); | ||
79 | void __ovld write_imagei(read_write image3d_t image, int4 coord, int lod, int4 color); | ||
80 | void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4 color); | ||
81 | -#endif | ||
82 | -#endif //cl_khr_mipmap_image | ||
83 | +#endif //cl_khr_3d_image_writes | ||
84 | + | ||
85 | +#endif //cl_khr_mipmap_image_writes | ||
86 | #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) | ||
87 | |||
88 | // Image write functions for half4 type | ||
89 | diff --git a/clang/test/SemaOpenCL/extension-version.cl b/clang/test/SemaOpenCL/extension-version.cl | ||
90 | index 19d08849535..0e6bbb7d3bc 100644 | ||
91 | --- a/clang/test/SemaOpenCL/extension-version.cl | ||
92 | +++ b/clang/test/SemaOpenCL/extension-version.cl | ||
93 | @@ -242,6 +242,18 @@ | ||
94 | #endif | ||
95 | #pragma OPENCL EXTENSION cl_khr_mipmap_image : enable | ||
96 | |||
97 | +#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) | ||
98 | +#ifndef cl_khr_mipmap_image_writes | ||
99 | +#error "Missing cl_khr_mipmap_image_writes define" | ||
100 | +#endif | ||
101 | +#else | ||
102 | +#ifdef cl_khr_mipmap_image_writes | ||
103 | +#error "Incorrect cl_khr_mipmap_image_writes define" | ||
104 | +#endif | ||
105 | +// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_mipmap_image_writes' - ignoring}} | ||
106 | +#endif | ||
107 | +#pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : enable | ||
108 | + | ||
109 | #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) | ||
110 | #ifndef cl_khr_srgb_image_writes | ||
111 | #error "Missing cl_khr_srgb_image_writes define" | ||
112 | -- | ||
113 | 2.17.1 | ||
114 | |||