24 #ifndef __ALGORITHM_BASE_COMMON_H__
25 #define __ALGORITHM_BASE_COMMON_H__
27 #include "services/daal_memory.h"
28 #include "services/daal_kernel_defines.h"
29 #include "services/error_handling.h"
30 #include "services/env_detect.h"
31 #include "algorithms/algorithm_types.h"
56 virtual ~AlgorithmIface() {}
61 virtual services::Status checkComputeParams() = 0;
66 virtual services::Status checkResult() = 0;
72 virtual int getMethod()
const = 0;
79 virtual services::SharedPtr<services::ErrorCollection> getErrors() = 0;
87 class AlgorithmIfaceImpl :
public AlgorithmIface
91 AlgorithmIfaceImpl() : _enableChecks(true)
96 virtual ~AlgorithmIfaceImpl() {}
102 void enableChecks(
bool enableChecksFlag)
104 _enableChecks = enableChecksFlag;
111 bool isChecksEnabled()
const
113 return _enableChecks;
121 services::SharedPtr<services::ErrorCollection> getErrors()
123 return _status.getCollection();
130 services::Status getEnvironment()
132 int cpuid = (int)daal::services::Environment::getInstance()->getCpuId();
134 return services::Status(services::ErrorCpuNotSupported);
136 _env.cpuid_init_flag =
true;
137 return services::Status();
140 daal::services::Environment::env _env;
141 services::Status _status;
146 using interface1::AlgorithmIface;
147 using interface1::AlgorithmIfaceImpl;
daal::algorithms::interface1::AlgorithmIfaceImpl::getErrors
services::SharedPtr< services::ErrorCollection > getErrors()
Definition: algorithm_base_common.h:121
daal::algorithms::interface1::AlgorithmIfaceImpl
Implements the abstract interface AlgorithmIface. AlgorithmIfaceImpl is, in turn, the base class for ...
Definition: algorithm_base_common.h:87
daal::algorithms::interface1::AlgorithmIface::getErrors
virtual services::SharedPtr< services::ErrorCollection > getErrors()=0
daal::algorithms::interface1::AlgorithmIface
Abstract class which defines interface for the library component related to data processing involving...
Definition: algorithm_base_common.h:51
daal::algorithms::interface1::AlgorithmIfaceImpl::isChecksEnabled
bool isChecksEnabled() const
Definition: algorithm_base_common.h:111
daal::algorithms::interface1::AlgorithmIface::checkComputeParams
virtual services::Status checkComputeParams()=0
daal::algorithms::interface1::AlgorithmIface::checkResult
virtual services::Status checkResult()=0
daal::algorithms::interface1::AlgorithmIfaceImpl::AlgorithmIfaceImpl
AlgorithmIfaceImpl()
Definition: algorithm_base_common.h:91
daal::algorithms::interface1::AlgorithmIfaceImpl::enableChecks
void enableChecks(bool enableChecksFlag)
Definition: algorithm_base_common.h:102
daal::services::ErrorCpuNotSupported
Definition: error_indexes.h:149
daal::algorithms::interface1::AlgorithmIface::getMethod
virtual int getMethod() const =0