add cl_offline_compiler.example#2684
Conversation
Now that we require SPIR-V everywhere, we should make it easier for implementations to actually test tests in the SPIR-V mode. This file can be tweaked according to runtime details, but it should provide a good base already and it's what I'm using in my testing.
| # | ||
| # optional arguments: | ||
| # --source FILE OpenCL C source file to compile | ||
| # --output FILE SPIR-V or binary file to create |
There was a problem hiding this comment.
Usually, compilers use the -o FILE for output, so we should try to match that
| # BUILD_OPTIONS additional options to pass to the compiler | ||
| # | ||
| # optional arguments: | ||
| # --source FILE OpenCL C source file to compile |
There was a problem hiding this comment.
I'm not sure we need a --source command line opt at all.
Most compiler take this as a positional argument, so we could match that.
There was a problem hiding this comment.
This is how the CTS is using it, I just copied this comment from from test_common/harness/cl_offline_compiler-interface.txt
| # --source FILE OpenCL C source file to compile | ||
| # --output FILE SPIR-V or binary file to create | ||
| # --cl-device-info FILE OpenCL device info file | ||
| # --mode compilation mode (spir-v or binary) |
There was a problem hiding this comment.
This doesn't really need to be explicit, right? We could infer this by the output file extension (.spv or .bin).
There was a problem hiding this comment.
Yeah.. sure but I'd rather not change the interface in case anybody else is also using this interface already, so the plan was here to just implement it as expected.
| if info[0] == '#': | ||
| continue | ||
| info = info.strip('\r\n') | ||
| split = info.split('=') |
There was a problem hiding this comment.
I was wondering.. does anybody know of a good library to parse those kind of property files so we don't have to do it in a terrible way like here?
There was a problem hiding this comment.
I think this feels like the INI config parsing that we have in Python's configparser: https://docs.python.org/3/library/configparser.html
Would that work?
Now that we require SPIR-V everywhere, we should make it easier for implementations to actually test tests in the SPIR-V mode.
This file can be tweaked according to runtime details, but it should provide a good base already and it's what I'm using in my testing.
There are a few gaps in handling extensions properly, but my hope is that we can collectively improve on this one to make it viable to be used across many different implementations.