Skip to content

Commit

Permalink
Deleting slow and unnecessary methods from kernel.cl
Browse files Browse the repository at this point in the history
These methods were used to implement an nonefficient version of
selection. The Yuan's implementation is faster.

#23: Delete unnecessary methods from GpuPartition

Task-Url: http://github.com/meisam/spark/issues/issue/23
  • Loading branch information
meisam committed Jan 15, 2015
1 parent 0431ace commit 8923a90
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions core/src/main/resources/org/apache/spark/gpu/kernel.cl
Original file line number Diff line number Diff line change
Expand Up @@ -281,38 +281,4 @@ __kernel void uniformAdd(__global int *g_data,

g_data[address] += uni;
g_data[address + get_local_size(0)] += (get_local_id(0) + get_local_size(0) < n) * uni;
}

__kernel void prefix_sum_stage(__global int *prefix_sum_in,
__global int *prefix_sum_out,
const int stride)
{
int thread_idx = get_global_id(0);
if (stride == 0) {
prefix_sum_out[thread_idx] = prefix_sum_in[thread_idx];
return;
}
unsigned long my_sum = prefix_sum_in[thread_idx];
unsigned long neighbors_sum = (thread_idx < stride)? 0 :prefix_sum_in[thread_idx - stride];
prefix_sum_out[thread_idx] = my_sum + neighbors_sum;
}

__kernel void scan(__global int *source_col,
__global int *filter,
__global int *prefix_sum,
__global int *dest_col,
const int n)
{
int thread_idx = get_global_id(0);
if ((thread_idx < n) && (filter[thread_idx] == 1)) {
int my_write_index = prefix_sum[thread_idx] - 1;
dest_col[my_write_index] = source_col[thread_idx];
}
}

__kernel void copy_buffer(__global int *source,
__global int *dest)
{
int thread_idx = get_global_id(0);
dest[thread_idx] = source[thread_idx];
}
}

0 comments on commit 8923a90

Please sign in to comment.