How do you do this correctly?
I have:
Code:
struct Point2D { float x;float y; }
inline host device void operator=(Point2D& lhs, const Point2D& rhs)
{
lhs.x = rhs.x;
lhs.y = rhs.y;
}
the operator= doesn’t work on my Point2D class and returns a compile error error: “operator=” must be a member function. Obviously I don’t want to make it a member function because then the device would not be able to access it.
I notice that operator-overloading does work for the built-in CUDA structs like int2, uchar4…