Add optimization flags for compilers (-O3 for both g++ and nvcc)