boinc/samples/atiopencl/atiopencl_kernels.cl

38 lines
953 B
Common Lisp
Raw Normal View History

2010-06-15 18:09:28 +00:00
/*
* atiopencl_kernels.cl
* Author: Tuan Le
* Date: 06/14/2010
* University of California, Berkeley
* Berkeley Space Sciences Lab
2010-06-15 18:09:28 +00:00
* tuanle86@berkeley.edu
*/
2010-06-15 18:09:28 +00:00
__kernel void GEStep1A(__global float * AI, int i, int n2, int lda2) {
//int k = get_group_id(0) * get_local_size(0) + get_local_id(0);
int k=get_global_id(0);
if (k>i && k < n2 && AI[i*lda2+k]!=0) {
float multiplyer = -AI[i*lda2+k]/AI[i*lda2+i];
int n = n2 / 2;
for (int j = i+1; j < n; j++) {
AI[j*lda2+k] += multiplyer*AI[j*lda2+i];
}
}
}
2010-06-15 18:09:28 +00:00
__kernel void GEStep2(__global float * AI,float diag,int i, int n2, int lda2) {
int k = get_global_id(0);
if (k < n2) {
AI[i*lda2+k] /= diag;
}
}
2010-06-15 18:09:28 +00:00
__kernel void GEStep3(__global float * AI,int i, int n2, int lda2) {
int k = get_global_id(0);
if (k > i && k < n2) {
float multiplyer = -AI[i*lda2+k];
for (int j = 0; j < i; j++) {
AI[j*lda2+k] += multiplyer*AI[j*lda2+i];
}
}
}