Hey,
Is there a place with all AMD OpenCL compilation flags ?
I am searching for stuff like max-register-usage, fast-math, enable-compilation-time-expensive-optimizations, dont-be-ieee-compatible, -05, all-global-pointers-are-restrict ...
If not driver options, is there a way to do something like those stuff that I mentioned above ?
Thanks.
As far as I can recall max-register-usage has been in the works for quite a while. It doesn't exist yet.
I'm not sure what the others do but there are some ieee unsafe optimizations in CL specs (such as -cl-unsafe-math-optimizations) I assume that's still not enough for you.
Others are interesting. I would be more interested in providing the compiler some profiler-derived hints such as "this kernel has been observed to be bigger than ISA size" / "to overspill" etc.
I've missed the standart OCL flags like -cl-unsafe-math-optimizations, so thank you for that. They are part of the stuff I needed.
I am glad max-reg-count is comming at some point, it will help a lot too.
"all-global-pointers-are-restrict" should tell the compiler to presume that there is no pointer aliasing between pointers from the global memory (this should enable some more optimizations too).
Thanks.
There was the option -cl-strict-aliasing back in the OpenCL 1.0 days. But I don't know if it is still avalaible, or just assumed by default now.
Let assume that I have only 1 thread. If aliasing is assumed by default, this won't work if a and val points to the same memory location ...
void add(int* ptrA, int* ptrB, int* val) {
*ptrA += *val;
*ptrB += *val;
}
-cl-strict-aliasing seems to compile, but I still have to test if it works properly.