forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[part 1] Implementation of primitive ir emitter (PaddlePaddle#26)
* Implementation of primitive ir emitter * fix test * fix code style
- Loading branch information
Zhang Ting
authored
Aug 12, 2021
1 parent
1394fcd
commit d60e0b2
Showing
3 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include "llvm/IR/IRBuilder.h" | ||
#include "llvm/IR/Intrinsics.h" | ||
#include "llvm/IR/Value.h" | ||
|
||
namespace paddle { | ||
namespace piano { | ||
namespace backends { | ||
|
||
llvm::Value* CallToLLVMIntrinsic(llvm::IRBuilder<>* ir_builder, | ||
llvm::Intrinsic::ID llvm_Intrinsic) { | ||
llvm::Module* llvm_module = ir_builder->GetInsertBlock()->getModule(); | ||
llvm::Function* func = | ||
llvm::Intrinsic::getDeclaration(llvm_module, llvm_Intrinsic); | ||
return ir_builder->CreateCall(func); | ||
} | ||
|
||
} // namespace backends | ||
} // namespace piano | ||
} // namespace paddle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters