From 0fb27cd9c8cdf7be4e8117359c59c69577d6c956 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Mon, 3 Oct 2022 21:55:59 -0500
Subject: [PATCH] Fix bitlog2 for LLP systems (win)

---
 src/bitlog.hpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/bitlog.hpp b/src/bitlog.hpp
index 5d2e398b..c002fc39 100644
--- a/src/bitlog.hpp
+++ b/src/bitlog.hpp
@@ -55,6 +55,15 @@ namespace pyopencl
       return bitlog2_16(v);
   }
 
+#if defined(UINT64_MAX)
+  inline unsigned bitlog2(uint64_t v)
+  {
+    if (uint32_t t = v >> 32)
+      return 32+bitlog2_32(t);
+    else
+      return bitlog2_32(v);
+  }
+#else
   inline unsigned bitlog2(unsigned long v)
   {
 #if (ULONG_MAX != 4294967295)
@@ -64,6 +73,7 @@ namespace pyopencl
 #endif
       return bitlog2_32(v);
   }
+#endif
 }
 
 
-- 
GitLab