2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#include "hip/hip_runtime.h"
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								#include <thrust/device_vector.h>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#include <thrust/scan.h>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#include <stdlib.h>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#include "memory.h"
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#include "bpreds.h"
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*Mark all rows that comply with the selections*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								__global__ void marcar2(int *dop1, int rows, int cols, int *cons, int numc, int *res)
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 	extern __shared__ int shared[];
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int id = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int x, rowact, posact;
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if(hipThreadIdx_x < numc)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										shared[hipThreadIdx_x] = cons[hipThreadIdx_x];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									__syncthreads();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(id < rows)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rowact = id * cols;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for(x = 0; x < numc; x += 2)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											posact = rowact + shared[x];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if(dop1[posact] != shared[x+1])
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										res[id] = 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*If we already have an array of marks (perhaps because the selfjoin was applied first), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								we unmark any rows that do not comply with the selections*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								__global__ void marcar(int *dop1, int rows, int cols, int *cons, int numc, int *res)
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									extern __shared__ int shared[];
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int id = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int x, rowact, posact;
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if(hipThreadIdx_x < numc)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										shared[hipThreadIdx_x] = cons[hipThreadIdx_x];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									__syncthreads();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(id < rows)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if(res[id] == 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rowact = id * cols;
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										for(x = 0; x < numc; x += 2)
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											posact = rowact + shared[x];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if(dop1[posact] != shared[x+1])
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												res[id] = 0;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*Unmark all rows that do not comply with the selfjoins.*/
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								__global__ void samejoin(int *dop1, int rows, int cols, int *dhead, int cont, int *res)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									extern __shared__ int shared[];
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int id = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int temp, temp2, pos, x, y;
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if(hipThreadIdx_x < cont)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										shared[hipThreadIdx_x] = dhead[hipThreadIdx_x];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									__syncthreads();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(id < rows)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if(res[id] == 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										pos = id * cols;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for(x = 0; x < cont; x++)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											temp = dop1[pos+shared[x]];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											y = x + 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											temp2 = shared[y];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while(temp2 > -1)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if(temp != dop1[temp2+pos])
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													res[id] = 0;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												y++;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												temp2 = shared[y];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											x = y;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*Mark all rows that comply with the selfjoins*/
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								__global__ void samejoin2(int *dop1, int rows, int cols, int *dhead, int cont, int *res)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									extern __shared__ int shared[];
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int id = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int temp, temp2, pos, x, y;
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if(hipThreadIdx_x < cont)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										shared[hipThreadIdx_x] = dhead[hipThreadIdx_x];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									__syncthreads();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(id < rows)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										pos = id * cols;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for(x = 0; x < cont; x++)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											temp = dop1[pos+shared[x]];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											y = x + 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											temp2 = shared[y];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while(temp2 > -1)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if(temp != dop1[temp2+pos])
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
													return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												y++;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												temp2 = shared[y];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											x = y;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										res[id] = 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*Project all columns found in 'dhead' to a new array 'res'*/
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								__global__ void proyectar(int *dop1, int rows, int cols, int *dhead, int hsize, int *res)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									extern __shared__ int shared[];
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int id = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int pos, posr, x;
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if(hipThreadIdx_x < hsize)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										shared[hipThreadIdx_x] = dhead[hipThreadIdx_x];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									__syncthreads();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(id < rows)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										pos = id * cols;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										posr = id * hsize;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for(x = 0; x < hsize; x++, posr++)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											res[posr] = dop1[pos+shared[x]];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*Project all columns found in 'dhead' using only the rows marked as valid (i.e. those that complied with 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								selections, selfjoins, etc.). The array 'temp' holds the result of the prefix sum of said marks.*/
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								__global__ void llenarproyectar(int *dop1, int rows, int cols, int *temp, int *dhead, int hsize, int *res)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									extern __shared__ int shared[];
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int id = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int pos, posr, x;
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if(hipThreadIdx_x < hsize)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										shared[hipThreadIdx_x] = dhead[hipThreadIdx_x];
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									__syncthreads();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(id < rows)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{		
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										posr = temp[id];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if(temp[id+1] != posr)
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											pos = id * cols;
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											posr *= hsize;			
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											for(x = 0; x < hsize; x++, posr++)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												res[posr] = dop1[pos+shared[x]];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*Performs selections, selfjoins and comparison predicates when the rule has a single normal predicate.*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int selectproyect(int *dop1, int rows, int cols, int head_size, int *select, int numselect, int *selfjoin, int numselfj, int *preds, int numpreds, int *project, int **ret, int ANDlogic)
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int *fres = NULL, *temp = NULL;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int *dhead = NULL, tmplen;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int size, size2, num;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									thrust::device_ptr<int> res;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-16 16:19:03 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if TIMER
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									cuda_stats.selects++;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#endif
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int head_bytes = maximo(4, numselect, numselfj, numpreds, head_size) * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									reservar(&dhead, head_bytes);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int numthreads = 1024;
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									//int numthreads = 32;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int blockllen = rows / numthreads + 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									#ifdef ROCKIT
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ANDlogic = 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									#endif
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if(numselect > 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmplen = rows + 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										size2 = tmplen * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										reservar(&temp, size2);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										hipMemset(temp, 0, size2);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										size = numselect * sizeof(int);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										hipMemcpy(dhead, select, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										hipLaunchKernel(HIP_KERNEL_NAME(marcar2), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numselect, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if(numselfj > 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											size = numselfj * sizeof(int);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											hipMemcpy(dhead, selfjoin, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hipLaunchKernel(HIP_KERNEL_NAME(samejoin), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numselfj, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if(numpreds > 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											size = numpreds * sizeof(int);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											hipMemcpy(dhead, preds, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if(ANDlogic)
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipLaunchKernel(HIP_KERNEL_NAME(bpredsnormal), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numpreds, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											else
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipLaunchKernel(HIP_KERNEL_NAME(bpredsorlogic), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numpreds, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										res = thrust::device_pointer_cast(temp);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										thrust::inclusive_scan(res + 1, res + tmplen, res + 1);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										num = res[rows];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if(num == 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return 0;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										size = head_size * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										reservar(&fres, num * size);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										hipMemcpy(dhead, project, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										hipLaunchKernel(HIP_KERNEL_NAME(llenarproyectar), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, temp, dhead, head_size, fres);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										hipFree(dhead);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										hipFree(temp);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										*ret = fres;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return num;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if(numselfj > 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											tmplen = rows + 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											size2 = tmplen * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											reservar(&temp, size2);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											hipMemset(temp, 0, size2);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											size = numselfj * sizeof(int);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											hipMemcpy(dhead, selfjoin, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hipLaunchKernel(HIP_KERNEL_NAME(samejoin2), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numselfj, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if(numpreds > 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												size = numpreds * sizeof(int);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipMemcpy(dhead, preds, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if(ANDlogic)
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													hipLaunchKernel(HIP_KERNEL_NAME(bpredsnormal), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numpreds, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												else
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													hipLaunchKernel(HIP_KERNEL_NAME(bpredsorlogic), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numpreds, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											res = thrust::device_pointer_cast(temp);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											thrust::inclusive_scan(res + 1, res + tmplen, res + 1);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											num = res[rows];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if(num == 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return 0;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											size = head_size * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											reservar(&fres, num * size);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											hipMemcpy(dhead, project, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hipLaunchKernel(HIP_KERNEL_NAME(llenarproyectar), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, temp, dhead, head_size, fres);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hipFree(dhead);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hipFree(temp);
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											*ret = fres;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return num;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if(numpreds > 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												tmplen = rows + 1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												size2 = tmplen * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												reservar(&temp, size2);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipMemset(temp, 0, size2);		
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												size = numpreds * sizeof(int);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipMemcpy(dhead, preds, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if(ANDlogic)
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													hipLaunchKernel(HIP_KERNEL_NAME(bpredsnormal2), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numpreds, temp + 1);					
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												else
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													hipLaunchKernel(HIP_KERNEL_NAME(bpredsorlogic2), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, numpreds, temp + 1);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												res = thrust::device_pointer_cast(temp);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												thrust::inclusive_scan(res + 1, res + tmplen, res + 1);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												num = res[rows];
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if(num == 0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return 0;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												size = head_size * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												reservar(&fres, num * size);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipMemcpy(dhead, project, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												hipLaunchKernel(HIP_KERNEL_NAME(llenarproyectar), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, temp, dhead, head_size, fres);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												hipFree(dhead);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												hipFree(temp);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												*ret = fres;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return num;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												size = head_size * sizeof(int);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												reservar(&fres, rows * size);
							 
						 
					
						
							
								
									
										
										
										
											2016-07-31 10:14:02 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hipMemcpy(dhead, project, size, hipMemcpyHostToDevice);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												hipLaunchKernel(HIP_KERNEL_NAME(proyectar), dim3(blockllen), dim3(numthreads), size, 0, dop1, rows, cols, dhead, head_size, fres);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												hipFree(dhead);
							 
						 
					
						
							
								
									
										
										
										
											2016-04-19 23:30:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												*ret = fres;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return rows;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}
							 
						 
					
						
							
								
									
										
										
										
											2013-10-07 12:20:00 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}