cl_explore.h
2.02 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* cl_expore.h
*
* Created on: 10/09/2019
* Author: pedro
*/
#ifndef SRC_KERNELS_CL_EXPLORE_H_
#define SRC_KERNELS_CL_EXPLORE_H_
#ifndef __OPENCL_VERSION__
#include <stddef.h>
#include <stdio.h>
#include "cl_aux_functions.h"
#include "cl_propagators.h"
#include "../utils/cl_syntax.h"
#else
#include "cl_aux_functions.c"
#include "cl_propagators.c"
#endif
#define CL_PRINT_CSP 0 // 1 to print the CSP as received in the device, 0 to not print
#include "../config.h"
#include "../domains.h"
#include "cl_constraints.h"
#include "cl_variables.h"
#include "cl_ttl.h"
#if CL_D_TYPE == CL_BITMAP
#include "cl_bitmaps.h"
#elif CL_D_TYPE == CL_INTERVAL
#include "cl_intervals.h"
#endif
__kernel void explore( __global unsigned int* atoms, CL_INTS_MEM int* ints,
__global DOMAIN_* backtrack1,
#if CL_USE_N_BUFFERS > 1
__global DOMAIN_* backtrack2,
#endif
#if CL_USE_N_BUFFERS > 2
__global DOMAIN_* backtrack3,
#endif
#if CL_USE_N_BUFFERS > 3
__global DOMAIN_* backtrack4,
#endif
__global int* generic_mem,
#if CL_CS_IGNORE
__global char* cs_ignore_,
#endif
#if CL_WORK == CL_ONE || CL_WORK == CL_OPT
__global DOMAIN_* domains,
#endif
CL_VS_MEM VARS* vs, CL_CS_MEM cl_constr* cs,
CL_MEMORY VARS_PROP* vs_prop, CL_MEMORY unsigned short* vs_id_to_prop
#if CL_D_TYPE == CL_BITMAP
, CL_B_DS_MEM cl_bitmap* b_ds // when using bitmaps, this array contains the original domains of all the CSP variables
#endif
#if CL_STATS == 1
, __global unsigned long* stats // if statistics should be collected
#endif
#if CL_N_DEVS > 1
,
__global unsigned long* props // 1 per work-item for counting the number of propagations made by each work-item
#endif
#if CL_N_SHARED_SS > 0
, __global DOMAIN_* shared_ss // stores for work-sharing
, __global int* shared_ss_flags
#endif
#if CL_FILTERING
, __global DOMAIN_* filt_domains // when filtering the CSP for the domains of the variables
, __global char* filt_cs // when filtering the CSP for the flag of ignoring constraints
#endif
);
#endif /* SRC_KERNELS_CL_EXPLORE_H_ */