[clang] [CUDA] Do not include obsolete texture_fetch_functions.h (PR #151766)
Artem Belevich via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 1 16:01:50 PDT 2025
https://github.com/Artem-B updated https://github.com/llvm/llvm-project/pull/151766
>From 7ad34288652d0f236e87f0c348275bcff5469432 Mon Sep 17 00:00:00 2001
From: Artem Belevich <tra at google.com>
Date: Fri, 1 Aug 2025 13:09:11 -0700
Subject: [PATCH 1/2] [CUDA] Do not include obsolete texture_fetch_functions.h
---
clang/lib/Headers/__clang_cuda_runtime_wrapper.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
index 44934ba2c2d67..87245541b2520 100644
--- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -385,7 +385,11 @@ __host__ __device__ void __nv_tex_surf_handler(const char *name, T *ptr,
#endif // CUDA_VERSION
#endif // __cplusplus >= 201103L && CUDA_VERSION >= 9000
#include "surface_indirect_functions.h"
+#if CUDA_VERSION < 13000
+// Direct texture fetch functions had been deprecated since CUDA-11.
+// The file in CUDA-12 only carried unused texture types, and is no longer needed.
#include "texture_fetch_functions.h"
+#endif // CUDA_VERSION < 13000
#include "texture_indirect_functions.h"
// Restore state of __CUDA_ARCH__ and __THROW we had on entry.
>From 6108f147a54d580aa8d08e5f5421071a44234fe0 Mon Sep 17 00:00:00 2001
From: Artem Belevich <tra at google.com>
Date: Fri, 1 Aug 2025 16:01:42 -0700
Subject: [PATCH 2/2] reformat changes in __clang_cuda_runtime_wrapper.h
---
clang/lib/Headers/__clang_cuda_runtime_wrapper.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
index 87245541b2520..b1e59248a58de 100644
--- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -387,7 +387,8 @@ __host__ __device__ void __nv_tex_surf_handler(const char *name, T *ptr,
#include "surface_indirect_functions.h"
#if CUDA_VERSION < 13000
// Direct texture fetch functions had been deprecated since CUDA-11.
-// The file in CUDA-12 only carried unused texture types, and is no longer needed.
+// The file in CUDA-12 only carried unused texture types, and is no longer
+// needed.
#include "texture_fetch_functions.h"
#endif // CUDA_VERSION < 13000
#include "texture_indirect_functions.h"
More information about the cfe-commits
mailing list