Skip to content

Commit

Permalink
Work around for CUDA issue on LLVM 3.8 with recent CUDA versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Dec 4, 2018
1 parent 4062832 commit 7d7ae44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tcuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<RemoveAttr> {
public:
void visitCallInst(llvm::CallInst & I) {
Expand All @@ -96,7 +96,7 @@ class RemoveAttr : public llvm::InstVisitor<RemoveAttr> {

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;
Expand Down

0 comments on commit 7d7ae44

Please sign in to comment.