<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Ilya,</p>
<p>Thank you for replying!</p>
<p>Today, I did some more extensive testing. I've managed to run YCM
with clangd support successfully. I still fail with libclang. I
guess that's a whole different story.</p>
<p>It turns out, I've been using compile_commands.json generated by
cmake, which doesn't support clang as cuda compiler. After
correcting the flags manually, I was able to get completion for a
.cu file. Like you said, it doesn't recognize cuda specific code,
e.g. <tt>__syncthreads();</tt> but I reckon those are fixable by
some quick macros and include hacks.<br>
</p>
<p>However, my setup of VSCode fails completely when it comes to .cu
files. I am attaching screen showing a simple cpp-only completion
test. I expected it would know a list of vector's method.<br>
Setup:<br>
Arch linux 5.0.3<br>
VSCode 1.32.3, vscode-clangd 0.0.11<br>
clangd 7.0.1<br>
</p>
<p>My project is closed source. I need some CUDA 9 and 10 features
so I am kinda forced to use nvcc.</p>
<p>I suppose the next position on my wish list is generating
commands for clang by cmake or accepting nvcc flags by clang. Even
with script replacing flags, needing to run it each time I
regenerate flags is dull.<br>
</p>
<p>Best regards,<br>
Jacek<br>
</p>
<div class="moz-cite-prefix">On 3/22/19 3:36 PM, Ilya Biryukov
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANmbtFckVBeV=Dd3AP8n9ciF5bzym0LzLr6C-zCXtL_hm2RCXw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi Jacek,
<div><br>
</div>
<div>We haven't put any effort into supporting CUDA so far.</div>
<div>However, clang supports CUDA, so basic features should work
on CUDA code, e.g. non-CUDA-specific completions, resolve,
etc.</div>
<div><br>
</div>
<div>The difficulty is obtaining a compilation database that
specifies proper CUDA-specific flags.</div>
<div><br>
</div>
<div>Could you describe the setup with YCM or VSCode that you
tried and that didn't work for you? What's the project (if
it's open-source) you tried running on? What's your OS and
what kind of toolchain do you use for the build (nvcc, clang)?</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 2:26
PM Jacek Ciesielski via clangd-dev <<a
href="mailto:clangd-dev@lists.llvm.org"
moz-do-not-send="true">clangd-dev@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
guys,<br>
<br>
I couldn't find any reliable info whether clangd supports CUDA
completion.<br>
<br>
Docs mention only C++. Yet, I tried using it with some CUDA
code. I <br>
didn't succeed trying with YCM nor VS Code. Is it possible at
all? How <br>
much effort would that possibly take to develop support for
CUDA?<br>
<br>
Best regards,<br>
Jacek<br>
<br>
_______________________________________________<br>
clangd-dev mailing list<br>
<a href="mailto:clangd-dev@lists.llvm.org" target="_blank"
moz-do-not-send="true">clangd-dev@lists.llvm.org</a><br>
<a
href="https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Regards,</div>
<div>Ilya Biryukov</div>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>