Could anyone clarify how to use this cuda target (-std=c++11 -x cuda) with MinGW stdlib?
I mean I get errors
<censored2>\LLVM-7.0.0-win32\lib\clang\7.0.0\include\cuda_wrappers\new:41:12: error: use of undeclared identifier 'malloc' return ::malloc(size);
<censored2>\LLVM-7.0.0-win32\lib\clang\7.0.0\include\cuda_wrappers\new:58:7: error: no type named 'free' in the global namespace ::free(ptr);
Basically, there’s no owner for CUDA support on windows. Someone needs to figure out why/how CUDA includes behave differently under mingw and figure out how to work around that in the CUDA wrapper headers in clang.
Basically, there’s no owner for CUDA support on windows. Someone needs
to
figure out why/how CUDA includes behave differently under mingw and
figure
out how to work around that in the CUDA wrapper headers in clang.
Hello everybody.
Could anyone clarify how to use this cuda target (-std=c++11 -x cuda)
with
MinGW stdlib?
Thank you for the suggestion. But this doesn’t clarify the strange syntax used in the mentioned lines.
You need to look at the preprocessed output in order to see what is it that clang is complaining about.
I googled a bit and haven’t found anything clarifying, but there are some hints suggesting that it may be specific to Visual Studio.
It’s quite likely. Clang’s wrappers for C++ standard library are fairly specific to particular library. AFAICT we never even tried to make it work with whatever VC uses.
P.S. I don’t use CUDA headers
You actually do. With “-x cuda” clang pre-includes ton of CUDA headers (same as nvcc) and adds extra include search paths.
If you do not want to pre-include any CUDA headers, then you need to pass -nocudainc option.
I have AMD GPU and there is a CUDA impl for any OpenCL-capable device having own headers, which may be far more compatible that the ones provided by CUDA.
Interesting. Can you tell me more about this CUDA-over-OpenCL project?
The problem I encounter in the headers shipped with CLang, it seems they depend on something missing in MinGW headers.
Those headers are only intended to make clang work with NVIDIA’s CUDA SDK on linux. MinGW + a project that provides alternative CUDA headers is unlikely to work as is. -nocudainc should get clang’s headers out of your way, but it will be up to you to provide the equivalent.
>
>Basically, there's no owner for CUDA support on windows. Someone
needs
>to
>figure out why/how CUDA includes behave differently under mingw and
>figure
>out how to work around that in the CUDA wrapper headers in clang.
>
>
>
>> Hello everybody.
>>
>> Could anyone clarify how to use this cuda target (-std=c++11 -x
cuda)
>with
>> MinGW stdlib?
>>
>> I mean I get errors
>>
>>
<censored2>\LLVM-7.0.0-win32\lib\clang\7.0.0\include\cuda_wrappers\new:41:12:
>> error: use of undeclared identifier 'malloc' return
::malloc(size);
>>
<censored2>\LLVM-7.0.0-win32\lib\clang\7.0.0\include\cuda_wrappers\new:58:7:
>> error: no type named 'free' in the global namespace ::free(ptr);
>>
>> and I wonder what I should do to fix them.
>> _______________________________________________
>> cfe-users mailing list
>> cfe-users@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>>
Thank you for the suggestion. But this doesn't clarify the strange
syntax
used in the mentioned lines.
You need to look at the preprocessed output in order to see what is it
that
clang is complaining about.
I googled a bit and haven't found anything clarifying, but there are
some
hints suggesting that it may be specific to Visual Studio.
It's quite likely. Clang's wrappers for C++ standard library are fairly
specific to particular library. AFAICT we never even tried to make it
work
with whatever VC uses.
P.S. I don't use CUDA headers
You actually do. With "-x cuda" clang pre-includes ton of CUDA headers
(same as nvcc) and adds extra include search paths.
If you do not want to pre-include any CUDA headers, then you need to
pass
-nocudainc option.
- I have AMD GPU and there is a CUDA impl for any OpenCL-capable
device
having own headers, which may be far more compatible that the ones
provided
by CUDA.
Interesting. Can you tell me more about this CUDA-over-OpenCL project?
The problem I encounter in the headers shipped with CLang, it seems
they
depend on something missing in MinGW headers.
Those headers are only intended to make clang work with NVIDIA's CUDA
SDK
on linux. MinGW + a project that provides alternative CUDA headers is
unlikely to work as is. -nocudainc should get clang's headers out of
your
way, but it will be up to you to provide the equivalent.
Good luck,
Interesting. Can you tell me more about this CUDA-over-OpenCL project?
The problem is that you ended up including the headers (that do ship with clang) that were not intended to be used in your case. -nocudainc is there specifically to not use those headers. If you use -nocudainc, Clang’s cuda-specific wrappers will not be in the header include path and clang will include from whatever standard C++ library you have installed.