[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 10 12:37:56 PST 2019


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





More information about the cfe-commits mailing list