0

I'm new to CUDA programing and I am trying to use the dynamic kernel call in a simple program but I'm getting an error. "

unresolved external symbol

I think I have setup the properties correctly but I'm no expert so I am not sure. Regular cuda programs without kernel to kernel calls work fine.

Here is the simple program I wrote.

#include <cuda.h>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#include <stdio.h>
#include <stdlib.h>

__global__ void childKernel() {
    printf("Hello %d", threadIdx.x);
}

__global__ void parentKernel() {
    childKernel<<<1, 10>>>();
    cudaDeviceSynchronize();
}

int main() {
    parentKernel<<<1, 1>>>();
    cudaDeviceSynchronize();
    return 0;
}

Here is the project properties I used.

enter image description here

  • you need to link the cuda device runtime library. discussedin the marked duplicate. also please dont post sceeenshots in questions, the can't be searched. cut and paste text instead. – talonmies Jan 29 '17 at 14:41
  • if you don't want to use a makefile: just add under project properties/linker/input/additional dependencies the cuda lib file – Soeren Jan 29 '17 at 15:30
  • Ok thanks for the info guys it helped me out a bit, but that was not really the problem I was having. I found the error showed because I did not properly use the -rdc=true in visual studio 2015. Like the solutions you guys posted they are mostly related to Linux based systems and not Visual Studio on Windows. There is actually a property in the Project >> Properties >> Configuration Properties >> CUDA C/C++ >> Common >> Generate Relocatable Device Code. This should be set to Yes (-rdc=true). – Andrew Titus Jan 29 '17 at 16:05

0 Answers0