Код: Выделить всё
LINK : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_81293256_4_t_cu_2bebb7d5_7784 referenced in function "void __cdecl __nv_cudaEntityRegisterCallback(void * *)" (?__nv_cudaEntityRegisterCallback@@YAXPEAPEAX@Z)
Код: Выделить всё
template __device__ void exec(F f, uint32_t tid, Args &&...args) {
f(tid, static_cast(args)...);
}
template __global__ void kernel(F f, Args... args) {
uint32_t tid = blockIdx.x * blockDim.x + threadIdx.x;
exec(f, tid, args...);
}
template void launch(F f, Args &&...args) {
kernel(f, static_cast(args)...);
}
int main() {
launch([] __device__(uint32_t id, uint32_t v) { printf("%u %u\n", id, v); }, 1u);
return 0;
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... ing-lambda