now emits host object file with ptx in it... next step .. testing
This commit is contained in:
4
ctx.cpp
4
ctx.cpp
@@ -3633,6 +3633,7 @@ FunctionEmitContext::LaunchInst(llvm::Value *callee,
|
|||||||
allocArgs.push_back(launchGroupHandlePtr);
|
allocArgs.push_back(launchGroupHandlePtr);
|
||||||
allocArgs.push_back(structSize);
|
allocArgs.push_back(structSize);
|
||||||
allocArgs.push_back(LLVMInt32(align));
|
allocArgs.push_back(LLVMInt32(align));
|
||||||
|
CallInst(falloc, NULL, allocArgs, "args_ptr");
|
||||||
|
|
||||||
// Copy the values of the parameters into the appropriate place in
|
// Copy the values of the parameters into the appropriate place in
|
||||||
// the argument block
|
// the argument block
|
||||||
@@ -3651,9 +3652,10 @@ FunctionEmitContext::LaunchInst(llvm::Value *callee,
|
|||||||
llvm::Value* ptr_arg1_addr = AllocaInst(type, "argptr");
|
llvm::Value* ptr_arg1_addr = AllocaInst(type, "argptr");
|
||||||
StoreInst(argVals[i], ptr_arg1_addr);
|
StoreInst(argVals[i], ptr_arg1_addr);
|
||||||
|
|
||||||
|
llvm::ConstantInt* const_int64_10 = llvm::ConstantInt::get(*g->ctx, llvm::APInt(64, 0));
|
||||||
llvm::ConstantInt* const_int64_11 = llvm::ConstantInt::get(*g->ctx, llvm::APInt(64, i));
|
llvm::ConstantInt* const_int64_11 = llvm::ConstantInt::get(*g->ctx, llvm::APInt(64, i));
|
||||||
std::vector<llvm::Value*> ptr_arrayinit_begin_indices;
|
std::vector<llvm::Value*> ptr_arrayinit_begin_indices;
|
||||||
ptr_arrayinit_begin_indices.push_back(const_int64_11);
|
ptr_arrayinit_begin_indices.push_back(const_int64_10);
|
||||||
ptr_arrayinit_begin_indices.push_back(const_int64_11);
|
ptr_arrayinit_begin_indices.push_back(const_int64_11);
|
||||||
llvm::GetElementPtrInst* ptr_arrayinit_element =
|
llvm::GetElementPtrInst* ptr_arrayinit_element =
|
||||||
llvm::GetElementPtrInst::Create(ptrParam, ptr_arrayinit_begin_indices, "el", bblock);
|
llvm::GetElementPtrInst::Create(ptrParam, ptr_arrayinit_begin_indices, "el", bblock);
|
||||||
|
|||||||
@@ -2366,8 +2366,17 @@ Module::CompileAndOutput(const char *srcFile,
|
|||||||
targetOutFileName[suffix+1] = 0;
|
targetOutFileName[suffix+1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outputType != Object)
|
||||||
|
{
|
||||||
if (!m->writeOutput(outputType, targetOutFileName.c_str(), includeFileName))
|
if (!m->writeOutput(outputType, targetOutFileName.c_str(), includeFileName))
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
else if (itarget > 0)
|
||||||
|
{
|
||||||
|
if (!m->writeOutput(outputType, outFileName, includeFileName))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (itarget == 0)
|
if (itarget == 0)
|
||||||
{ /* store ptx into memory */
|
{ /* store ptx into memory */
|
||||||
|
|||||||
Reference in New Issue
Block a user