[clang-tools-extra] [MLIR] Update convert-gpu-to-spirv pass to prepare using GPU compilat… (PR #69941)

2023-10-30 Thread Jungwook Park via cfe-commits


@@ -108,6 +138,25 @@ void GPUToSPIRVPass::runOnOperation() {
 if (failed(applyFullConversion(gpuModule, *target, std::move(patterns
   return signalPassFailure();
   }
+
+  // For OpenCL, the gpu.func op in the original gpu.module op needs to be

jungpark-mlir wrote:

Is this gpu.func->func.func necessary? Can you just keep the original gpu.func 
instead?

https://github.com/llvm/llvm-project/pull/69941
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [MLIR] Update convert-gpu-to-spirv pass to prepare using GPU compilat… (PR #69941)

2023-10-30 Thread Jungwook Park via cfe-commits


@@ -108,6 +138,25 @@ void GPUToSPIRVPass::runOnOperation() {
 if (failed(applyFullConversion(gpuModule, *target, std::move(patterns
   return signalPassFailure();
   }
+
+  // For OpenCL, the gpu.func op in the original gpu.module op needs to be

jungpark-mlir wrote:

I think the problem is, the lack of spirv support in gpu dialect. For example, 
gpu.func needs to be able to wrap spirv.func so gpu-to-llvm pass (for the host 
code) can properly handle the relation between gpu.launch_func and spirv.func.
Basically, using dummy `func.func` looks little hacky and it'd be also nice if 
the divergence between Vulkan/OpenCL IR structures could be avoided. However, 
considering the progress of this commit, we can discuss this later for the 
future enhancement. 
Really appreciate this work and look forward to seeing it merged.

https://github.com/llvm/llvm-project/pull/69941
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MLIR] Update convert-gpu-to-spirv pass to prepare using GPU compilat… (PR #69941)

2023-10-30 Thread Jungwook Park via cfe-commits


@@ -108,6 +138,25 @@ void GPUToSPIRVPass::runOnOperation() {
 if (failed(applyFullConversion(gpuModule, *target, std::move(patterns
   return signalPassFailure();
   }
+
+  // For OpenCL, the gpu.func op in the original gpu.module op needs to be

jungpark-mlir wrote:

I think the problem is, the lack of spirv support in gpu dialect. For example, 
gpu.func needs to be able to wrap spirv.func so gpu-to-llvm pass (for the host 
code) can properly handle the relation between gpu.launch_func and spirv.func.
Basically, using dummy `func.func` looks little hacky and it'd be also nice if 
the divergence between Vulkan/OpenCL IR structures could be avoided. However, 
considering the progress of this commit, we can discuss this later for the 
future enhancement. 
Really appreciate this work and look forward to seeing it merged.

https://github.com/llvm/llvm-project/pull/69941
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits