Skip to content

Commit af01cd6

Browse files
committed
Minor improvements
1 parent 2f7d984 commit af01cd6

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

cpp/velox/cudf/GpuLock.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ void lockGpu() {
4545
return;
4646
}
4747

48-
4948
// Wait until the GPU lock becomes available
5049
getGpuLockState().gGpuCv.wait(lock, [] {
5150
return !getGpuLockState().gGpuOwner.has_value();
@@ -72,12 +71,12 @@ void unlockGpu() {
7271
std::thread::id tid = std::this_thread::get_id();
7372
std::unique_lock<std::mutex> lock(getGpuLockState().gGpuMutex);
7473
if (!getGpuLockState().gGpuOwner.has_value()) {
75-
LOG(INFO) <<"unlockGpu() called by non-owner thread!"<< std::endl;
74+
LOG(INFO) << "unlockGpu() called when no thread holds the lock!";
7675
return;
7776
}
7877

79-
if (!getGpuLockState().gGpuOwner.has_value() || getGpuLockState().gGpuOwner != tid) {
80-
throw std::runtime_error("unlockGpu() called by other-owner thread!");
78+
if (getGpuLockState().gGpuOwner != tid) {
79+
throw std::runtime_error("unlockGpu() called by other thread!");
8180
}
8281

8382
// Release ownership
@@ -88,5 +87,4 @@ void unlockGpu() {
8887
getGpuLockState().gGpuCv.notify_one();
8988
}
9089

91-
9290
} // namespace gluten

cpp/velox/shuffle/VeloxGpuShuffleReader.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ bool VeloxGpuHashShuffleReaderDeserializer::resolveNextBlockType() {
7575
default:
7676
throw GlutenException(fmt::format("Unsupported block type: {}", static_cast<int32_t>(blockType)));
7777
}
78-
return true;
7978
}
8079

8180
void VeloxGpuHashShuffleReaderDeserializer::loadNextStream() {

0 commit comments

Comments
 (0)