Skip to content
Snippets Groups Projects
Commit 20223241 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Fixing Handling of tensor_set_node_id in CUDNN Pass

parent f6b74ce9
No related branches found
No related tags found
No related merge requests found
...@@ -267,9 +267,9 @@ void CGT_CUDNN::codeGen(DFLeafNode* N) { ...@@ -267,9 +267,9 @@ void CGT_CUDNN::codeGen(DFLeafNode* N) {
//assert((II->getCalledFunction()->getName()).startswith("llvm.visc.tensor") //assert((II->getCalledFunction()->getName()).startswith("llvm.visc.tensor")
// && "Only HPVM tensor intrinsics allowed in ApproxHPVM leaf nodes\n"); // && "Only HPVM tensor intrinsics allowed in ApproxHPVM leaf nodes\n");
if (!(II->getCalledFunction()->getName()).startswith("llvm.visc.tensor")){ //if (!(II->getCalledFunction()->getName()).startswith("llvm.visc.tensor")){
continue; // skip non-tensor ops //continue; // skip non-tensor ops
} //}
/********************* Handle VISC Tensor intrinsics ********************/ /********************* Handle VISC Tensor intrinsics ********************/
switch (II->getIntrinsicID()) { switch (II->getIntrinsicID()) {
...@@ -545,6 +545,28 @@ void CGT_CUDNN::codeGen(DFLeafNode* N) { ...@@ -545,6 +545,28 @@ void CGT_CUDNN::codeGen(DFLeafNode* N) {
IItoRemove.push_back(II); IItoRemove.push_back(II);
} }
break; break;
case Intrinsic::visc_node_id:
{ /* llvm.visc.node.id */
DEBUG(errs() << F_cudnn->getName() << "\t: Handling Node ID Intrinsic \n");
// Get uint32 argument
Value *Op = II->getOperand(0);
// Argument list for the runtime call
std::vector<Value*> Args;
Args.push_back(II->getOperand(0));
// Create hpvm-tensor-rt function call
Constant* tensor_set_node_id;
DECLARE(tensor_set_node_id);
CallInst::Create(tensor_set_node_id, Args, "", II);
// Mark to remove at the end
IItoRemove.push_back(II);
}
break;
default: default:
llvm_unreachable("Unknown VISC Intrinsic!"); llvm_unreachable("Unknown VISC Intrinsic!");
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment