"src/vscode:/vscode.git/clone" did not exist on "56f740051dae2d410677292a5c9e5b66e60f87dc"
Unverified Commit 5e78e070 authored by Muhammed Fatih BALIN's avatar Muhammed Fatih BALIN Committed by GitHub
Browse files

[Misc] Fix signed unsigned comparison warning (#6602)

parent 1b3f14b0
......@@ -11,6 +11,8 @@
#include <dgl/runtime/ndarray.h>
#include <dmlc/logging.h>
#include <type_traits>
#include "../../runtime/cuda/cuda_common.h"
#include "dgl_cub.cuh"
......@@ -46,7 +48,8 @@ int _NumberOfBits(const T& range) {
}
int bits = 1;
while (bits < static_cast<int>(sizeof(T) * 8) && (1ull << bits) < range) {
const auto urange = static_cast<std::make_unsigned_t<T>>(range);
while (bits < static_cast<int>(sizeof(T) * 8) && (1ull << bits) < urange) {
++bits;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment