[llvm-bugs] [Bug 26343] New: Cuda: Relocatable device code doesn't work

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 27 09:29:36 PST 2016


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

            Bug ID: 26343
           Summary: Cuda: Relocatable device code doesn't work
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: crtrott at sandia.gov
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15733
  --> https://llvm.org/bugs/attachment.cgi?id=15733&action=edit
Reproduction code

With nvcc one can use the option "-rdc true", to allow device (or device host)
functions to be declared "extern". This means device functions can be compiled
in one compilation unit and called from others. This doesn't work here:

Error:
[crtrott at apollo test_relocatable_device_code]$ ./build_clang 
ptxas fatal   : Unresolved extern function '_Z4calcv'
fatal error: cannot open file '/tmp/main-b2a94f.fatbin': No such file or
directory
1 error generated.
clang-3.9: error: ptxas command failed with exit code 255 (use -v to see
invocation)
clang-3.9: error: no such file or directory: 'main.o'


Code:
extern int __device__ calc();

__global__ void foo(int* a) {
   a[blockIdx.x*blockDim.x+threadIdx.x] = calc();
}

-- 
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/20160127/1b1e00d8/attachment.html>


More information about the llvm-bugs mailing list