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

conversion.h
1 /* file: conversion.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 #ifndef __DATA_MANAGEMENT_DATA_INTERNAL_CONVERSION_H__
19 #define __DATA_MANAGEMENT_DATA_INTERNAL_CONVERSION_H__
20 
21 #include "data_management/features/defines.h"
22 
23 namespace daal
24 {
25 namespace data_management
26 {
27 namespace internal
28 {
29 
30 /* Renamed from InternalNumType */
31 enum ConversionDataType
32 {
33  DAAL_SINGLE = 0,
34  DAAL_DOUBLE = 1,
35  DAAL_INT32 = 2,
36  DAAL_OTHER = 0xfffffff
37 };
38 
42 template<typename T>
43 inline ConversionDataType getConversionDataType() { return DAAL_OTHER; }
44 template<>
45 inline ConversionDataType getConversionDataType<int>() { return DAAL_INT32; }
46 template<>
47 inline ConversionDataType getConversionDataType<double>() { return DAAL_DOUBLE; }
48 template<>
49 inline ConversionDataType getConversionDataType<float>() { return DAAL_SINGLE; }
50 
51 typedef void (*vectorConvertFuncType)(size_t n, const void * src, void * dst);
52 typedef void (*vectorStrideConvertFuncType)(size_t n, const void * src, size_t srcByteStride, void * dst, size_t dstByteStride);
53 
54 typedef bool (*vectorCopy2vFuncType)(const size_t nrows, const size_t ncols, void * dst, void const * ptrMin, DAAL_INT64 * arrOffsets);
55 
56 template <typename T>
57 DAAL_EXPORT vectorCopy2vFuncType getVector();
58 template <>
59 DAAL_EXPORT vectorCopy2vFuncType getVector<int>();
60 template <>
61 DAAL_EXPORT vectorCopy2vFuncType getVector<float>();
62 template <>
63 DAAL_EXPORT vectorCopy2vFuncType getVector<double>();
64 
65 DAAL_EXPORT vectorConvertFuncType getVectorUpCast(int, int);
66 DAAL_EXPORT vectorConvertFuncType getVectorDownCast(int, int);
67 
68 DAAL_EXPORT vectorStrideConvertFuncType getVectorStrideUpCast(int, int);
69 DAAL_EXPORT vectorStrideConvertFuncType getVectorStrideDownCast(int, int);
70 
71 #define DAAL_REGISTER_WITH_HOMOGEN_NT_TYPES(FUNC) \
72 FUNC(float) \
73 FUNC(double) \
74 FUNC(int) \
75 FUNC(unsigned int) \
76 FUNC(DAAL_INT64) \
77 FUNC(DAAL_UINT64) \
78 FUNC(char) \
79 FUNC(unsigned char) \
80 FUNC(short) \
81 FUNC(unsigned short) \
82 FUNC(long) \
83 FUNC(unsigned long)
84 
85 template<typename T> DAAL_EXPORT void vectorAssignValueToArray(T* const ptr, const size_t n, const T value);
86 
87 } // namespace internal
88 } // namespace data_management
89 } // namespace daal
90 
91 #endif
daal::algorithms::math::abs::value
Definition: abs_types.h:88

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