Re:CodeGen: LLVM wrapper for just-in-time code generation an...
by m0zg on Monday May 20, 2019 @01:10AM
(#19957695)
One prominent use case is: you can generate linear algebra kernels that are specific to both the shape of your data and the hardware features of the machine on which the kernel is run (i.e. on a Xeon use AVX512, on desktop use AVX2, or on really old desktop use SSE). Therefore you can avoid hand-coding dozens of specializations of such kernels beforehand.
1. Quite confused about actual use cases, could anybody come up with an example? 2. The way I see it, it's kind of a way to have run-time "macros"? 3. How much overhead does this have when shipping the code to the user? 4. Would it be difficult to implement something like this for Rust? I can see special syntax to define the functions, would it make sense to add language support for this feature?