[Openmp-commits] [openmp] cb03892 - [OpenMP] Fix an issue of wrong return type of DeviceRTLTy::getNumOfDevices
Shilei Tian via Openmp-commits
openmp-commits at lists.llvm.org
Sun May 3 12:59:12 PDT 2020
Author: Shilei Tian
Date: 2020-05-03T15:59:06-04:00
New Revision: cb038927ef5a038e479ab3a4919da6f413a50a00
URL: https://github.com/llvm/llvm-project/commit/cb038927ef5a038e479ab3a4919da6f413a50a00
DIFF: https://github.com/llvm/llvm-project/commit/cb038927ef5a038e479ab3a4919da6f413a50a00.diff
LOG: [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
Added:
Modified:
openmp/libomptarget/plugins/cuda/src/rtl.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
index 4ad58e290252..7e089a17370e 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; }
More information about the Openmp-commits
mailing list