CUDA __device__ Unresolved extern function [duplicate]
This question already has an answer here: External calls are not supported - CUDA 1 answer I am trying to understand how to decouple CUDA __device__ codes in separate header files. I have three files. File: 1: int2.cuh #ifndef INT2_H_ #define INT2_H_ #include "cuda.h" #include "cuda_runtime.h" #include "device_launch_parameters.h" __global__ void kernel(); __device__ int k2(int k); int launchKernel(int dim); #endif /* INT2_H_ */ File 2: int2.cu #include "int2.cuh" #include "cstdio" __global__ void kernel() { int tid = threadIdx.x; printf("%d\n", k2(tid)); } __device__ int k2(int i) { return i