C++ API Reference for Intel® Data Analytics Acceleration Library 2019 Update 5

conversion.h
1 /* file: conversion.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 #ifndef __DATA_MANAGEMENT_DATA_INTERNAL_CONVERSION_H__
17 #define __DATA_MANAGEMENT_DATA_INTERNAL_CONVERSION_H__
18 
19 #include "data_management/features/defines.h"
20 
21 namespace daal
22 {
23 namespace data_management
24 {
25 namespace internal
26 {
27 
28 /* Renamed from InternalNumType */
29 enum ConversionDataType
30 {
31  DAAL_SINGLE = 0,
32  DAAL_DOUBLE = 1,
33  DAAL_INT32 = 2,
34  DAAL_OTHER = 0xfffffff
35 };
36 
40 template<typename T>
41 inline ConversionDataType getConversionDataType() { return DAAL_OTHER; }
42 template<>
43 inline ConversionDataType getConversionDataType<int>() { return DAAL_INT32; }
44 template<>
45 inline ConversionDataType getConversionDataType<double>() { return DAAL_DOUBLE; }
46 template<>
47 inline ConversionDataType getConversionDataType<float>() { return DAAL_SINGLE; }
48 
49 
50 typedef void(*vectorConvertFuncType)(size_t n, const void *src,
51  void *dst);
52 
53 typedef void(*vectorStrideConvertFuncType)(size_t n, const void *src, size_t srcByteStride,
54  void *dst, size_t dstByteStride);
55 
56 DAAL_EXPORT vectorConvertFuncType getVectorUpCast(int, int);
57 DAAL_EXPORT vectorConvertFuncType getVectorDownCast(int, int);
58 
59 DAAL_EXPORT vectorStrideConvertFuncType getVectorStrideUpCast(int, int);
60 DAAL_EXPORT vectorStrideConvertFuncType getVectorStrideDownCast(int, int);
61 
62 #define DAAL_REGISTER_WITH_HOMOGEN_NT_TYPES(FUNC) \
63 FUNC(float) \
64 FUNC(double) \
65 FUNC(int) \
66 FUNC(unsigned int) \
67 FUNC(DAAL_INT64) \
68 FUNC(DAAL_UINT64) \
69 FUNC(char) \
70 FUNC(unsigned char) \
71 FUNC(short) \
72 FUNC(unsigned short) \
73 FUNC(long) \
74 FUNC(unsigned long)
75 
76 template<typename T> DAAL_EXPORT void vectorAssignValueToArray(T* const ptr, const size_t n, const T value);
77 
78 } // namespace internal
79 } // namespace data_management
80 } // namespace daal
81 
82 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::math::abs::value
Definition: abs_types.h:86

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