Some of our users have expressed concerns with having jit_variable located in the lambda capture list. Our LLVM IR analysis would work equally well if jit_variable became a __host__ __device__ function and was callable from the body of a lambda. Concretely, our interface would change from
auto lambda = [=, a = jit_variable(a)] { printf("%d\n", a); }
to
auto lambda = [=] { a = jit_variable(a); printf("%d\n", a); }
Some of our users have expressed concerns with having
jit_variablelocated in the lambda capture list. Our LLVM IR analysis would work equally well ifjit_variablebecame a__host__ __device__function and was callable from the body of a lambda. Concretely, our interface would change fromauto lambda = [=, a = jit_variable(a)] { printf("%d\n", a); }to
auto lambda = [=] { a = jit_variable(a); printf("%d\n", a); }