Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lennyerik/de813ffcf68898d52679dd2cae2d9caf to your computer and use it in GitHub Desktop.
Save lennyerik/de813ffcf68898d52679dd2cae2d9caf to your computer and use it in GitHub Desktop.
Patch for clang to Support CUDA 12.1
index 3c0f002..83f0c85 100644
--- a/usr/lib/clang/15.0.7/include/__clang_cuda_texture_intrinsics.h.bak
+++ b/usr/lib/clang/15.0.7/include/__clang_cuda_texture_intrinsics.h
@@ -693,7 +693,7 @@ __device__ static void __tex_fetch(__T *__ptr, __HandleT __handle,
template <class __op, class __DataT, class __RetT, int __TexT, class... __Args>
__device__ static void
__tex_fetch(__DataT *, __RetT *__ptr,
- texture<__DataT, __TexT, cudaReadModeNormalizedFloat> __handle,
+ cudaTextureObject_t __handle,
__Args... __args) {
using __FetchT = typename __TypeInfoT<__DataT>::__fetch_t;
*__ptr = __convert<__RetT, float4>::__run(
@@ -701,18 +701,17 @@ __tex_fetch(__DataT *, __RetT *__ptr,
__tex_handle_to_obj(__handle), __args...));
}
-// __nv_tex_surf_handler ("__tex...", &type_dummy, &ret, texture<...>, args...);
-// For cudaReadModeElementType fetch return type is based on type_dummy.
-template <class __op, class __DataT, class __RetT, int __TexT, class... __Args>
+// Not needed anymore, since Nvidia switched over to texture objects
+/*template <class __op, class __DataT, class __RetT, int __TexT, class... __Args>
__device__ static void
__tex_fetch(__DataT *, __RetT *__ptr,
- texture<__DataT, __TexT, cudaReadModeElementType> __handle,
+ cudaTextureObject_t __handle,
__Args... __args) {
using __FetchT = typename __TypeInfoT<__DataT>::__fetch_t;
*__ptr = __convert<__RetT, __FetchT>::__run(
__tex_fetch_v4<__op>::template __run<__FetchT>(
__tex_handle_to_obj(__handle), __args...));
-}
+}*/
} // namespace __cuda_tex
} // namespace
#pragma pop_macro("__ASM_OUT")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment