This depends on the degree to which the underlying hardware remains compatible across generations. nVidia can sell monster GPU systems today to run 5-year-old CUDA code faster without any recompilation or other mandatory engineering work. I don’t know whether this is possible with direct hardware access.