C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 1

relu_types.h
1 /* file: relu_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of the rectified linear function interface.
45 //--
46 */
47 
48 #ifndef __RELU_TYPES_H__
49 #define __RELU_TYPES_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "data_management/data/csr_numeric_table.h"
54 #include "data_management/data/homogen_numeric_table.h"
55 #include "services/daal_defines.h"
56 
57 namespace daal
58 {
59 namespace algorithms
60 {
64 namespace math
65 {
75 namespace relu
76 {
81 enum Method
82 {
83  defaultDense = 0,
84  fastCSR = 1
85 };
86 
91 enum InputId
92 {
93  data,
94  lastInputId = data
95 };
96 
101 enum ResultId
102 {
103  value,
104  lastResultId = value
105 };
106 
110 namespace interface1
111 {
116 class DAAL_EXPORT Input : public daal::algorithms::Input
117 {
118 public:
120  Input();
121 
123  Input(const Input& other) : daal::algorithms::Input(other){}
124 
125  virtual ~Input() {}
126 
132  data_management::NumericTablePtr get(InputId id) const;
133 
139  void set(InputId id, const data_management::NumericTablePtr &ptr);
140 
148  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
149 };
150 
155 class DAAL_EXPORT Result : public daal::algorithms::Result
156 {
157 public:
158  DECLARE_SERIALIZABLE_CAST(Result);
160  Result();
161 
162  virtual ~Result() {};
163 
172  template <typename algorithmFPType>
173  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
174 
180  data_management::NumericTablePtr get(ResultId id) const;
181 
187  void set(ResultId id, const data_management::NumericTablePtr &ptr);
188 
197  services::Status check(const daal::algorithms::Input *in, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
198 
199 protected:
201  template<typename Archive, bool onDeserialize>
202  services::Status serialImpl(Archive *arch)
203  {
204  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
205  }
206 };
207 typedef services::SharedPtr<Result> ResultPtr;
208 
210 } // namespace interface1
211 using interface1::Input;
212 using interface1::Result;
213 using interface1::ResultPtr;
214 
215 } // namespace relu
216 } // namespace math
217 } // namespace algorithm
218 } // namespace daal
219 #endif
daal
Definition: algorithm_base_common.h:57
daal::algorithms::math::relu::value
Definition: relu_types.h:103
daal::algorithms::math::relu::InputId
InputId
Definition: relu_types.h:91
daal_defines.h
daal::algorithms::math::relu::interface1::Result
Results obtained with the compute() method of the rectified linear function in the batch processing m...
Definition: relu_types.h:155
daal::algorithms::math::relu::Method
Method
Definition: relu_types.h:81
daal::algorithms::math::relu::data
Definition: relu_types.h:93
daal::algorithms::math::relu::fastCSR
Definition: relu_types.h:84
daal::algorithms::math::relu::ResultId
ResultId
Definition: relu_types.h:101
daal::algorithms::math::relu::interface1::Input
Input objects for the rectified linear function
Definition: relu_types.h:116
daal::algorithms::math::relu::defaultDense
Definition: relu_types.h:83
daal::algorithms::math::relu::interface1::Input::Input
Input(const Input &other)
Definition: relu_types.h:123

For more complete information about compiler optimizations, see our Optimization Notice.