Try to improve the performance of the heat equation solver by optimizing data movements. During the time evolution iteration, the data can be mostly kept within the device.
-
Implement routines
enter_data()
andexit_data()
(e.g. in cpp/core.cpp or fortran/core.F90). The routines should takecurrent
andprevious
fields as arguments, and create unstructured data region whereenter_data()
copies the data into the device andexit_data()
out from the device. Implement also routineupdate_host()
which takes a single field as argument and copies its data from device to host. -
Call the newly created routines at appropriate places in the main routine. Modify also the offload constructs in
evolve
accordingly.