22 #ifndef __ALGORITHM_BASE_COMMON_H__
23 #define __ALGORITHM_BASE_COMMON_H__
25 #include "services/daal_memory.h"
26 #include "services/daal_kernel_defines.h"
27 #include "services/error_handling.h"
28 #include "services/env_detect.h"
29 #include "algorithms/algorithm_types.h"
54 virtual ~AlgorithmIface() {}
59 virtual services::Status checkComputeParams() = 0;
64 virtual services::Status checkResult() = 0;
70 virtual int getMethod()
const = 0;
77 virtual services::SharedPtr<services::ErrorCollection> getErrors() = 0;
85 class AlgorithmIfaceImpl :
public AlgorithmIface
89 AlgorithmIfaceImpl() : _enableChecks(true)
94 virtual ~AlgorithmIfaceImpl() {}
100 void enableChecks(
bool enableChecksFlag)
102 _enableChecks = enableChecksFlag;
109 bool isChecksEnabled()
const
111 return _enableChecks;
119 services::SharedPtr<services::ErrorCollection> getErrors()
121 return _status.getCollection();
128 services::Status getEnvironment()
130 int cpuid = (int)daal::services::Environment::getInstance()->getCpuId();
132 return services::Status(services::ErrorCpuNotSupported);
134 _env.cpuid_init_flag =
true;
135 return services::Status();
138 daal::services::Environment::env _env;
139 services::Status _status;
144 using interface1::AlgorithmIface;
145 using interface1::AlgorithmIfaceImpl;
daal::services::ErrorCpuNotSupported
Definition: error_indexes.h:145
daal
Definition: algorithm_base_common.h:31
daal::algorithms::interface1::AlgorithmIface
Abstract class which defines interface for the library component related to data processing involving...
Definition: algorithm_base_common.h:49
daal::algorithms::interface1::AlgorithmIfaceImpl::AlgorithmIfaceImpl
AlgorithmIfaceImpl()
Definition: algorithm_base_common.h:89
daal::algorithms::interface1::AlgorithmIfaceImpl::isChecksEnabled
bool isChecksEnabled() const
Definition: algorithm_base_common.h:109
daal::algorithms::interface1::AlgorithmIfaceImpl
Implements the abstract interface AlgorithmIface. AlgorithmIfaceImpl is, in turn, the base class for ...
Definition: algorithm_base_common.h:85
daal::algorithms::interface1::AlgorithmIface::checkResult
virtual services::Status checkResult()=0
daal::algorithms::interface1::AlgorithmIface::getErrors
virtual services::SharedPtr< services::ErrorCollection > getErrors()=0
daal::algorithms::interface1::AlgorithmIfaceImpl::getErrors
services::SharedPtr< services::ErrorCollection > getErrors()
Definition: algorithm_base_common.h:119
daal::algorithms::interface1::AlgorithmIfaceImpl::enableChecks
void enableChecks(bool enableChecksFlag)
Definition: algorithm_base_common.h:100
daal::algorithms::interface1::AlgorithmIface::checkComputeParams
virtual services::Status checkComputeParams()=0
daal::algorithms::interface1::AlgorithmIface::getMethod
virtual int getMethod() const =0