Neural Network Calculation in OpenCL

__kernel void calc_node(__global float* input, __global float* bias, __global int* func, __global float* output) 
{
    int base = get_global_id(0);
    float r0 = input[3 * base + 0] * bias[base];
    float r1 = input[3 * base + 1] * bias[base];
    float r2 = input[3 * base + 2] * bias[base];
    float r = r0 + r1 + r2;

    switch(func[base])
    {
        case 0: // identity
            output[base] = r;
        break;
    }
}

#gamedev

There are no comments yet.