morph
morph

Reputation: 305

Mutex for CUDA host code? boost::mutex no solution due to BOOST_COMPILER redefinition with nvcc

Do anyone see a possiblity to synchronize operations in CUDA host code? With CUDA host code I mean the host code that is contained in your .cu-file and preprocessed by nvcc and then passed to cl.exe on windows for example.

Due to the unavoidable preprocessing of the host code by nvcc I cannot use my preferred implementation boost::mutex: If I include boost stuff I get an error of BOOST_COMPILER makro redefinition.

Upvotes: 0

Views: 245

Answers (1)

Roger Dahl
Roger Dahl

Reputation: 15734

Just separate your CUDA C code from the rest. Have the .cu files contain your kernels, device functions, kernel calls, etc. Make headers for the kernel calls and use those in your cpp files. This can also help reduce the compile time because compiling .cu files is slow.

Upvotes: 1

Related Questions