Skip to content
  1. Feb 12, 2020
  2. Feb 07, 2020
  3. Feb 04, 2020
  4. Jan 27, 2020
  5. Jan 23, 2020
  6. Jan 21, 2020
    • Alexey Bataev's avatar
      [OpenMP][Offloading] Fix the issue that omp_get_num_devices returns wrong... · 9148b8b7
      Alexey Bataev authored
      [OpenMP][Offloading] Fix the issue that omp_get_num_devices returns wrong number of devices, by Shiley Tian.
      
      Summary:
      This patch is to fix issue in the following simple case:
      
        #include <omp.h>
        #include <stdio.h>
      
        int main(int argc, char *argv[]) {
          int num = omp_get_num_devices();
          printf("%d\n", num);
      
          return 0;
        }
      
      Currently it returns 0 even devices exist. Since this file doesn't contain any
      target region, the host entry is empty so further actions like initialization
      will not be proceeded, leading to wrong device number returned by runtime
      function call.
      
      Reviewers: jdoerfert, ABataev, protze.joachim
      
      Reviewed By: ABataev
      
      Subscribers: protze.joachim
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D72576
      9148b8b7
  7. Jan 20, 2020
  8. Jan 16, 2020
  9. Jan 15, 2020
  10. Jan 14, 2020
    • Joachim Protze's avatar
      [OpenMP][Tool] Runtime warning for missing TSan-option · 2d4571bf
      Joachim Protze authored
      TSan spuriously reports for any OpenMP application a race on the initialization
      of a runtime internal mutex:
      
      ```
      Atomic read of size 1 at 0x7b6800005940 by thread T4:
        #0 pthread_mutex_lock <null> (a.out+0x43f39e)
        #1 __kmp_resume_64 <null> (libomp.so.5+0x84db4)
      
      Previous write of size 1 at 0x7b6800005940 by thread T7:
        #0 pthread_mutex_init <null> (a.out+0x424793)
        #1 __kmp_suspend_initialize_thread <null> (libomp.so.5+0x8422e)
      ```
      
      According to @AndreyChurbanov this is a false positive report, as the control
      flow of the runtime guarantees the ordering of the mutex initialization and
      the lock:
      https://software.intel.com/en-us/forums/intel-open-source-openmp-runtime-library/topic/530363
      
      To suppress this report, I suggest the use of
      TSAN_OPTIONS='ignore_uninstrumented_modules=1'.
      With this patch, a runtime warning is provided in case an OpenMP application
      is built with Tsan and executed without this Tsan-option.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D70412
      2d4571bf
    • Jon Chesterfield's avatar
      [nfc][libomptarget] Refactor nvptx/target_impl.cu · 2a43688a
      Jon Chesterfield authored
      Summary:
      [nfc][libomptarget] Refactor nxptx/target_impl.cu
      
      Use __kmpc_impl_atomic_add instead of atomicAdd to match the rest of the file.
      Alternatively, target_impl.cu could use the cuda functions directly. Using a mixture in this
      file was an oversight, happy to resolve in either direction.
      
      Removed some comments that look outdated.
      
      Call __kmpc_impl_unset_lock directly to avoid a redundant diagnostic and remove an implict
      dependency on interface.h.
      
      Reviewers: ABataev, grokos, jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: jfb, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D72719
      2a43688a
    • Jon Chesterfield's avatar
      [nfc][libomptarget] Refactor amdgcn target_impl · 2d287bec
      Jon Chesterfield authored
      Summary:
      [nfc][libomptarget] Refactor amdgcn target_impl
      
      Removes references to internal libraries from the header
      Standardises on C++ mangling for all the target_impl functions
      Update comment block
      clang-format
      Move some functions into a new target_impl.hip source file
      
      This lays the groundwork for implementing the remaining unresolved
      symbols in the target_impl.hip source.
      
      Reviewers: jdoerfert, grokos, ABataev, ronlieb
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, mgorny, jfb, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D72712
      2d287bec
    • Joachim Protze's avatar
      [OpenMP][Tool] Improving stack trace for Archer · ed810da7
      Joachim Protze authored
      The OpenMP runtime is not instrumented, so entering the runtime leaves no hint
      on the source line of the pragma on ThreadSanitizer's function stack.
      
      This patch adds function entry/exit annotations for OpenMP parallel regions,
      and synchronization regions (barrier, taskwait, taskgroup).
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D70408
      ed810da7
    • Joachim Protze's avatar
      [OpenMP][Tool] Make tests for archer dependent on TSan · 84637408
      Joachim Protze authored
      If the openmp project is built standalone, the test compiler is feature tested for an available -fsanitize=thread flag.
      If the openmp project is built as part of llvm, the target tsan is needed to test archer.
      
      An additional line (requires tsan) was introduced to the tests, this patch updates the line numbers for the race.
      
      Follow-up for 77ad98c8
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D71914
      84637408
  11. Jan 10, 2020
    • Alexey Bataev's avatar
      [LIBOMPTARGET]Ignore empty target descriptors. · b19c0810
      Alexey Bataev authored
      Summary:
      If the dynamically loaded module has been compiled with -fopenmp-targets
      and has no target regions, it has empty target descriptor. It leads to a
      crash at the runtime if another module has at least one target region
      and at least one entry in its descriptor. The runtime library is unable
      to load the empty binary descriptor and terminates the execution.
      Caused by a clang-offload-wrapper.
      
      Reviewers: grokos, jdoerfert
      
      Subscribers: caomhin, kkwli0, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D72472
      b19c0810
  12. Jan 07, 2020
  13. Jan 06, 2020
  14. Jan 04, 2020
  15. Dec 30, 2019
  16. Dec 27, 2019
  17. Dec 19, 2019
  18. Dec 18, 2019
    • Jon Chesterfield's avatar
      [libomptarget][nfc] Introduce atomic wrapper function · 2caeaf2f
      Jon Chesterfield authored
      Summary:
      [libomptarget][nfc] Introduce atomic wrapper function
      
      Wraps atomic functions in a template prefixed __kmpc_atomic that
      dispatches to cuda or hip atomic functions. Intended to be easily extended
      to dispatch to OpenCL or C++ atomics for a third target.
      
      Reviewers: ABataev, jdoerfert, grokos
      
      Reviewed By: jdoerfert
      
      Subscribers: Anastasia, jvesely, mgrang, dexonsmith, llvm-commits, mgorny, jfb, openmp-commits
      
      Tags: #openmp, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71404
      2caeaf2f
    • JonChesterfield's avatar
      [libomptarget][nfc] Extract function from data_sharing, move to common · 8adae602
      JonChesterfield authored
      Summary:
      [libomptarget][nfc] Extract function from data_sharing, move to common
      
      Finding the first active thread in the warp is different on nvptx and amdgcn,
      mostly due to warp size and the desire for efficiency.
      
      Reviewers: ABataev, jdoerfert, grokos
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, mgorny, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D71643
      8adae602
  19. Dec 17, 2019
    • Alexey Bataev's avatar
      15d47dee
    • JonChesterfield's avatar
      [libomptarget][nfc] Move three files under common, build them for amdgcn · 0c83f8cc
      JonChesterfield authored
      Summary:
      [libomptarget][nfc] Move three files under common, build them for amdgcn
      
      Change to reduction.cu to remove two dead includes, otherwise no code change.
      
      Reviewers: jdoerfert, ABataev, grokos
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, mgorny, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D71601
      0c83f8cc
    • JonChesterfield's avatar
      [libomptarget][nfc] Move omp locks under target_impl · 3d3e4076
      JonChesterfield authored
      Summary:
      [libomptarget][nfc] Move omp locks under target_impl
      
      These are likely to be target specific, even down to the lock_t which is
      correspondingly moved out of interface.h. The alternative is to include
      interface.h in target_impl which substantiatially increases the scope of
      those symbols.
      
      The current nvptx implementation deadlocks on amdgcn. The preferred
      implementation for that arch is still under discussion - this change
      leaves declarations in target_impl.
      
      The functions could be inline for nvptx. I'd prefer to keep the internals
      hidden in the target_impl translation unit, but will add the (possibly renamed)
      macros to target_impl.h if preferred.
      
      Reviewers: ABataev, jdoerfert, grokos
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, mgorny, jfb, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D71574
      3d3e4076
    • Jon Chesterfield's avatar
      [libomptarget][nfc] Move timer functions behind target_impl · ce12a523
      Jon Chesterfield authored
      Summary: [libomptarget][nfc] Move timer functions behind target_impl
      
      Reviewers: jdoerfert, ABataev, grokos
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D71584
      ce12a523
    • Jon Chesterfield's avatar
      [libomptarget][nfc] Wrap cuda min() in target_impl · 53bcd1e1
      Jon Chesterfield authored
      Summary:
      [libomptarget][nfc] Wrap cuda min() in target_impl
      
      nvptx forwards to cuda min, amdgcn implements directly.
      Sufficient to build parallel.cu for amdgcn, added to CMakeLists.
      
      All call sites are homogenous except one that passes a uint32_t and an
      int32_t. This could be smoothed over by taking two type parameters
      and some care over the return type, but overall I think the inline
      <uint32_t> calling attention to what was an implicit sign conversion
      is cleaner.
      
      Reviewers: ABataev, jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, mgorny, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D71580
      53bcd1e1
  20. Dec 16, 2019
    • JonChesterfield's avatar
      Revert "Revert "[libomptarget] Move resource id functions into target specific... · 69fcc6ec
      JonChesterfield authored
      Revert "Revert "[libomptarget] Move resource id functions into target specific code, implement for amdgcn""
      
      Summary:
      This reverts commit dd8a7fcd.
      
      Alexey reports undefined symbols for the new inline functions defined in target_impl.h
      This does not reproduce for me for nvptx, or amdgcn, under release or debug builds.
      
      I believe the patch is fine, based on:
       - the semantics of an inline function in C++ (the cuda INLINE functions end
         up as linkonce_odr in IR), which are only legal to drop if they have no uses
       - the code generated from a debug build of clang 9 does not show these undef symbols
       - the tests pass
       - the code is trivial
      
      To progress from here I either need:
       - A tie break - someone to play the role of CI in determining whether the patch works
       - Alexey to provide sufficient information about his build for me to reproduce the failure
       - Alexey to debug why the symbols are disappearing for him and report back
      
      Reviewers: ABataev, jdoerfert, grokos
      
      Subscribers: jvesely, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D71502
      69fcc6ec
  21. Dec 13, 2019
Loading