This is an automated email from the ASF dual-hosted git repository.
ruihangl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 49fd318e90 [ROCm] fma intrin (#15464)
49fd318e90 is described below
commit 49fd318e908055f34ac8f7995897c12521d80434
Author: Bohan Hou <[email protected]>
AuthorDate: Wed Aug 2 23:26:51 2023 -0700
[ROCm] fma intrin (#15464)
use llvm fma intrin for ROCm
---
src/target/llvm/intrin_rule_rocm.cc | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/target/llvm/intrin_rule_rocm.cc
b/src/target/llvm/intrin_rule_rocm.cc
index 86ac3d3516..17baaf3e65 100644
--- a/src/target/llvm/intrin_rule_rocm.cc
+++ b/src/target/llvm/intrin_rule_rocm.cc
@@ -22,6 +22,7 @@
*/
#ifdef TVM_LLVM_VERSION
+#include <llvm/IR/Intrinsics.h>
#include <tvm/runtime/registry.h>
#include <tvm/tir/builtin.h>
#include <tvm/tir/expr.h>
@@ -30,6 +31,8 @@
#include <sstream>
+#include "intrin_rule_llvm.h"
+
namespace tvm {
namespace codegen {
@@ -140,8 +143,8 @@ TVM_REGISTER_OP("tir.exp10")
TVM_REGISTER_OP("tir.erf").set_attr<FLowerIntrinsic>("rocm.FLowerIntrinsic",
DispatchPureExternOCML);
-TVM_REGISTER_OP("tir.fma").set_attr<FLowerIntrinsic>("rocm.FLowerIntrinsic",
- DispatchPureExternOCML);
+TVM_REGISTER_OP("tir.fma").set_attr<FLowerIntrinsic>(
+ "rocm.FLowerIntrinsic", DispatchLLVMPureIntrin<::llvm::Intrinsic::fmuladd,
3>);
TVM_REGISTER_OP("tir.log").set_attr<FLowerIntrinsic>("rocm.FLowerIntrinsic",
DispatchPureExternOCML);