cl_variables.h 2.15 KB
/*
 * cl_variables.h
 *
 *  Created on: 01/12/2014
 *      Author: pedro
 */

#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

#include "../config.h"

#if CL_D_TYPE == CL_BITMAP
// for bitmap domains
struct cl_var_bitmap_ {
	cl_uint c_idx;	// index of vs_cs_index where this variable first constraint id is
	cl_ushort n_vals;	// number of values in the propagated domain
	cl_ushort n_cs;	// Number of constraints that constrain this variable
	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
};

struct cl_var_p_bitmap_ {
	cl_bitmap prop_d;	// propagated domain
	cl_ushort n_vals;	// number of values in the propagated domain
	cl_ushort min;
	cl_ushort max;
	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
#if CL_D_TYPE == CL_INTERVAL || !__OPENCL_VERSION__
// for interval domains
struct cl_var_interval_ {
	interval domain;
	cl_uint c_idx;	// index of vs_cs_index where this variable first constraint id is
	cl_ushort n_vals;	// number of values in the propagated domain
	cl_ushort n_cs;	// Number of constraints that constrain this variable
	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
};

// for interval domains
struct cl_var_p_interval_ {
	interval prop_d;	// propagated domain
	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_ */