mardi 2 octobre 2018

how to link cuda files with c++ server code

I am working on a big project that involves cuda backend code and c++ gRPC server code.

Files containing cuda codes are:

  • nv_wavenet_util.cuh
  • nv_wavenet_singleblock.cuh
  • nv_wavenet_dualblock.cuh
  • nv_wavenet_persistent.cuh
  • matrix_math.cuh
  • nv_wavenet.cuh
  • wavenet_infer.cu
  • wavenet_infer.h ( this does not contain any cuda operation )

The c++ codes files:

  • wavenet_server.cc
  • other gRPC and protobuff object files

the main server code is wavenet_server.cc and it #includes wavenet_infer.h. wavenet_infer.cu contains cuda wrapper functions that are called by wavnet_server.cc.

Initially, I have read this article about separate compilation. However, I could not apply the method suggested because all of my cuda code is in .cuh format ( I am not the author, so I do not feel comfortable changing the .cuh files into two seperate .cu and .cuh files ). Since nvcc does not compile .cuh files to object files, I am not sure how to approach this problem.

Aucun commentaire:

Enregistrer un commentaire