Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions patches/clang/0001-Add-support-for-cl_khr_mipmap_image_writes.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
From 1ed55ebdc8181c67b9cf1cfa3a977f069413dd89 Mon Sep 17 00:00:00 2001
From 9625ef3fea5f587558965a2a40dd51f8fee9eb05 Mon Sep 17 00:00:00 2001
From: Ilya Mashkov <ilya.mashkov@intel.com>
Date: Thu, 12 Dec 2019 14:33:41 +0300
Subject: [PATCH] Add support for cl_khr_mipmap_image_writes

This is backporting of https://reviews.llvm.org/D71460

Signed-off-by: haonanya <haonan.yang@intel.com>
---
clang/include/clang/Basic/OpenCLExtensions.def | 1 +
clang/lib/Headers/opencl-c.h | 22 ++++++++++++++--------
clang/lib/Headers/opencl-c.h | 18 ++++++++++--------
clang/test/SemaOpenCL/extension-version.cl | 12 ++++++++++++
3 files changed, 27 insertions(+), 8 deletions(-)
3 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def
index 5536a6e..5174815 100644
index 5536a6e8e4df..517481584313 100644
--- a/clang/include/clang/Basic/OpenCLExtensions.def
+++ b/clang/include/clang/Basic/OpenCLExtensions.def
@@ -70,6 +70,7 @@ OPENCLEXT_INTERNAL(cl_khr_spir, 120, ~0U)
Expand All @@ -22,20 +25,19 @@ index 5536a6e..5174815 100644
OPENCLEXT_INTERNAL(cl_khr_subgroups, 200, ~0U)
OPENCLEXT_INTERNAL(cl_khr_terminate_context, 200, ~0U)
diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
index 06c5ab6..d3ae0dd 100644
index 06c5ab6a72f0..1985a361168b 100644
--- a/clang/lib/Headers/opencl-c.h
+++ b/clang/lib/Headers/opencl-c.h
@@ -14682,7 +14682,8 @@ void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, flo
@@ -14682,7 +14682,7 @@ void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, flo

// OpenCL Extension v2.0 s9.18 - Mipmaps
#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-#ifdef cl_khr_mipmap_image
+#if defined(cl_khr_mipmap_image_writes)
+#pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : begin
void __ovld write_imagef(write_only image1d_t image, int coord, int lod, float4 color);
void __ovld write_imagei(write_only image1d_t image, int coord, int lod, int4 color);
void __ovld write_imageui(write_only image1d_t image, int coord, int lod, uint4 color);
@@ -14699,15 +14700,17 @@ void __ovld write_imagef(write_only image2d_array_t image_array, int4 coord, int
@@ -14699,15 +14699,16 @@ void __ovld write_imagef(write_only image2d_array_t image_array, int4 coord, int
void __ovld write_imagei(write_only image2d_array_t image_array, int4 coord, int lod, int4 color);
void __ovld write_imageui(write_only image2d_array_t image_array, int4 coord, int lod, uint4 color);

Expand All @@ -52,42 +54,40 @@ index 06c5ab6..d3ae0dd 100644
-#endif //cl_khr_mipmap_image
+#endif //cl_khr_3d_image_writes
+
+#pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : end
+#endif //defined(cl_khr_mipmap_image_writes)
#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)

// Image write functions for half4 type
@@ -14756,7 +14759,8 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, flo
@@ -14756,7 +14757,7 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, flo
#endif //cl_khr_depth_images

#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-#ifdef cl_khr_mipmap_image
+#ifdef cl_khr_mipmap_image_writes
+#pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : begin
void __ovld write_imagef(read_write image1d_t image, int coord, int lod, float4 color);
void __ovld write_imagei(read_write image1d_t image, int coord, int lod, int4 color);
void __ovld write_imageui(read_write image1d_t image, int coord, int lod, uint4 color);
@@ -14780,8 +14784,10 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int
@@ -14780,8 +14781,9 @@ void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int
void __ovld write_imagef(read_write image3d_t image, int4 coord, int lod, float4 color);
void __ovld write_imagei(read_write image3d_t image, int4 coord, int lod, int4 color);
void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4 color);
-#endif
-#endif //cl_khr_mipmap_image
+#endif //cl_khr_3d_image_writes
+
+#pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : end
+#endif //cl_khr_mipmap_image_writes
#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)

// Image write functions for half4 type
diff --git a/clang/test/SemaOpenCL/extension-version.cl b/clang/test/SemaOpenCL/extension-version.cl
index 19d0884..0e6bbb7 100644
index 19d088495350..0e6bbb7d3bcd 100644
--- a/clang/test/SemaOpenCL/extension-version.cl
+++ b/clang/test/SemaOpenCL/extension-version.cl
@@ -243,6 +243,18 @@
@@ -242,6 +242,18 @@
#endif
#pragma OPENCL EXTENSION cl_khr_mipmap_image : enable

#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
+#ifndef cl_khr_mipmap_image_writes
+#error "Missing cl_khr_mipmap_image_writes define"
+#endif
Expand All @@ -99,10 +99,9 @@ index 19d0884..0e6bbb7 100644
+#endif
+#pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : enable
+
+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
#ifndef cl_khr_srgb_image_writes
#error "Missing cl_khr_srgb_image_writes define"
#endif
--
2.7.4
2.17.1

This file was deleted.