Hi Hal,

Can you please file a bug report (at https://bugs.llvm.org/)?


I subscribed to the bug list and I was able to update my version of
the llvm-trunk. Unfortunately I get the same errors. I have attached
the small program which I tried to compile. I wasn't able to create
an account for a bug report. Can somebody file this bug report?
Thank you very much in advance.


loki fd1026 107 clang -v
clang version 6.0.0 (trunk 309807)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm-trunk/bin
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 8.0


loki fd1026 108 clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda 
dot_prod_accelerator_OpenMP.c -lomptarget
clang-6.0: error: cannot find libdevice for . Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
#0 0x00007f5dc0a3e8da llvm::sys::PrintStackTrace(llvm::raw_ostream&) 
(/usr/local/llvm-trunk/lib64/libLLVMSupport.so.6+0xfc8da)
#1 0x00007f5dc0a3ca1e llvm::sys::RunSignalHandlers() 
(/usr/local/llvm-trunk/lib64/libLLVMSupport.so.6+0xfaa1e)
#2 0x00007f5dc0a3cb58 SignalHandler(int) 
(/usr/local/llvm-trunk/lib64/libLLVMSupport.so.6+0xfab58)
#3 0x00007f5dc3bb1b10 __restore_rt (/lib64/libpthread.so.0+0x10b10)
#4 0x00007f5dc2e75420 clang::driver::tools::NVPTX::Linker::ConstructJob(clang::driver::Compilation&, clang::driver::JobAction const&, clang::driver::InputInfo const&, llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::opt::ArgList const&, char const*) const (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0xc4420) #5 0x00007f5dc2e16dcc clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&, clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef, bool, bool, char const*, std::map<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::pair<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind) const (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x65dcc) #6 0x00007f5dc2e18789 clang::driver::Driver::BuildJobsForAction(clang::driver::Compilation&, clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef, bool, bool, char const*, std::map<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::pair<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind) const (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x67789) #7 0x00007f5dc2e1a5d2 void llvm::function_ref<void (clang::driver::Action*, clang::driver::ToolChain const*, char const*)>::callback_fn<clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&, clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef, bool, bool, char const*, std::map<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::pair<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind) const::{lambda(clang::driver::Action*, clang::driver::ToolChain const*, char const*)#2}>(long, clang::driver::Action*, clang::driver::ToolChain const*, char const*) (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x695d2) #8 0x00007f5dc2dfc5dc clang::driver::OffloadAction::doOnEachDeviceDependence(llvm::function_ref<void (clang::driver::Action*, clang::driver::ToolChain const*, char const*)> const&) const (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x4b5dc) #9 0x00007f5dc2e16109 clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&, clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef, bool, bool, char const*, std::map<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::pair<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind) const (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x65109) #10 0x00007f5dc2e18789 clang::driver::Driver::BuildJobsForAction(clang::driver::Compilation&, clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef, bool, bool, char const*, std::map<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::pair<std::pair<clang::driver::Action const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind) const (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x67789)
#11 0x00007f5dc2e18d25 
clang::driver::Driver::BuildJobs(clang::driver::Compilation&) const 
(/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x67d25)
#12 0x00007f5dc2e1a3c9 clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char 
const*>) (/usr/local/llvm-trunk/lib64/libclangDriver.so.6+0x693c9)
#13 0x000000000040c6d3 (clang+0x40c6d3)
#14 0x00007f5dbe2b96e5 __libc_start_main 
/usr/src/debug/glibc-2.22/csu/libc-start.c:323:0
#15 0x000000000040e6f9 (clang+0x40e6f9)
Stack dump:
0. Program arguments: clang -m64 -O2 -g -Weverything -Wno-unused-command-line-argument -DLinux -Dx86_64 -I/usr/local/valgrind-3.12.0/include -I/usr/local/intel/opencl-1.2-sdk-6.3.0.1904/include -I/usr/local/include -I/usr/include -I/usr/local/cuda-8.0/include -I/usr/local/hwloc-1.11.5/include -I/home/fd1026/Linux/x86_64/include -L/home/fd1026/Linux/x86_64/lib64 -L/usr/local/valgrind-3.12.0/lib -L/usr/local/jdk1.8.0_66/jre/lib/amd64 -L/usr/local/intel/opencl-1.2-sdk-6.3.0.1904/lib64 -L/usr/local/llvm-trunk/lib64 -L/usr/local/pgi/linux86-64/16.10/lib -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/compiler/lib/intel64 -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/compiler/lib/intel64_lin -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/mpi/intel64/lib -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/mpi/mic/lib -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/ipp/lib/intel64 -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/compiler/lib/intel64_lin -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/mkl/lib/intel64_lin -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/tbb/lib/intel64/gcc4.7 -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/tbb/lib/intel64/gcc4.7 -L/usr/local/intel_xe_2018_beta/debugger_2018//libipt/intel64/lib -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/daal/lib/intel64_lin -L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/daal/../tbb/lib/intel64_lin/gcc4.4 -L/usr/local/gcc-7.1.0/lib64 -L/usr/local/gcc-7.1.0/libexec/gcc/x86_64-pc-linux-gnu/7.1.0 -L/usr/local/gcc-7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0 -L/usr/local/lib64 -L/usr/X11R6/lib64 -L/lib64 -L/usr/lib64 -L/usr/lib64/tls -L/usr/local/lib -L/usr/X11R6/lib -L/lib -L/usr/lib -L/usr/lib/tls -L/usr/local/gcc-7.1.0/lib -L/usr/local/gcc-7.1.0/libexec/gcc/x86_64-pc-linux-gnu/7.1.0/32 -L/usr/local/gcc-7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/32 -L/usr/local/cuda-8.0/lib64 -L/usr/local/hwloc-1.11.5/lib -L/usr/local/swipl-7.2.3/lib/x86_64-linux -L/home/fd1026/Linux/x86_64/lib -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda dot_prod_accelerator_OpenMP.c -lomptarget
1.      Compilation construction
2.      Building compilation jobs
3.      Building compilation jobs
4.      Building compilation jobs
Segmentation fault (core dumped)
loki fd1026 111


Kind regards

Siegmar
#include <stdio.h>
#include <stdlib.h>
#ifdef _OPENMP
  #include <omp.h>
#endif

#define VECTOR_SIZE 100000000           /* vector size (10^8)           */

/* heap memory to avoid a segmentation fault due to a stack overflow    */
static double a[VECTOR_SIZE],           /* vectors for dot product      */
              b[VECTOR_SIZE];


int main (void)
{
  double sum;

  /* initialize vectors                                                 */
  #pragma omp target map (from: a, b)
  #pragma omp parallel for default(none) shared(a, b)
  for (int i = 0; i < VECTOR_SIZE; ++i)
  {
    a[i] = 2.0;
    b[i] = 3.0;
  }

  #ifdef _OPENMP
    printf ("Number of processors:     %d\n"
            "Number of devices:        %d\n"
            "Default device:           %d\n",
            omp_get_num_procs (), omp_get_num_devices (),
            omp_get_default_device ());
  #endif

  /* compute dot product                                                */
  sum = 0.0;
  #pragma omp target map(to:a,b), map(tofrom:sum)
  #pragma omp parallel for default(none) shared(a, b) reduction(+:sum)
  for (int i = 0; i < VECTOR_SIZE; ++i)
  {
    sum += a[i] * b[i];
  }
  printf ("sum = %e\n", sum);
  return EXIT_SUCCESS;
}
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to