+fixed some example, found some bugs, and bugs in ptxas/cuda

This commit is contained in:
Evghenii
2014-01-21 14:51:27 +01:00
parent 5a773ed62a
commit bc99897fbb
22 changed files with 98 additions and 58 deletions

View File

@@ -512,6 +512,7 @@ Function::GenerateIR() {
if (g->target->getISA() == Target::NVPTX)
{
functionName += std::string("___export"); /* add ___export to the end, for ptxcc to recognize it is exported */
#if 0
llvm::NamedMDNode* annotations =
m->module->getOrInsertNamedMetadata("nvvm.annotations");
llvm::SmallVector<llvm::Value*, 3> av;
@@ -519,6 +520,7 @@ Function::GenerateIR() {
av.push_back(llvm::MDString::get(*g->ctx, "kernel"));
av.push_back(llvm::ConstantInt::get(llvm::IntegerType::get(*g->ctx,32), 1));
annotations->addOperand(llvm::MDNode::get(*g->ctx, av));
#endif
}
llvm::Function *appFunction =
llvm::Function::Create(ftype, linkage, functionName.c_str(), m->module);