Object-Oriented Heterogeneous Computing: An Approach Based on Primitives