From cb038927ef5a038e479ab3a4919da6f413a50a00 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Sun, 3 May 2020 15:58:46 -0400 Subject: [PATCH] [OpenMP] Fix an issue of wrong return type of DeviceRTLTy::getNumOfDevices Summary: There is a typo in DeviceRTLTy::getNumOfDevices that the type of its return value is bool. It will lead to a problem of wrong device number returned from omp_get_num_devices. Reviewers: jdoerfert Reviewed By: jdoerfert Subscribers: yaxunl, guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D79255 --- openmp/libomptarget/plugins/cuda/src/rtl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp index 4ad58e290252d..7e089a17370e5 100644 --- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -380,7 +380,7 @@ class DeviceRTLTy { return DeviceId >= 0 && DeviceId < NumberOfDevices; } - bool getNumOfDevices() const { return NumberOfDevices; } + int getNumOfDevices() const { return NumberOfDevices; } void setRequiresFlag(const int64_t Flags) { this->RequiresFlags = Flags; }