llvm-project/openmp/libomptarget/src
Alexey Bataev 9148b8b734 [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
2020-01-21 13:25:18 -05:00
..
CMakeLists.txt Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
api.cpp [libomptarget] Remove duplicate RTLRequiresFlags per device 2019-08-09 19:20:39 +00:00
device.cpp [LIBOMPTARGET] Do not increment/decrement the refcount for "declare target" objects 2020-01-14 16:30:38 -08:00
device.h [LIBOMPTARGET] Do not increment/decrement the refcount for "declare target" objects 2020-01-14 16:30:38 -08:00
exports [OpenMP 5.0] libomptarget interface for declare mapper functions. 2019-08-04 04:18:28 +00:00
interface.cpp [OpenMP 5.0] libomptarget interface for declare mapper functions. 2019-08-04 04:18:28 +00:00
omptarget.cpp [OpenMP][Offloading] Fix the issue that omp_get_num_devices returns wrong number of devices, by Shiley Tian. 2020-01-21 13:25:18 -05:00
private.h [OpenMP] NFC: Fix trivial typos in comments 2020-01-07 14:05:03 +08:00
rtl.cpp [OpenMP][Offloading] Fix the issue that omp_get_num_devices returns wrong number of devices, by Shiley Tian. 2020-01-21 13:25:18 -05:00
rtl.h [OpenMP][libomptarget] Enable usage of unified memory for declare target link variables 2019-06-04 15:05:53 +00:00