Skip to content

Commit

Permalink
[OpenMP] Fix an issue of wrong return type of DeviceRTLTy::getNumOfDe…
Browse files Browse the repository at this point in the history
…vices

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
  • Loading branch information
shiltian committed May 3, 2020
1 parent 81e48ae commit cb03892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openmp/libomptarget/plugins/cuda/src/rtl.cpp
Expand Up @@ -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; }

Expand Down

0 comments on commit cb03892

Please sign in to comment.