Fix CSR query issue to enable new CSR protocal #200
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The SYCL runtime queries device info before we even program our aocx. In our opencl runtime, the function clGetDeviceInfoIntelFPGA() is called whenever a device property is queried. Some properties require the runtime to create an opencl context which queries the auto discovery string and CSR version from our FPGA device. So what's happening in the code is that SYCL will query 7 device properties that would need to trigger a clCreateContext which queries the auto discovery string and kernel CSR. Note that this device info querying stage happens before the runtime programs the .aocx bitstream compiled by our compiler. Therefore, the when we first run the .exe program after doing a "aocl initialize acl0 pac_a10", the device info querying stage would query kernel information of the defualt aocx provided by the BSP (if your on pac_a10 it's called "pac_a10.aocx"). That aocx is compiled with a very old version of the compiler which explains why we are getting CSR version 4 initially.
In hardware runs, it seems that there are some dummy kernels present that messes up with the CSR check (the dummy kernels have a csr version of 4). When the runtime checks the csr for thedummydefualt kernels, they will overwrite the default cra_address_offset causing errors with the new compiler change. Adding this "else" statement will make sure that the cra_address_offset is set correctly.For the current runtime, everything still works since the issue is not with backwards compatibility.
My previous sycl-l3 runs escaped this issue because I did not enable runtime backwards compatibility support back then.