Skip to content

Instantly share code, notes, and snippets.

@r7vme
Created July 8, 2019 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r7vme/96ed180e9c54c58b527dbe57095aec32 to your computer and use it in GitHub Desktop.
Save r7vme/96ed180e9c54c58b527dbe57095aec32 to your computer and use it in GitHub Desktop.
__global__ void maxKernel(
const int n,
const float eps,
const float* x,
float* y)
{
for (int i = blockIdx.x * blockDim.x + threadIdx.x;
i < n; i += gridDim.x * blockDim.x)
{
y[i] = fmaxf(x[i], eps);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment