forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include comments with template argument names in Cpp code from EmitC (#…
…403) * Include comments with template arg names in Cpp code from EmitC * Apply suggestions from code review Co-authored-by: Corentin Ferry <corentin.ferry@amd.com> Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> * Test for the presence of template arg names when there are no template args --------- Co-authored-by: Corentin Ferry <corentin.ferry@amd.com> Co-authored-by: Matthias Gehre <matthias.gehre@amd.com>
- Loading branch information
1 parent
20a6720
commit e25d207
Showing
6 changed files
with
83 additions
and
4 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
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
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
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,14 @@ | ||
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT | ||
|
||
// CPP-DEFAULT-LABEL: void basic | ||
func.func @basic(%arg0: i32, %arg1: f32) { | ||
emitc.call_opaque "kernel3"(%arg0, %arg1) : (i32, f32) -> () | ||
// CPP-DEFAULT: kernel3( | ||
emitc.call_opaque "kernel4"(%arg0, %arg1) {template_arg_names = ["N", "P"], template_args = [42 : i32, 56]} : (i32, f32) -> () | ||
// CPP-DEFAULT: kernel4</*N=*/42, /*P=*/56>( | ||
emitc.call_opaque "kernel4"(%arg0, %arg1) {template_arg_names = ["N"], template_args = [#emitc.opaque<"42">]} : (i32, f32) -> () | ||
// CPP-DEFAULT: kernel4</*N=*/42>( | ||
return | ||
} | ||
|
||
|