diff --git a/cpp/velox/cudf/GpuLock.cc b/cpp/velox/cudf/GpuLock.cc index 85ddbcd57829..1865fec2b66f 100644 --- a/cpp/velox/cudf/GpuLock.cc +++ b/cpp/velox/cudf/GpuLock.cc @@ -45,7 +45,6 @@ void lockGpu() { return; } - // Wait until the GPU lock becomes available getGpuLockState().gGpuCv.wait(lock, [] { return !getGpuLockState().gGpuOwner.has_value(); @@ -72,12 +71,12 @@ void unlockGpu() { std::thread::id tid = std::this_thread::get_id(); std::unique_lock lock(getGpuLockState().gGpuMutex); if (!getGpuLockState().gGpuOwner.has_value()) { - LOG(INFO) <<"unlockGpu() called by non-owner thread!"<< std::endl; + LOG(INFO) << "unlockGpu() called when no thread holds the lock!"; return; } - if (!getGpuLockState().gGpuOwner.has_value() || getGpuLockState().gGpuOwner != tid) { - throw std::runtime_error("unlockGpu() called by other-owner thread!"); + if (getGpuLockState().gGpuOwner != tid) { + throw std::runtime_error("unlockGpu() called by other thread!"); } // Release ownership @@ -88,5 +87,4 @@ void unlockGpu() { getGpuLockState().gGpuCv.notify_one(); } - } // namespace gluten diff --git a/cpp/velox/shuffle/VeloxGpuShuffleReader.cc b/cpp/velox/shuffle/VeloxGpuShuffleReader.cc index 441cb0d06679..2c95fa25945e 100644 --- a/cpp/velox/shuffle/VeloxGpuShuffleReader.cc +++ b/cpp/velox/shuffle/VeloxGpuShuffleReader.cc @@ -75,7 +75,6 @@ bool VeloxGpuHashShuffleReaderDeserializer::resolveNextBlockType() { default: throw GlutenException(fmt::format("Unsupported block type: {}", static_cast(blockType))); } - return true; } void VeloxGpuHashShuffleReaderDeserializer::loadNextStream() {