added cuda kernel functions