Cuda based algo