-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[MLIR][NVVM] Add pmevent #152509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MLIR][NVVM] Add pmevent #152509
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -401,6 +401,44 @@ def NVVM_ReduxOp : | |
}]; | ||
} | ||
|
||
//===----------------------------------------------------------------------===// | ||
// NVVM Performance Monitor events | ||
//===----------------------------------------------------------------------===// | ||
|
||
def NVVM_PMEventOp : NVVM_PTXBuilder_Op<"pmevent">, | ||
Arguments<(ins OptionalAttr<I16Attr>:$maskedEventId, | ||
OptionalAttr<I32Attr>:$eventId)> { | ||
let summary = "Trigger one or more Performance Monitor events."; | ||
|
||
let description = [{ | ||
Triggers one or more of a fixed number of performance monitor events, with | ||
event index or mask specified by immediate operand. | ||
|
||
Without `mask` it triggers a single performance monitor event indexed by | ||
immediate operand a, in the range 0..15. | ||
|
||
With `mask` it triggers one or more of the performance monitor events. Each | ||
bit in the 16-bit immediate operand controls an event. | ||
|
||
[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#miscellaneous-instructions-pmevent) | ||
}]; | ||
|
||
string llvmBuilder = [{ | ||
llvm::Value *mId = builder.getInt16(* $maskedEventId); | ||
createIntrinsicCall(builder, llvm::Intrinsic::nvvm_pm_event_mask, {mId}); | ||
}]; | ||
|
||
let assemblyFormat = "attr-dict (`id` `=` $eventId^)? (`mask` `=` $maskedEventId^)?"; | ||
|
||
let extraClassDeclaration = [{ | ||
bool hasIntrinsic() { return !getEventId(); } | ||
}]; | ||
let extraClassDefinition = [{ | ||
std::string $cppClass::getPtx() { return std::string("pmevent %0;"); } | ||
}]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we have the intrinsics now, do we still need the inline-asm version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've intrinsic for the mask version. This is without mask. I think we need to add another intrinsic
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried adding two intrinsics but was then asked to have only the mask-based one. In final sass, it is always mask-based and the event-id impl seems a syntactic sugar from PTX. |
||
let hasVerifier = 1; | ||
} | ||
|
||
//===----------------------------------------------------------------------===// | ||
// NVVM Split arrive/wait barrier | ||
//===----------------------------------------------------------------------===// | ||
|
Uh oh!
There was an error while loading. Please reload this page.