KomputeProject / kompute

General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
http://kompute.cc/
Apache License 2.0
1.94k stars 146 forks source link

added support for custom kernel function names #320

Closed szabivan closed 1 year ago

szabivan commented 1 year ago

In a response to Issue #251 , this PR aims to add support for custom function names (with which it becomes possible to use .spv shaders generated from openCL source files with the clspv tool). The only modification is to use a new field mKernelFunctionName instead of the hard-coded "main" constant that can be fed to the constructor of the Algorithm class as well as to the algorithm method of the Manager class. This parameter is added as the last one, with a default value of "main" so it should be completely backwards compatible. (As for openCL sources, it is forbidden to use main as the name of a kernel function, using such spv files without adding an explicit asm("main") suffix in the shader it was impossible, which is doable only if there is only one declared kernel function in the cl file so asm-hacking the name of the kernel function is not a complete solution.)