Skip to content

Improvement to SHF

Choose a tag to compare

@stephen-hqxu stephen-hqxu released this 20 Mar 18:41
3cdd882

Release 0.16.4

STPThreadPool

This release adds automatic loop parallelisation for thread pool, includes splitting a number of loop iteartion into equal-size blocks, and dispatch each block in parallel.

STPSingleHistogramFilter (#54)

This release brings some improvements to our SHF and it is now more efficient.

  • Now intermediate filter working memory is stored along with the user-managed filter buffer rather than keeping it within an object pool in the internal filter implementation.
  • Remove use of allocator traits for STPArrayList, and make it simple to use either default memory allocator or pinned. This reduces the memory consumption by more than a half because std::function is very big.
  • Remove use of union in the data structure, and use template instead. So we don't need an access modifier for that any more.
  • Replace most std::copy with std::memcpy; it is about 10% faster.
  • Improve internal dynamic array memory expansion. Now it no longer doubles the size when resized or inserting N members based on the new size, but chosen smartly between this and the original capacity. This helps to cut-down over-allocation.
  • Simplify the implementation significantly because the data structure no longer has private members.
  • Make all fields in STPSingleHistogram to use const T* instead of T* because they are not intended to be modified by the user.
  • General refactor.
  • Update documentation.

Single-thread

To make the filter suitable for a wider variety of problem size, it now supports running in serial mode. Whether the filter is run on serial or parallel mode depends on the type of filter buffer user pass to the filter. A serial filter buffer can only be run on serial filter, while parallel filter buffer can be run on both version, and will be forced to serial version if the problem size is too small.

General fixes and improvement

  • Remove unnecessary typename from STPTestNearestNeighbour.
  • Make all global variable in the configuration files (those .h.in files) inline rather than static.
  • Add a new configuration file containing version information.
    • Add version printing for the demo program.
  • Use std::optional as return match length for STPRegularLanguage.
  • STPSmartDeviceMemory: Now allows array type specialisation. This is useful for memory accessible on host, e.g., pinned memory. Although the deleter is the same, it allows using the array access operator. Also refactor a little bit.
  • Use heap memory to store the log to avoid blowing up the stack in STPCommonCompiler.
  • CMake downloaded external resources now are placed in a directory with version number encoded, which allows CMake to automatically detect and re-download whenever necessary if any of the 3rd-party library is updated.
  • Add nanobench as a new dependency for benchmarking, whose code will be integrated in SuperTest+.
  • Bump CMake version to 3.20 minimum.
  • Bump stb_image version to 2.28.

STPCommandLineParser

  • Nested name refactor for STPCommandLineParser.inl.
  • Allow nested type for argument conversion, and user-defined argument conversion function.
  • Use move when returning option table.
  • Fix a bug for allowing using short name when a long name option control is used.

STPDemo

  • The demo application now uses a unified RNG seed value for simplicity.
  • Add more command line options.
  • Make demo program version information more concise.
  • STPBiomefieldGenerator now selects appropriate filter execution type based on the map dimension.