KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
460 stars 207 forks source link

Add a new flag "--no-entry" #2585

Open lucasz93 opened 1 month ago

lucasz93 commented 1 month ago

Add a new flag "--no-entry" which disables kernel entry point generation. This is a workaround for some OpenCL drivers that are incompatible with entry points, leading them to have twice the number of kernel arguments. See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1486 for more details.

Adding this option allows a single toolchain to be used when compiling kernels for all devices. Some real world instances of this problem: https://community.intel.com/t5/GPU-Compute-Software/OpenCL-CL-INVALID-KERNEL-ARGS-with-driver-gt-30-0-101-1340/td-p/1420021 https://community.intel.com/t5/GPU-Compute-Software/OpenCL-Kernel-Name-appends-quot-1-quot/m-p/1419720#M644

The workaround is to use ocloc but that adds another toolchain to dev environments and it doesn't have CLC++ support in master just yet.

This might be useful to backport all the way to version 14. I'll open those PRs if this gets approved instead of spamming everything upfront.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.