Grep function using CUDA capabilities