@@ -2,24 +2,15 @@ Index: FFmpeg/compat/cuda/cuda_runtime.h
22===================================================================
33--- FFmpeg.orig/compat/cuda/cuda_runtime.h
44+++ FFmpeg/compat/cuda/cuda_runtime.h
5- @@ -23,7 +23,16 @@
6- #ifndef COMPAT_CUDA_CUDA_RUNTIME_H
5+ @@ -24,6 +24,7 @@
76 #define COMPAT_CUDA_CUDA_RUNTIME_H
87
9- + // On MinGW (clangarm64), msys2's _mingw.h defines __prefetch as an inline
10- + // function, but clang treats __prefetch as a builtin on ARM64 -> redefinition
11- + // error during .cu compilation (this header is force-included before stdint.h
12- + // pulls in _mingw.h). Renaming the mingw inline keeps clang's builtin intact.
13- + #ifdef __MINGW32__
14- + #define __prefetch __ff_cuda_skipped_prefetch
15- + #endif
16- +
178 // Common macros
189+ #define __constant__ __attribute__((constant))
1910 #define __global__ __attribute__((global))
2011 #define __device__ __attribute__((device))
2112 #define __device_builtin__ __attribute__((device_builtin))
22- @@ -39,59 +48 ,59 @@
13+ @@ -39,59 +40 ,59 @@
2314 // Basic typedefs
2415 typedef __device_builtin__ unsigned long long cudaTextureObject_t;
2516
@@ -125,7 +116,7 @@ Index: FFmpeg/compat/cuda/cuda_runtime.h
125116 uint3 ret; \
126117 unsigned tmp; \
127118 GETCOMP(reg, x) \
128- @@ -109,18 +118 ,8 @@ GET(getThreadIdx, tid)
119+ @@ -109,18 +110 ,8 @@ GET(getThreadIdx, tid)
129120 #define blockDim (getBlockDim())
130121 #define threadIdx (getThreadIdx())
131122
@@ -145,7 +136,7 @@ Index: FFmpeg/compat/cuda/cuda_runtime.h
145136
146137 TEX2D(unsigned char, a & 0xFF)
147138 TEX2D(unsigned short, a & 0xFFFF)
148- @@ -134,19 +133 ,19 @@ TEX2D(float4, make_float4(a, b, c, d))
139+ @@ -134,19 +125 ,19 @@ TEX2D(float4, make_float4(a, b, c, d))
149140
150141 // Template calling tex instruction and converting the output to the selected type
151142 template<typename T>
@@ -174,7 +165,7 @@ Index: FFmpeg/compat/cuda/cuda_runtime.h
174165 {
175166 float4 ret;
176167 asm("tex.2d.v4.f32.f32 {%0, %1, %2, %3}, [%4, {%5, %6}];" :
177- @@ -156,39 +155 ,43 @@ inline __device__ float4 tex2D<float4>(c
168+ @@ -156,39 +147 ,43 @@ inline __device__ float4 tex2D<float4>(c
178169 }
179170
180171 template<>
0 commit comments