summaryrefslogtreecommitdiff
path: root/ot/gpu/cudamat/cudamat/learn_kernels.cu
blob: 8e897ba5e3d40c794216bc4f07b6d7201fa64b64 (plain)
1
2
3
4
5
6
7
8
9
10
#include "learn_kernels.cuh"

__global__ void kMultiplyBySigmoidGrad(double* act, double* target, const unsigned int len) {
    const unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x;
    const unsigned int numThreads = blockDim.x * gridDim.x;

    for(unsigned int i = idx; i < len; i+= numThreads) {
        target[i] = target[i] * act[i] * (1.0f - act[i]);
    }
}