hcc
hcc copied to clipboard
Compilation time architecture (ISA) differentiation
I would like to change some complication-time variables (template parameters) based on AMD target architecture passed to hcc. This is for performance reasons (each architecture has different sweet spot). Is there any way to get information about architecture (ISA) during compilation (of device functions)?
We currently don't support this due to a limitation in hcc on how we support multiple architecture in a single binary file. Our frontend currently only parses the source code once for all architectures and then the resulting LLVM IR would be reused to generate ISA for all GPU architectures.
We are planning on changing this such that the source would be parsed once per architecture and that there would be predefined macros for the GPU arch being targeted for that particular compilation instance. The work is being planned for some time this year.
For now, the workaround would be to specify a macro through a command line flag (e.g. -D
Thanks. We will try to incorporate some workaround(s) as you suggested.