putting host code in cpp