[all-commits] [llvm/llvm-project] 6e5f64: [OpenMP] Adopt std::set in HostDataToTargetMap

Ye Luo via All-commits all-commits at lists.llvm.org
Wed Jun 24 09:23:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e5f64c44f26465829e5aed38e900129ace6e64f
      https://github.com/llvm/llvm-project/commit/6e5f64c44f26465829e5aed38e900129ace6e64f
  Author: Ye Luo <yeluo at anl.gov>
  Date:   2020-06-24 (Wed, 24 Jun 2020)

  Changed paths:
    M openmp/libomptarget/src/device.cpp
    M openmp/libomptarget/src/device.h
    M openmp/libomptarget/src/omptarget.cpp

  Log Message:
  -----------
  [OpenMP] Adopt std::set in HostDataToTargetMap

Summary:
lookupMapping took significant time due to linear complexity searching.
This is bad for offloading from multiple host threads because lookupMapping is protected by mutex.
Use std::set for logarithmic complexity searching.

Before my change.
libomptarget inclusive time 16.7 sec, exclusive time 8.6 sec.
After the change
libomptarget inclusive time 7.3 sec, exclusive time 0.4 sec.

Most of the overhead of libomptarget (exclusive time) is gone.

Reviewers: jdoerfert, grokos

Reviewed By: grokos

Subscribers: tianshilei1992, yaxunl, guansong, sstefan1

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D82264




More information about the All-commits mailing list