From 7d7ae44823757fa0d2f2247181b2f8eb682f6643 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 21 Nov 2018 10:17:15 -0800 Subject: [PATCH] Work around for CUDA issue on LLVM 3.8 with recent CUDA versions. --- src/tcuda.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tcuda.cpp b/src/tcuda.cpp index 3b09c73c..5fb54a89 100644 --- a/src/tcuda.cpp +++ b/src/tcuda.cpp @@ -85,7 +85,7 @@ static void annotateKernel(terra_State * T, llvm::Module * M, llvm::Function * k static const char * cudadatalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"; -#if LLVM_VERSION < 38 +#if LLVM_VERSION <= 38 class RemoveAttr : public llvm::InstVisitor { public: void visitCallInst(llvm::CallInst & I) { @@ -96,7 +96,7 @@ class RemoveAttr : public llvm::InstVisitor { void moduleToPTX(terra_State * T, llvm::Module * M, int major, int minor, std::string * buf, const char * libdevice) { -#if LLVM_VERSION < 38 +#if LLVM_VERSION <= 38 for(llvm::Module::iterator it = M->begin(), end = M->end(); it != end; ++it) { it->setAttributes(llvm::AttributeSet()); //remove annotations because syntax doesn't match RemoveAttr A;