Optimize main.cu to make its execution time shorter