File tree Expand file tree Collapse file tree 2 files changed +6
-21
lines changed
lib/Optimizer/Dialect/CUF Expand file tree Collapse file tree 2 files changed +6
-21
lines changed Original file line number Diff line number Diff line change @@ -281,12 +281,12 @@ mlir::LogicalResult cuf::RegisterKernelOp::verify() {
281281
282282 mlir::SymbolTable gpuSymTab (gpuMod);
283283 auto func = gpuSymTab.lookup <mlir::gpu::GPUFuncOp>(getKernelName ());
284- if (! func)
285- return emitOpError ( " device function not found" );
286-
287- if (!func.isKernel ())
288- return emitOpError (" only kernel gpu.func can be registered" );
289-
284+ if (func) {
285+ // Only check if the gpu.func is found. It might be converted to LLVMFuncOp
286+ // already.
287+ if (!func.isKernel ())
288+ return emitOpError (" only kernel gpu.func can be registered" );
289+ }
290290 return mlir::success ();
291291}
292292
Original file line number Diff line number Diff line change @@ -143,21 +143,6 @@ module attributes {gpu.container_module} {
143143
144144// -----
145145
146- module attributes {gpu.container_module} {
147- gpu.module @cuda_device_mod {
148- gpu.func @_QPsub_device1() {
149- gpu.return
150- }
151- }
152- llvm.func internal @__cudaFortranConstructor() {
153- // expected-error@+1{{'cuf.register_kernel' op device function not found}}
154- cuf.register_kernel @cuda_device_mod::@_QPsub_device2
155- llvm.return
156- }
157- }
158-
159- // -----
160-
161146module attributes {gpu.container_module} {
162147 llvm.func internal @__cudaFortranConstructor() {
163148 // expected-error@+1{{'cuf.register_kernel' op gpu module not found}}
You can’t perform that action at this time.
0 commit comments