Started work on cuda implementation.