implemented GPU code