tra added a comment. I wonder if this patch will help with this case:
https://godbolt.org/z/X4KdsV __device__ float fn(int) { return threadIdx.x; }; __host__ float fn(float); float gvar1 = []()__device__ { return fn(1);} (); // This ends up calling fn(int) on *host* We seem to happily let host code call __device__ function from a lambda function used as an initializer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits