I’m trying to overload operator* for the float2 data type.
hostdevice inline float2 operator*(const float2 a, const float2 B)
{
…
}
Now, I need to call __fmul_rn() on device, which is not defined on host.
Is there any way to exclude __fmul_rn() invocation on host? Any define like HOST or DEVICE?
What I was trying to say is that if __fmul_rn() is not available as a host function, then try to define and implement your own host __fmul_rn() that simply
takes two floats a and b and returns a*b. If you are lucky, this will not collide with the existing device function __fmul_rn() and it may allow you to use this intrinsic also in host code.