Cache context offline device setting specified by environment variables#235
Cache context offline device setting specified by environment variables#235pcolberg merged 1 commit intointel:mainfrom
Conversation
pcolberg
left a comment
There was a problem hiding this comment.
Thanks @sophimao, looks good. Please see two minor nitpicks below.
There remain two further calls of acl_get_offline_device_user_setting() as detailed below. Why are these still needed, i.e., why can't they use the cached setting? This might be worthwhile commenting on in the commit message.
fpga-runtime-for-opencl/src/acl_globals.cpp
Lines 161 to 173 in 3c5c4f2
fpga-runtime-for-opencl/src/acl_hal_mmd.cpp
Lines 1250 to 1251 in 3c5c4f2
These are called before the variable is cached. The reason why I cached the variable in I personally think it is cleaner to cache the variable in the |
I see. The call graph here is so to avoid multiple calls,
Yes, this is about design only, and now I think your commit is fine without further comment. Let's keep this commit as is for 2023.1 and work out the full design in #234. |
Yes, for the regular flow that is correct. However, for unit test, there is another call graph: So we would also need to add a call to I will keep the design this way for now, and address this in #234. |
Currently runtime queries context offline device setting from environment variables whenever this setting is needed, therefore introduces performance overhead. The caching is done to avoid this performance overhead.
3c5c4f2 to
8ea53b9
Compare
Of course, I missed that despite being right above the other entry point 🤦
The separate entry points for testing and production are unfortunate, but that topic should probably be handled separately from the revision in #234. I suggest you rebase that PR onto the |
Currently runtime queries context offline device setting from environment variables whenever this setting is needed, therefore introduces performance overhead. The caching is done to avoid this performance overhead.