Nvcc on Linux tries to resolve ::lerp as std::lerp with compute 80 or higher

I have seen other situations where the device code compiler “resolves” undecorated functions using the standard library (perhaps, unexpectedly). So it’s not obvious to me that is not allowed. (I don’t know.)

If you think it is a (nvcc) bug, probably best to file a bug.

If you are looking for workarounds,

it seems like one possibility would be to include your own definition in a namespace, then call out that namespace specifically:

$ cat test2.cu
namespace foo{
inline __device__ __host__ float lerp(float a, float b, float t)
{
        return a + t * (b - a);
}
}

__global__ void interpolate(const float* a, const float* b, const float* t, float* result)
{
        int i = blockIdx.x * blockDim.x + threadIdx.x;

        result[i] = foo::lerp(a[i], b[i], t[i]);
}
$ nvcc -arch=sm_80 -I.  -dc test2.cu -std=c++20
$

And, FWIW, I see the same failure using the non-namespace code, whether I compile for -arch=sm_61 or -arch=sm_80. That error doesn’t appear to be arch-dependent.