llvm icon indicating copy to clipboard operation
llvm copied to clipboard

SYCLPropagateAspecUsage pass: compiler and runtime must not be tied to each other

Open AlexeySachkov opened this issue 3 years ago • 0 comments

The issue is submitted as a follow-up from #5348, where @bader highlighted a design problem: our compiler implementation of optional kernel features design is too tied with the runtime implementation, which is a bad design choice and it could cause hard-to-debug issues in the future.

In particular, see the following two comments:

  1. first: we have a hardcoded map from sycl::aspect enum to a string which is used to print nice diagnostic messages. The problem here is that: (a) enum must be regularly updated in sync with its actual definition in runtime headers and (b) that hardcoded mapping could be incompatible with other SYCL implementations using our compiler (for example in downstreams)
  2. second: we have a hardcoded magic value 6, which corresponds to aspect::fp64. This has the same issues as (1), but on top of that mismatch of the value between the runtime and the compiler could cause functional issues later on: compiler will report that double is used, whilst runtime will think that some other aspect is used or vice-versa

AlexeySachkov avatar Mar 25 '22 13:03 AlexeySachkov