-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[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;"); } | ||
| }]; | ||
|
||
| let hasVerifier = 1; | ||
| } | ||
|
|
||
| //===----------------------------------------------------------------------===// | ||
| // NVVM Split arrive/wait barrier | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.