Joseph Redmon
2014-11-21 e36182cd8c5dd5c6d0aa1f77cf5cdca87e8bb1f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
__kernel void axpy(int N, float ALPHA, __global float *X, int OFFX, int INCX, __global float *Y, int OFFY, int INCY)
{
    int i = get_global_id(0);
    Y[OFFY+i*INCY] += ALPHA*X[OFFX+i*INCX];
}
 
__kernel void scal(int N, float ALPHA, __global float *X, int INCX)
{
    int i = get_global_id(0);
    X[i*INCX] *= ALPHA;
}
 
__kernel void copy(int N, __global float *X, int OFFX, int INCX, __global float *Y, int OFFY, int INCY)
{
    int i = get_global_id(0);
    Y[i*INCY + OFFY] = X[i*INCX + OFFX];
}