diff --git a/module.cpp b/module.cpp index 743e3adf..2e9cf279 100644 --- a/module.cpp +++ b/module.cpp @@ -1926,7 +1926,10 @@ Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *ostre } } if (g->target->getISA() == Target::NVPTX64) + { opts.addMacroDef("__NVPTX__"); + opts.addMacroDef("programIndex=laneIndex()"); + } #if defined(LLVM_3_1) inst.getLangOpts().BCPLComment = 1;