iris: Fill out compute caps and enable clover support
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 20 Aug 2020 22:10:59 +0000 (17:10 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 7 Oct 2020 21:03:10 +0000 (16:03 -0500)
commit1d3600c156fa48e745d6174ff90ee39df2ff9ee6
treeb204f28382c54b0388f76b3cb758fc2ea35b0978
parent9df9f940f01d10a5b2a11abdd5ca9f59f75d93d0
iris: Fill out compute caps and enable clover support

This commit enables clover support for iris.  It is intended as a
compiler developer tool and not as a new OpenCL implementation from
Intel.  If you want competent OpenCL, we have a different open-source
driver for that built on our LLVM-based IGC compiler stack.  However,
using clover with iris is becoming increasingly useful as a compiler
development tool and I'm getting tired of carrying the patches in a
private branch.

By default, clover will not initialize on iris.  To enable clover, set
the IRIS_ENABLE_CLOVER environment variable to "1" or "true".  As we've
done with the semi-sketchy platform support in ANV, it dumps a very loud
WARNING to stderr when enabled.  Use at your own risk.

NOTE: To anyone intending to benchmark this, the performance is going to
be terrible and that is expected.  This is in no way representative of
the Intel/NIR compiler stack.  As it currently stands, clover passes
-O0 to clang when compiling OpenCL C to make SPIRV-LLVM-Transator work.
When compiling the SPIR-V, clover currently doesn't run any NIR
optimizations before it lowers memory access so any NIR optimizations
iris attempts to do are severely hampered.  One day, clover will get a
NIR optimization loop or the ability to hand things off to the driver
per-lowering but today is not that day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7047>
src/gallium/drivers/iris/iris_screen.c