Blame view

Debug/src/kernels/cl_variables.h 2.85 KB
0c8ce2b0   Pedro Roque   missing files
1
2
3
4
/*
 * cl_variables.h
 *
 *  Created on: 01/12/2014
4d26a735   Pedro Roque   Increased recogni...
5
 *      Author: Pedro
0c8ce2b0   Pedro Roque   missing files
6
7
8
9
10
11
12
13
14
15
 */

#ifndef SRC_KERNELS_CL_VARIABLES_H_
#define SRC_KERNELS_CL_VARIABLES_H_

#ifndef __OPENCL_VERSION__
#include "CL/cl.h"
#include "CL/cl_platform.h"
#endif

4d26a735   Pedro Roque   Increased recogni...
16
#include "../domains.h"
0c8ce2b0   Pedro Roque   missing files
17
18
19
#include "../config.h"

#if CL_D_TYPE == CL_BITMAP
4d26a735   Pedro Roque   Increased recogni...
20
// constant among all the exploration process for bitmaps
0c8ce2b0   Pedro Roque   missing files
21
struct cl_var_bitmap_ {
4d26a735   Pedro Roque   Increased recogni...
22
23
24
	cl_uint c_idx;		// index of vs_cs_index where this variable first constraint id is
	cl_ushort n_vals;	// number of values int his variable domain, before ss creation
	cl_ushort n_cs;		// Number of constraints that constrain this variable
0c8ce2b0   Pedro Roque   missing files
25
26
27
	cl_char to_label;	// 1 if this variable is set for being labeled and 0 if not
	cl_char expanded;	// 1 if this variable was fully expanded during sub-search space creation, or 0 if not
	cl_char boolean;	// 1 if this variable is a boolean or 0 if not
4d26a735   Pedro Roque   Increased recogni...
28
29
30
31
#if FZN_SEQ || CL_FZN_SEQ
	cl_char label_h;	// Labeling heuristic for which this variables may be selected in FlatZinc models
	cl_char assign_h;	// Assign heuristic for which this variables may be selected in FlatZinc models
#endif
0c8ce2b0   Pedro Roque   missing files
32
33
};

4d26a735   Pedro Roque   Increased recogni...
34
// used when propagating the current ss for bitmaps
0c8ce2b0   Pedro Roque   missing files
35
struct cl_var_p_bitmap_ {
4d26a735   Pedro Roque   Increased recogni...
36
37
38
39
	cl_bitmap prop_d;	// variable domain
	cl_ushort n_vals;	// current number of values
	cl_ushort min;		// current minimum value
	cl_ushort max;		// current maximum value
0c8ce2b0   Pedro Roque   missing files
40
41
42
43
44
45
46
47
	cl_char to_prop;	// 1 if this variable is set for being propagated and 0 if not
	cl_char boolean;	// 1 if this variable is a boolean or 0 if not
};

typedef struct cl_var_bitmap_ cl_var_bitmap;
typedef struct cl_var_p_bitmap_ cl_var_p_bitmap;

#endif
4d26a735   Pedro Roque   Increased recogni...
48

0c8ce2b0   Pedro Roque   missing files
49
#if CL_D_TYPE == CL_INTERVAL || !__OPENCL_VERSION__
4d26a735   Pedro Roque   Increased recogni...
50
// constant among all the exploration process for intervals
0c8ce2b0   Pedro Roque   missing files
51
struct cl_var_interval_ {
4d26a735   Pedro Roque   Increased recogni...
52
53
	interval domain;	// variable domain
	cl_uint c_idx;		// index of vs_cs_index where this variable first constraint id is
0c8ce2b0   Pedro Roque   missing files
54
	cl_ushort n_vals;	// number of values in the propagated domain
4d26a735   Pedro Roque   Increased recogni...
55
	cl_ushort n_cs;		// Number of constraints that constrain this variable
0c8ce2b0   Pedro Roque   missing files
56
57
58
	cl_char to_label;	// 1 if this variable is set for being labeled and 0 if not
	cl_char expanded;	// 1 if this variable was fully expanded during sub-search space creation, or 0 if not
	cl_char boolean;	// 1 if this variable is a boolean or 0 if not
4d26a735   Pedro Roque   Increased recogni...
59
60
61
62
#if FZN_SEQ || CL_FZN_SEQ
	cl_char label_h;	// Labeling heuristic for which this variables may be selected in FlatZinc models
	cl_char assign_h;	// Assign heuristic for which this variables may be selected in FlatZinc models
#endif
0c8ce2b0   Pedro Roque   missing files
63
64
};

4d26a735   Pedro Roque   Increased recogni...
65
// used when propagating the current ss for intervals
0c8ce2b0   Pedro Roque   missing files
66
struct cl_var_p_interval_ {
4d26a735   Pedro Roque   Increased recogni...
67
	interval prop_d;	// variable domain
0c8ce2b0   Pedro Roque   missing files
68
69
70
71
72
73
74
75
76
77
	cl_char to_prop;	// 1 if this variable is set for being propagated and 0 if not
	cl_char boolean;	// 1 if this variable is a boolean or 0 if not
};

typedef struct cl_var_interval_ cl_var_interval;
typedef struct cl_var_p_interval_ cl_var_p_interval;

#endif

#endif /* SRC_KERNELS_CL_VARIABLES_H_ */