Reputation: 131976
In my code, I have:
__host__ __device__ inline void foo() { bar([=] __host__ __device__ (...) { ... }); }
__host__ __device__ bar<typename F>(F f) { ... f(...); }
But when I compile this (with --extended-lambda
), I get the error message:
error #3108-D: The enclosing parent function ("foo") for an extended
__host__ __device__ lambda must allow its address to be taken
what exactly does this mean?
Upvotes: 1
Views: 867
Reputation: 131976
This is my guess only: NVCC needs the enclosing function to be not-inlined; that's how it can "take its address", which is somehow necessary for using the lambda.
Upvotes: 1