mirror of
https://github.com/amd/blis.git
synced 2026-05-11 09:39:59 +00:00
Details: - Added logic to bli_arch.c that will call what was previously the body of bli_arch_query_id() only once and then cache the value in a static variable local to the file. (Previously, the arch_t associated with the hardware/configuration was queried every time bli_arch_query_id() was called, which was at least once per level-3 function call. Thanks to Devin Matthews for suggesting this feature via issue #175. - Added -lpthread to the compile/link command line of the compiler invocation that compiles build/detect/config/config_detect.c, which prints the string identifying the detected configuration, since it is now needed due to new pthread_once() logic in bli_arch.c. - Implementation note: I chose to implement this arch_t caching feature via pthread_once(), using a separate pthread_once_t variable local to the file, rather than calling bli_init_once(). The reason is that I did not want to require bli_init() as a prerequisite to this function. bli_init() already calls several sub-components, some of which make use of bli_arch_query_id(), and therefore it would be easy to fall into a circular self-init situation (which usually causes pthreads to hang indefinitely).