Developer Guide


Providing a Callback for the Host Application

Intel® DAAL provides a possibility for the host application to register a callback interface to be called by the library, e.g. for the purposes of computation interruption. It is done by means of an abstract interface for the host application of the library HostAppIface. In order to use it, the application should define an instance of the class derived from the abstract interface and set its pointer to an instance of Algorithm class.
Following methods of the Algorithm class are used:
(const services::HostAppIfacePtr& pHost)
Set pHost as the callback interface
Get current value of the callback interface set on the Algorithm
HostAppIface class includes following methods:
Enables computation cancelling. The method is called by the owning algorithm when computation is in progress. If the method returns true then computation stops and returns
status. Since the method can be called from parallel threads when running with DAAL threaded version, it is application responsibility to make its implementation thread-safe. It is not recommended for this method to throw exceptions.
Currently HostAppIface is supported in C++ only, cancelling is available with limited number of algorithms as follows: decision forest, gradient boosted trees.

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804