[Openmp-commits] [PATCH] D65340: [OpenMP][libomptarget] Add support for close map modifier

Gheorghe-Teodor Bercea via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 9 09:50:28 PDT 2019


gtbercea added a comment.

@Hahnfeld 
I would like to clarify something about tgt_register_requires call.

This call is special and in a compiler that supports handling of requires clauses (like unified_shared_memory clause) ( i.e. Clang 9.0 onwards),  this function is called before any main function code. Here is a printout with LIBOMPTARGET_DEBUG=1 to realize the difference:

  ===== WHERE COMPILER PLACES CALL TO __tgt_register_requires() ========
  Libomptarget --> Loading RTLs... <<<< THIS IS THE VERY FIRST PRINT FROM THE RUNTIME. The call to __tgt_register_requires is just before that.
  Libomptarget --> Loading library 'libomptarget.rtl.ppc64.so'...
  Libomptarget --> Successfully loaded library 'libomptarget.rtl.ppc64.so'!
  Libomptarget --> Registering RTL libomptarget.rtl.ppc64.so supporting 4 devices!
  Libomptarget --> Loading library 'libomptarget.rtl.x86_64.so'...
  Libomptarget --> Unable to load library 'libomptarget.rtl.x86_64.so': libomptarget.rtl.x86_64.so: cannot open shared object file: No such file or directory!
  Libomptarget --> Loading library 'libomptarget.rtl.cuda.so'...
  Target CUDA RTL --> Start initializing CUDA
  Libomptarget --> Successfully loaded library 'libomptarget.rtl.cuda.so'!
  Libomptarget --> Registering RTL libomptarget.rtl.cuda.so supporting 4 devices!
  Libomptarget --> Loading library 'libomptarget.rtl.aarch64.so'...
  Libomptarget --> Unable to load library 'libomptarget.rtl.aarch64.so': libomptarget.rtl.aarch64.so: cannot open shared object file: No such file or directory!
  Libomptarget --> RTLs loaded!
  Libomptarget --> Image 0x0000000010020080 is compatible with RTL libomptarget.rtl.ppc64.so!
  Libomptarget --> RTL 0x000000004747b3e0 has index 0!
  Libomptarget --> Registering image 0x0000000010020080 with RTL libomptarget.rtl.ppc64.so!
  Libomptarget --> Done registering entries!
  ===== MANUAL CALL TO __tgt_register_requires() IN MAIN (top of MAIN function!) ========

Manually calling __tgt_register_requires can never actually work correctly because any user space call to this function will be after the binary has been loaded and the flags already decided. The compiler just has to support the handling of the requires clauses.


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65340/new/

https://reviews.llvm.org/D65340





More information about the Openmp-commits mailing list