Intel® Data Analytics Acceleration Library - The "parameter" field in "Batch" class in the context of backward compatibility

Published: 06/28/2019  

Last Updated: 06/28/2019

By Gennady Fedorov

Some algorithms in Intel DAAL have the field with name "parameter" in class "Batch". Please see the code example below:
 
//start of code block
template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
class DAAL_EXPORT Batch : public BatchImpl
{
public:
    typedef BatchImpl super;
 
    typedef typename super::InputType  InputType;
    typedef algorithms::normalization::zscore::Parameter<algorithmFPType, method> ParameterType;
    typedef typename super::ResultType  ResultType;
 
    Parameter<algorithmFPType, method> parameter;
//end of code block
 
As part of work under improving the backward compatibility approach and its flexibility, the decision to replace the "parameter" field to method "parameter()" with the following signature:
 
//start of code block
virtual ParameterType& parameter();
virtual const ParameterType& parameter() const;  
 //end of code block
 
was made. The users of previous releases with the static linking of daal are affected. Also the method with the following signature:
//start of the code block
virtual ParameterType& getParameter();
 //end of the code block
was deprecated. The changes were introduced only for the Zscore algorithm since 2019 u4 release but should be applied for reminded algorithms in the next releases with separated notification.
  
Suggested workaround:
•    If you use the static linking of Intel DAAL you should add the empty braces the following way
//start of code block
normalization::zscore::Batch<float, normalization::zscore::sumDence> normalizationAlg;
/* DOESN'T WORK */
normalizationAlg.parameter.moments;
 
/*WORKS NOW*/
normalizationAlg.parameter().moments;
//end of code block
 
and rebuild your application.
•    If you use the dynamic linking of Intel DAAL no actions required.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.