From ae29f8769e666d0804ece31284e015bfab696cd4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 15 Dec 2023 00:40:43 -0500 Subject: [PATCH] COMP: Update cutil headers to fix build against SDK without cufft library This commit addresses compilation errors against SDKs that do not have the cufft library installed. The update includes the introduction of the HAVE_CUFFT macro, which selectively excludes the relevant code. It's important to note that Autoscoper does not utilize cufft functionality. --- libautoscoper/src/gpu/cuda/cutil/cutil_gl_inline.h | 2 ++ libautoscoper/src/gpu/cuda/cutil/cutil_inline_runtime.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/libautoscoper/src/gpu/cuda/cutil/cutil_gl_inline.h b/libautoscoper/src/gpu/cuda/cutil/cutil_gl_inline.h index 7d59ecb1..0ac60631 100644 --- a/libautoscoper/src/gpu/cuda/cutil/cutil_gl_inline.h +++ b/libautoscoper/src/gpu/cuda/cutil/cutil_gl_inline.h @@ -18,7 +18,9 @@ #include #include +#ifdef HAVE_CUFFT #include +#endif #include #include diff --git a/libautoscoper/src/gpu/cuda/cutil/cutil_inline_runtime.h b/libautoscoper/src/gpu/cuda/cutil/cutil_inline_runtime.h index 8fb55342..983ee0a2 100644 --- a/libautoscoper/src/gpu/cuda/cutil/cutil_inline_runtime.h +++ b/libautoscoper/src/gpu/cuda/cutil/cutil_inline_runtime.h @@ -26,14 +26,18 @@ #include #include +#ifdef HAVE_CUFFT #include +#endif // We define these calls here, so the user doesn't need to include __FILE__ and __LINE__ // The advantage is the developers gets to use the inline function so they can debug #define cutilSafeCallNoSync(err) __cudaSafeCallNoSync(err, __FILE__, __LINE__) #define cutilSafeCall(err) __cudaSafeCall (err, __FILE__, __LINE__) #define cutilSafeThreadSync() __cudaSafeThreadSync(__FILE__, __LINE__) +#ifdef HAVE_CUFFT #define cufftSafeCall(err) __cufftSafeCall (err, __FILE__, __LINE__) +#endif #define cutilCheckError(err) __cutilCheckError (err, __FILE__, __LINE__) #define cutilCheckMsg(msg) __cutilCheckMsg (msg, __FILE__, __LINE__) #define cutilSafeMalloc(mallocCall) __cutilSafeMalloc ((mallocCall), __FILE__, __LINE__) @@ -175,6 +179,7 @@ inline void __cudaSafeThreadSync( const char *file, const int line ) } } +#ifdef HAVE_CUFFT inline void __cufftSafeCall( cufftResult err, const char *file, const int line ) { if( CUFFT_SUCCESS != err) { @@ -183,6 +188,7 @@ inline void __cufftSafeCall( cufftResult err, const char *file, const int line ) exit(-1); } } +#endif inline void __cutilCheckError( CUTBoolean err, const char *file, const int line ) {