View Single Post
Old 2021-08-29, 12:53   #29
Gimarel
 
Apr 2010

22·3·19 Posts
Default

Current git fails for inputs near 512 Bits. It seems that there is a condition the wrong way:
Code:
diff --git a/cgbn_stage1.cu b/cgbn_stage1.cu
index 1b512ecd..f67f8715 100644
--- a/cgbn_stage1.cu
+++ b/cgbn_stage1.cu
@@ -653,7 +653,7 @@ int run_cgbn(mpz_t *factors, int *array_stage_found,
 #endif /* IS_DEV_BUILD */
   for (int k_i = 0; k_i < available_kernels.size(); k_i++) {
     uint32_t kernel_bits = available_kernels[k_i];
-    if (kernel_bits + 6 >=  mpz_sizeinbase(N, 2)) {
+    if (kernel_bits >=  mpz_sizeinbase(N, 2) + 6) {
       BITS = kernel_bits;
       assert( BITS % 32 == 0 );
       TPI = (BITS <= 512) ? 4 : (BITS <= 2048) ? 8 : (BITS <= 8192) ? 16 : 32;
Gimarel is offline   Reply With Quote