[Mlir-commits] [mlir] [mlir][nvvm] Introduce `elect.sync` Op (PR #68323)
Guray Ozen
llvmlistbot at llvm.org
Tue Oct 10 13:38:52 PDT 2023
================
@@ -574,6 +574,26 @@ def NVVM_SyncWarpOp :
}
+def NVVM_ElectSyncOp : NVVM_Op<"elect.sync",
+ [DeclareOpInterfaceMethods<BasicPtxBuilderOpInterface>]>
+{
+ let results = (outs I1:$pred);
+ let assemblyFormat = "attr-dict `->` type(results)";
+ let extraClassDefinition = [{
+ std::string $cppClass::getPtx() {
+ return std::string(
+ "{ \n"
+ ".reg .u32 rx; \n"
+ ".reg .pred px; \n"
+ " mov.u32 %0, 0; \n"
+ " elect.sync rx | px, 0xFFFFFFFF;\n"
----------------
grypp wrote:
It is a good point and thanks for the review.
NVVM dialect doesn't know SM arch. You can think that NVVM is similar to PTX, you can compile it but you should make sure that you have the SM arch to run.
A high-level dialect knows the SM arch and it's responsible of generating the right NVVM Ops. For example, a transformation from `vector` dialect -> `nvvm` should know the SM target.
https://github.com/llvm/llvm-project/pull/68323
More information about the Mlir-commits
mailing list