VkFFT icon indicating copy to clipboard operation
VkFFT copied to clipboard

OpenCL code generation only option

Open RSenApps opened this issue 3 years ago • 1 comments

Hi thank you for the very cool project! I am interested in using this project as a code generator for OpenCL, but would like to do so without introducing any dependencies on OpenCL or Level Zero (and especially no OpenCL compiler at runtime). I have already written a test OpenCL program that calls initializeVkFFT and would satisfy my requirements and verified the performance of the resulting OpenCL kernels. I am also more than happy to submit a pull request myself (if this is okay) so that I can gain further confidence in helping contribute in the future to this project.

I am open to suggestions on how to accomplish this, but my initial thought was to introduce another option to VKFFT_BACKEND for OpenCL code gen. Alternatively I could introduce an option to VKFFT_BACKEND for code gen and then add another option to select the source language. I could also leave the VKFFT_BACKEND macro alone, but that would require a lot of additional ifdef guards to ensure that no backend-specific apis are used. It would be the responsibility of the client code to properly set configuration options that are normally queried such as sharedMemorySize, maxThreadsNum, warpSize, etc.

Once I have properly guarded the code, I could call initializeVkFFT and then when normally the OpenCL compiler would get invoked, I can add another case to just save the program results to a string and then exit early.

Let me know any thoughts on the above and again really appreciate your guidance on this.

RSenApps avatar Aug 26 '22 16:08 RSenApps

Hello,

I am currently working on a platform for multiple-API code generation that includes what you are describing as a separate codegen block. Switching VkFFT to it, however, is taking some time as it is a big design refactoring for a big project, but it will be done (hopefully soon). I suggest waiting for it and seeing if it meets your expectations.

VKFFT_BACKEND specifies big differences in APIs, so I wouldn't personally add the switch between using/not using the compiler in it.

Best regards, Dmitrii

DTolm avatar Sep 04 '22 14:09 DTolm