Previously, disabling the sba via --disable-sba-pools resulted in a segfault due to a sanity-check-triggering abort(). The problem was that the sba, as currently used in the l3 thread decorators, did not yet (fully) support pools being disabled. The solution entailed creating wrapper function, bli_sba_array_elem(), which either calls bli_apool_array_elem() (when sba pools are enabled at configure time) or returns a NULLsba_pool pointer (when sba pools are disabled), and calling bli_sba_array_elem() in place of bli_apool_array_elem(). Note that the NULL pointer returned by bli_sba_array_elem() when the sba pools are disabled does no harm since in that situation the pointer goes unreferenced when acquiring and releasing small blocks. Thanks to John Mather for reporting this bug.
Guarded the bodies of bli_sba_init() and bli_sba_finalize() with #ifdef BLIS_ENABLE_SBA_POOLS. I don't think this was actually necessary to fix the aforementioned bug, but it seems like good practice.
Moved the code in bli_l3_thrinfo_create() that checked that the array* pointer is non-NULL before calling bli_sba_array_elem() (previously bli_apool_array_elem()) into the definition of bli_sba_array_elem().
Renamed various instances of pool variables and function parameters to sba_pool to emphasize what kind of pool it represents.
Details:
--disable-sba-pools
resulted in a segfault due to a sanity-check-triggeringabort()
. The problem was that the sba, as currently used in the l3 thread decorators, did not yet (fully) support pools being disabled. The solution entailed creating wrapper function,bli_sba_array_elem()
, which either callsbli_apool_array_elem()
(when sba pools are enabled at configure time) or returns aNULL
sba_pool
pointer (when sba pools are disabled), and callingbli_sba_array_elem()
in place ofbli_apool_array_elem()
. Note that theNULL
pointer returned bybli_sba_array_elem()
when the sba pools are disabled does no harm since in that situation the pointer goes unreferenced when acquiring and releasing small blocks. Thanks to John Mather for reporting this bug.bli_sba_init()
andbli_sba_finalize()
with#ifdef BLIS_ENABLE_SBA_POOLS
. I don't think this was actually necessary to fix the aforementioned bug, but it seems like good practice.bli_l3_thrinfo_create()
that checked that thearray*
pointer is non-NULL
before callingbli_sba_array_elem()
(previouslybli_apool_array_elem()
) into the definition ofbli_sba_array_elem()
.pool
variables and function parameters tosba_pool
to emphasize what kind of pool it represents.cc: @jmather-sesi