-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.h
57 lines (42 loc) · 1.14 KB
/
Config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Parallel discords search algorithm for Intel Xeon Phi architecture
* Program configuration and defines
* (c) 2018 Mikhail Zymbler, Andrei Poliakov
*/
#ifndef CONFIG_H
#define CONFIG_H
#include <malloc.h>
/* Algorithm params */
// in the future there can be param k - number of discord
/* Types and defines */
// Types
// An item
typedef float item_t;
// Time series
typedef item_t* series_t;
// Different matrixes: distance and subsequences
typedef item_t** matrix_t;
// for SAX representation of time series
typedef char symbol;
typedef symbol* word;
// Memory and alignment
#ifdef __x86_64__
#define MY_ASSUME_ALIGNED(x) ((void)0)
#else
#define MY_ASSUME_ALIGNED(x) __assume_aligned((x),ALIGN_SIZE)
#endif
// Size of alignment for all the data thru the project
#define ALIGN_SIZE (64)
// Memory allocation with alignment
#ifdef __x86_64__
#define __align_malloc(cnt) malloc((cnt))
#else
#define __align_malloc(cnt) _mm_malloc((cnt), ALIGN_SIZE)
#endif
// Free memory allocated with alignment
#define __align_free(ptr) _mm_free((ptr))
// Math
#define POS_INF (1e20)
#define NEG_INF -(POS_INF)
#define MAX_LONG (9999999999)
#endif