Seems like the __syncthreads is missing from the clang/lib/Headers/__clang_cuda_device_functions.h file. To be honest, I don't know much about CUDA. This issue was noticed by a YouCompleteMe user who then made a pull request:
https://github.com/ycm-core/ycmd/pull/1438
I did not create any tests, because a similar patch did not include tests:
This doesn't seem to actually compile:
Looks like __nvvm_bar0 is not declared/defined anywhere. When grepping, compared to __nvvm_bar0_and(int), these two are missing:
Should I add BUILTIN(__nvvm_bar0, "v", "") to BuiltinsNVPTX.def and whatever needs to be added to the IntrinsicsNVVM.td?