Memory models for heterogeneous systems