[Openmp-commits] [PATCH] D96812: [OpenMP][NFC] Eliminate sign comparison warning via explicit casts

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 16 13:10:58 PST 2021


jdoerfert created this revision.
jdoerfert added a reviewer: tianshilei1992.
Herald added subscribers: guansong, yaxunl.
Herald added a reviewer: bollu.
jdoerfert requested review of this revision.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96812

Files:
  openmp/libomptarget/plugins/cuda/src/rtl.cpp


Index: openmp/libomptarget/plugins/cuda/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -10,7 +10,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <cassert>
 #include <cstddef>
 #include <cuda.h>
 #include <list>
@@ -229,7 +228,7 @@
     const std::lock_guard<std::mutex> Lock(*StreamMtx[DeviceId]);
     int &Id = NextStreamId[DeviceId];
     // No CUstream left in the pool, we need to request from CUDA RT
-    if (Id == StreamPool[DeviceId].size()) {
+    if (Id == int(StreamPool[DeviceId].size())) {
       // By default we double the stream pool every time
       resizeStreamPool(DeviceId, Id * 2);
     }
@@ -263,7 +262,7 @@
     resizeStreamPool(DeviceId, EnvNumInitialStreams);
 
     // Check the size of stream pool
-    if (StreamPool[DeviceId].size() != EnvNumInitialStreams)
+    if (int(StreamPool[DeviceId].size()) != EnvNumInitialStreams)
       return false;
 
     // Check whether each stream is valid


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96812.324086.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210216/f4309f22/attachment.bin>


More information about the Openmp-commits mailing list