[llvm-bugs] [Bug 34384] New: Cuda sample code executable built by Clang 4.0.0/4.0.1 x86_64-pc-windows-msvc crashes

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 30 12:10:01 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34384

            Bug ID: 34384
           Summary: Cuda sample code executable built by Clang 4.0.0/4.0.1
                    x86_64-pc-windows-msvc crashes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: CUDA
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dhirajnitk at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19061
  --> https://bugs.llvm.org/attachment.cgi?id=19061&action=edit
cui  fronend files

As per LLVM Docs CUDA compilation is supported on Linux, on MacOS as of
2016-11-18, and on Windows as of 2017-01-05

So the LLVM cuda support on windows is available since Clang 3.9 but I tried to
call a basic cuda kernel program and it crashes. I used the official released
clang version 4.0.1 x86_64-pc-windows-msvc & Clang 4.0.1 built on my machine
but the executable failed in both the cases.


#include <cuda_runtime.h>
#include <device_launch_parameters.h>
__global__ 
void foo(){
    printf("Hello Inside Foo\n");
}

int main(){
    foo<<<1,1>>>();
    cudaDeviceSynchronize();
    return(0);
}


clang++ HelloCuda.cu -o HelloCuda.exe --cuda-gpu-arch=sm_30 -L"C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64" -lcudart_static -pthread

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170830/084e6cbd/attachment.html>


More information about the llvm-bugs mailing list