extern "C" __global__ void sin_kernel(float *out, const float *inp, int numel) { int i = blockIdx.x * blockDim.x + threadIdx.x; if (i < numel) { out[i] = sin(inp[i]); } }