user class used both by CUDA project and none-CUDA cpp project

I want to make a user class which can be used both in CUDA project and regular C++ project.

The problem is the methods/functions in the class need modifier words host device.

This will cause problem in a none-cuda project without using some conditional preprocess block to redefine host device. My goal is this class file for a cpp user it needs no CUDA knowledge or information to use it.

How to acomplish this?

//example xy.h. this file will be inlcuded both in CUDA project and regular C++ project.

class XY
{
public:
double v;
host device XY(){v=0;}
host device
XY(double x){v=x;}

//method
host device inline XY add(XY x) { this->v += x.v; return this;}
host device inline bool operator==(const XY& rhs){return v==rhs.v; }
host device inline bool operator!=(const XY& rhs){return !operator==(rhs);}
host device inline bool operator< (const XY& rhs){return v< rhs.v;}
host device inline bool operator> (const XY& rhs){return v> rhs.v;}
host device inline bool operator<=(const XY& rhs){return !operator> (rhs);}
host device inline bool operator>=(const XY& rhs){return !operator< (rhs);}
host device inline XY operator + (const XY& b)const {return XY(v+b.v);}
host device inline XY operator - (const XY& b)const {return XY(v-b.v);}
host device inline XY operator * (const XY& b)const {return XY(v
b.v);}
host device inline XY operator = (const XY& b)const {return XY(b.v);}
};