-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland '[flang][cuda] Add cuf.register_kernel operation' (#112389)
The operation will be used in the CUF constructor to register the kernel functions. This allow to delay this until codegen when the gpu.binary will be available. Reland of #112268 with correct shared library build support.
- Loading branch information
1 parent
583fa4f
commit 7e72e5b
Showing
6 changed files
with
128 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: fir-opt %s | FileCheck %s | ||
|
||
module attributes {gpu.container_module} { | ||
gpu.module @cuda_device_mod { | ||
gpu.func @_QPsub_device1() kernel { | ||
gpu.return | ||
} | ||
gpu.func @_QPsub_device2(%arg0: !fir.ref<f32>) kernel { | ||
gpu.return | ||
} | ||
} | ||
llvm.func internal @__cudaFortranConstructor() { | ||
cuf.register_kernel @cuda_device_mod::@_QPsub_device1 | ||
cuf.register_kernel @cuda_device_mod::@_QPsub_device2 | ||
llvm.return | ||
} | ||
} | ||
|
||
// CHECK: cuf.register_kernel @cuda_device_mod::@_QPsub_device1 | ||
// CHECK: cuf.register_kernel @cuda_device_mod::@_QPsub_device2 |
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