| … | … | @@ -1,31 +1,4 @@ |
| 1 | 1 | |
| 2 | | /* Copyright (C) 1991-2012 Free Software Foundation, Inc. |
| 3 | | This file is part of the GNU C Library. |
| 4 | | |
| 5 | | The GNU C Library is free software; you can redistribute it and/or |
| 6 | | modify it under the terms of the GNU Lesser General Public |
| 7 | | License as published by the Free Software Foundation; either |
| 8 | | version 2.1 of the License, or (at your option) any later version. |
| 9 | | |
| 10 | | The GNU C Library is distributed in the hope that it will be useful, |
| 11 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | | Lesser General Public License for more details. |
| 14 | | |
| 15 | | You should have received a copy of the GNU Lesser General Public |
| 16 | | License along with the GNU C Library; if not, see |
| 17 | | <http://www.gnu.org/licenses/>. */ |
| 18 | | /* This header is separate from features.h so that the compiler can |
| 19 | | include it implicitly at the start of every compilation. It must |
| 20 | | not itself include <features.h> or any other header that includes |
| 21 | | <features.h> because the implicit include comes before any feature |
| 22 | | test macros that may be defined in a source file before it first |
| 23 | | explicitly includes a system header. GCC knows the name of this |
| 24 | | header in order to preinclude it. */ |
| 25 | | /* We do support the IEC 559 math functionality, real and complex. */ |
| 26 | | /* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) / |
| 27 | | Unicode 6.0. */ |
| 28 | | /* We do not support C11 <threads.h>. */ |
| 29 | 2 | /* Copyright 2013-14. Los Alamos National Security, LLC. This material was produced |
| 30 | 3 | * under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National |
| 31 | 4 | * Laboratory (LANL), which is operated by Los Alamos National Security, LLC |
| … | … | @@ -63,6 +36,7 @@ |
| 63 | 36 | * @date Thu Jun 6 2013 |
| 64 | 37 | */ |
| 65 | 38 | // |
| 39 | |
| 66 | 40 | #include "HashFactory.h" |
| 67 | 41 | #ifdef HAVE_OPENCL |
| 68 | 42 | #ifdef __APPLE_CC__ |
| … | … | @@ -147,7 +121,9 @@ int clFinish(int command_queue) { |
| 147 | 121 | #endif |
| 148 | 122 | #define PRIME_NUM_CHECKS 20 |
| 149 | 123 | typedef unsigned int uint; |
| 124 | |
| 150 | 125 | #include <math.h> |
| 126 | |
| 151 | 127 | /* Copyright 2013-14. Los Alamos National Security, LLC. This material was produced |
| 152 | 128 | * under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National |
| 153 | 129 | * Laboratory (LANL), which is operated by Los Alamos National Security, LLC |
| … | … | @@ -179,6 +155,7 @@ typedef unsigned int uint; |
| 179 | 155 | * |
| 180 | 156 | * This is LANL Copyright Disclosure C14043/LA-CC-14-003 |
| 181 | 157 | */ |
| 158 | |
| 182 | 159 | /* Copyright 2013-14. Los Alamos National Security, LLC. This material was produced |
| 183 | 160 | * under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National |
| 184 | 161 | * Laboratory (LANL), which is operated by Los Alamos National Security, LLC |
| … | … | @@ -334,6 +311,7 @@ typedef unsigned int uint; |
| 334 | 311 | * |
| 335 | 312 | * This is LANL Copyright Disclosure C14043/LA-CC-14-003 |
| 336 | 313 | */ |
| 314 | |
| 337 | 315 | /* Copyright 2013-14. Los Alamos National Security, LLC. This material was produced |
| 338 | 316 | * under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National |
| 339 | 317 | * Laboratory (LANL), which is operated by Los Alamos National Security, LLC |
| … | … | @@ -458,14 +436,19 @@ typedef unsigned int uint; |
| 458 | 436 | * |
| 459 | 437 | * This is LANL Copyright Disclosure C14043/LA-CC-14-003 |
| 460 | 438 | */ |
| 439 | |
| 461 | 440 | static int reportLevel = 0; |
| 441 | |
| 462 | 442 | const char *HashFactory_source; |
| 443 | |
| 463 | 444 | const char *Hash_GetKernelSourceString() { |
| 464 | 445 | return HashFactory_source; |
| 465 | 446 | } |
| 447 | |
| 466 | 448 | size_t roundUpToNearest(size_t x, size_t r) { |
| 467 | 449 | return (((x - 1) / r) + 1) * r; |
| 468 | 450 | } |
| 451 | |
| 469 | 452 | int modularPow(int base, int exponent, int modulus) { |
| 470 | 453 | int result = 1; |
| 471 | 454 | while (exponent) { |
| … | … | @@ -476,6 +459,7 @@ int modularPow(int base, int exponent, int modulus) { |
| 476 | 459 | } |
| 477 | 460 | return result; |
| 478 | 461 | } |
| 462 | |
| 479 | 463 | int largestProthPrimeUnder(int N) { |
| 480 | 464 | if (N < 4) { |
| 481 | 465 | return N; |
| … | … | @@ -506,6 +490,7 @@ int largestProthPrimeUnder(int N) { |
| 506 | 490 | } |
| 507 | 491 | return 3; |
| 508 | 492 | } |
| 493 | |
| 509 | 494 | int smallestProthPrimeAbove(int N) { |
| 510 | 495 | if (N < 4) { |
| 511 | 496 | return N; |
| … | … | @@ -536,6 +521,7 @@ int smallestProthPrimeAbove(int N) { |
| 536 | 521 | } |
| 537 | 522 | return 3; |
| 538 | 523 | } |
| 524 | |
| 539 | 525 | int intLog2(int n) { |
| 540 | 526 | int result = 0; |
| 541 | 527 | while (n >>= 1) { |
| … | … | @@ -543,12 +529,15 @@ int intLog2(int n) { |
| 543 | 529 | } |
| 544 | 530 | return result; |
| 545 | 531 | } |
| 532 | |
| 546 | 533 | void Hash_SetReportLevel(int level) { |
| 547 | 534 | reportLevel = level; |
| 548 | 535 | } |
| 536 | |
| 549 | 537 | int Hash_GetReportLevel() { |
| 550 | 538 | return reportLevel; |
| 551 | 539 | } |
| 540 | |
| 552 | 541 | char *Hash_ExitCodeString(int exitCode) { |
| 553 | 542 | switch (exitCode) { |
| 554 | 543 | case HASH_EXIT_CODE_NORMAL: |
| … | … | @@ -567,6 +556,7 @@ char *Hash_ExitCodeString(int exitCode) { |
| 567 | 556 | return "Unknown"; |
| 568 | 557 | } |
| 569 | 558 | } |
| 559 | |
| 570 | 560 | void Hash_ExitCodeDebug(int exitCode) { |
| 571 | 561 | if (exitCode != HASH_EXIT_CODE_NORMAL) { |
| 572 | 562 | printf("HashExitCode: %s\n", Hash_ExitCodeString(exitCode)); |
| … | … | @@ -1052,11 +1042,11 @@ int intintIdentityPerfectHash_InnerInsertSingle(char *tableData, int key, |
| 1052 | 1042 | index = |
| 1053 | 1043 | intintHash_CompressIdentity(((intintIdentityPerfectHash_TableData *) |
| 1054 | 1044 | tableData)->compressFuncData, key); |
| 1055 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 1056 | | buckets[index]. |
| 1057 | | key = key; |
| 1058 | | HASH_BUCKET_STATUS_EMPTY;} |
| 1059 | | ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1045 | if (((buckets[index].key == |
| 1046 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 1047 | key, |
| 1048 | HASH_BUCKET_STATUS_EMPTY) : |
| 1049 | buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1060 | 1050 | if (key == buckets[index].key) { |
| 1061 | 1051 | exitCode = HASH_SEARCH_CODE_MATCH; |
| 1062 | 1052 | } else { |
| … | … | @@ -1093,13 +1083,11 @@ int intintIdentityPerfectHash_InnerInsert(char *tableData, |
| 1093 | 1083 | key = keys[i]; |
| 1094 | 1084 | index = |
| 1095 | 1085 | intintHash_CompressIdentity(((intintIdentityPerfectHash_TableData *) tableData)->compressFuncData, key); |
| 1096 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 1097 | | buckets |
| 1098 | | [index]. |
| 1099 | | key = |
| 1100 | | key; |
| 1101 | | HASH_BUCKET_STATUS_EMPTY;} |
| 1102 | | ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1086 | if (((buckets[index].key == |
| 1087 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 1088 | key, |
| 1089 | HASH_BUCKET_STATUS_EMPTY) : |
| 1090 | buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1103 | 1091 | if (key == buckets[index].key) { |
| 1104 | 1092 | exitCode = HASH_SEARCH_CODE_MATCH; |
| 1105 | 1093 | } else { |
| … | … | @@ -1131,11 +1119,11 @@ int intintIdentityPerfectHash_InnerInsertSingleNoOverwrite(char *tableData, |
| 1131 | 1119 | index = |
| 1132 | 1120 | intintHash_CompressIdentity(((intintIdentityPerfectHash_TableData *) |
| 1133 | 1121 | tableData)->compressFuncData, key); |
| 1134 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 1135 | | buckets[index]. |
| 1136 | | key = key; |
| 1137 | | HASH_BUCKET_STATUS_EMPTY;} |
| 1138 | | ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1122 | if (((buckets[index].key == |
| 1123 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 1124 | key, |
| 1125 | HASH_BUCKET_STATUS_EMPTY) : |
| 1126 | buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1139 | 1127 | if (key == buckets[index].key) { |
| 1140 | 1128 | exitCode = HASH_SEARCH_CODE_MATCH; |
| 1141 | 1129 | } else { |
| … | … | @@ -1171,13 +1159,11 @@ int intintIdentityPerfectHash_InnerInsertNoOverwrite(char *tableData, |
| 1171 | 1159 | key = keys[i]; |
| 1172 | 1160 | index = |
| 1173 | 1161 | intintHash_CompressIdentity(((intintIdentityPerfectHash_TableData *) tableData)->compressFuncData, key); |
| 1174 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 1175 | | buckets |
| 1176 | | [index]. |
| 1177 | | key = |
| 1178 | | key; |
| 1179 | | HASH_BUCKET_STATUS_EMPTY;} |
| 1180 | | ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1162 | if (((buckets[index].key == |
| 1163 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 1164 | key, |
| 1165 | HASH_BUCKET_STATUS_EMPTY) : |
| 1166 | buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) { |
| 1181 | 1167 | if (key == buckets[index].key) { |
| 1182 | 1168 | exitCode = HASH_SEARCH_CODE_MATCH; |
| 1183 | 1169 | } else { |
| … | … | @@ -2579,13 +2565,11 @@ int intintLCGLinearOpenCompactHash_InnerInsertSingle(char *tableData, int key, |
| 2579 | 2565 | c) % |
| 2580 | 2566 | ((intintLCGLinearOpenCompactHash_TableData *) tableData)-> |
| 2581 | 2567 | numBuckets); |
| 2582 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 2583 | | buckets |
| 2584 | | [index]. |
| 2585 | | key = |
| 2586 | | key; |
| 2587 | | HASH_BUCKET_STATUS_EMPTY;} |
| 2588 | | ): buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 2568 | if (((buckets[index].key == |
| 2569 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 2570 | key, |
| 2571 | HASH_BUCKET_STATUS_EMPTY) : |
| 2572 | buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 2589 | 2573 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 2590 | 2574 | break; |
| 2591 | 2575 | } else if (key == buckets[index].key) { |
| … | … | @@ -2635,14 +2619,11 @@ int intintLCGLinearOpenCompactHash_InnerInsert(char *tableData, |
| 2635 | 2619 | c) % |
| 2636 | 2620 | ((intintLCGLinearOpenCompactHash_TableData *) |
| 2637 | 2621 | tableData)->numBuckets); |
| 2638 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 2639 | | buckets |
| 2640 | | [index]. |
| 2641 | | key |
| 2642 | | = |
| 2643 | | key; |
| 2644 | | HASH_BUCKET_STATUS_EMPTY;} |
| 2645 | | ): buckets[index].key) == |
| 2622 | if (((buckets[index].key == |
| 2623 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 2624 | key, |
| 2625 | HASH_BUCKET_STATUS_EMPTY) |
| 2626 | : buckets[index].key) == |
| 2646 | 2627 | HASH_BUCKET_STATUS_EMPTY) { |
| 2647 | 2628 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 2648 | 2629 | break; |
| … | … | @@ -2688,13 +2669,11 @@ int intintLCGLinearOpenCompactHash_InnerInsertSingleNoOverwrite(char *tableData, |
| 2688 | 2669 | c) % |
| 2689 | 2670 | ((intintLCGLinearOpenCompactHash_TableData *) tableData)-> |
| 2690 | 2671 | numBuckets); |
| 2691 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 2692 | | buckets |
| 2693 | | [index]. |
| 2694 | | key = |
| 2695 | | key; |
| 2696 | | HASH_BUCKET_STATUS_EMPTY;} |
| 2697 | | ): buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 2672 | if (((buckets[index].key == |
| 2673 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 2674 | key, |
| 2675 | HASH_BUCKET_STATUS_EMPTY) : |
| 2676 | buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 2698 | 2677 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 2699 | 2678 | break; |
| 2700 | 2679 | } else if (key == buckets[index].key) { |
| … | … | @@ -2744,14 +2723,11 @@ int intintLCGLinearOpenCompactHash_InnerInsertNoOverwrite(char *tableData, |
| 2744 | 2723 | c) % |
| 2745 | 2724 | ((intintLCGLinearOpenCompactHash_TableData *) |
| 2746 | 2725 | tableData)->numBuckets); |
| 2747 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 2748 | | buckets |
| 2749 | | [index]. |
| 2750 | | key |
| 2751 | | = |
| 2752 | | key; |
| 2753 | | HASH_BUCKET_STATUS_EMPTY;} |
| 2754 | | ): buckets[index].key) == |
| 2726 | if (((buckets[index].key == |
| 2727 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 2728 | key, |
| 2729 | HASH_BUCKET_STATUS_EMPTY) |
| 2730 | : buckets[index].key) == |
| 2755 | 2731 | HASH_BUCKET_STATUS_EMPTY) { |
| 2756 | 2732 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 2757 | 2733 | break; |
| … | … | @@ -3452,13 +3428,11 @@ int intintLCGQuadraticOpenCompactHash_InnerInsertSingle(char *tableData, |
| 3452 | 3428 | c) % |
| 3453 | 3429 | ((intintLCGQuadraticOpenCompactHash_TableData *) |
| 3454 | 3430 | tableData)->numBuckets); |
| 3455 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 3456 | | buckets |
| 3457 | | [index]. |
| 3458 | | key = |
| 3459 | | key; |
| 3460 | | HASH_BUCKET_STATUS_EMPTY;} |
| 3461 | | ): buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 3431 | if (((buckets[index].key == |
| 3432 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 3433 | key, |
| 3434 | HASH_BUCKET_STATUS_EMPTY) : |
| 3435 | buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 3462 | 3436 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 3463 | 3437 | break; |
| 3464 | 3438 | } else if (key == buckets[index].key) { |
| … | … | @@ -3511,14 +3485,11 @@ int intintLCGQuadraticOpenCompactHash_InnerInsert(char *tableData, |
| 3511 | 3485 | c) % |
| 3512 | 3486 | ((intintLCGQuadraticOpenCompactHash_TableData *) |
| 3513 | 3487 | tableData)->numBuckets); |
| 3514 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 3515 | | buckets |
| 3516 | | [index]. |
| 3517 | | key |
| 3518 | | = |
| 3519 | | key; |
| 3520 | | HASH_BUCKET_STATUS_EMPTY;} |
| 3521 | | ): buckets[index].key) == |
| 3488 | if (((buckets[index].key == |
| 3489 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 3490 | key, |
| 3491 | HASH_BUCKET_STATUS_EMPTY) |
| 3492 | : buckets[index].key) == |
| 3522 | 3493 | HASH_BUCKET_STATUS_EMPTY) { |
| 3523 | 3494 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 3524 | 3495 | break; |
| … | … | @@ -3568,13 +3539,11 @@ int intintLCGQuadraticOpenCompactHash_InnerInsertSingleNoOverwrite(char |
| 3568 | 3539 | c) % |
| 3569 | 3540 | ((intintLCGQuadraticOpenCompactHash_TableData *) |
| 3570 | 3541 | tableData)->numBuckets); |
| 3571 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 3572 | | buckets |
| 3573 | | [index]. |
| 3574 | | key = |
| 3575 | | key; |
| 3576 | | HASH_BUCKET_STATUS_EMPTY;} |
| 3577 | | ): buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 3542 | if (((buckets[index].key == |
| 3543 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 3544 | key, |
| 3545 | HASH_BUCKET_STATUS_EMPTY) : |
| 3546 | buckets[index].key) == HASH_BUCKET_STATUS_EMPTY) { |
| 3578 | 3547 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 3579 | 3548 | break; |
| 3580 | 3549 | } else if (key == buckets[index].key) { |
| … | … | @@ -3628,14 +3597,11 @@ int intintLCGQuadraticOpenCompactHash_InnerInsertNoOverwrite(char *tableData, |
| 3628 | 3597 | c) % |
| 3629 | 3598 | ((intintLCGQuadraticOpenCompactHash_TableData *) |
| 3630 | 3599 | tableData)->numBuckets); |
| 3631 | | if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( { |
| 3632 | | buckets |
| 3633 | | [index]. |
| 3634 | | key |
| 3635 | | = |
| 3636 | | key; |
| 3637 | | HASH_BUCKET_STATUS_EMPTY;} |
| 3638 | | ): buckets[index].key) == |
| 3600 | if (((buckets[index].key == |
| 3601 | HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key = |
| 3602 | key, |
| 3603 | HASH_BUCKET_STATUS_EMPTY) |
| 3604 | : buckets[index].key) == |
| 3639 | 3605 | HASH_BUCKET_STATUS_EMPTY) { |
| 3640 | 3606 | exitCode = HASH_SEARCH_CODE_EMPTY; |
| 3641 | 3607 | break; |
| … | … | @@ -4145,33 +4111,6 @@ int intintLCGQuadraticOpenCompactCLHash_BufferInsertNoOverwrite(intintHash_Table |
| 4145 | 4111 | } |
| 4146 | 4112 | const char *HashFactory_source = |
| 4147 | 4113 | "\n" |
| 4148 | | "/* Copyright (C) 1991-2012 Free Software Foundation, Inc.\n" |
| 4149 | | " This file is part of the GNU C Library.\n" |
| 4150 | | "\n" |
| 4151 | | " The GNU C Library is free software; you can redistribute it and/or\n" |
| 4152 | | " modify it under the terms of the GNU Lesser General Public\n" |
| 4153 | | " License as published by the Free Software Foundation; either\n" |
| 4154 | | " version 2.1 of the License, or (at your option) any later version.\n" |
| 4155 | | "\n" |
| 4156 | | " The GNU C Library is distributed in the hope that it will be useful,\n" |
| 4157 | | " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" |
| 4158 | | " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" |
| 4159 | | " Lesser General Public License for more details.\n" |
| 4160 | | "\n" |
| 4161 | | " You should have received a copy of the GNU Lesser General Public\n" |
| 4162 | | " License along with the GNU C Library; if not, see\n" |
| 4163 | | " <http://www.gnu.org/licenses/>. */\n" |
| 4164 | | "/* This header is separate from features.h so that the compiler can\n" |
| 4165 | | " include it implicitly at the start of every compilation. It must\n" |
| 4166 | | " not itself include <features.h> or any other header that includes\n" |
| 4167 | | " <features.h> because the implicit include comes before any feature\n" |
| 4168 | | " test macros that may be defined in a source file before it first\n" |
| 4169 | | " explicitly includes a system header. GCC knows the name of this\n" |
| 4170 | | " header in order to preinclude it. */\n" |
| 4171 | | "/* We do support the IEC 559 math functionality, real and complex. */\n" |
| 4172 | | "/* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) /\n" |
| 4173 | | " Unicode 6.0. */\n" |
| 4174 | | "/* We do not support C11 <threads.h>. */\n" |
| 4175 | 4114 | "/* Copyright 2013-14. Los Alamos National Security, LLC. This material was produced\n" |
| 4176 | 4115 | " * under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National \n" |
| 4177 | 4116 | " * Laboratory (LANL), which is operated by Los Alamos National Security, LLC\n" |
| … | … | @@ -4203,6 +4142,7 @@ const char *HashFactory_source = |
| 4203 | 4142 | " *\n" |
| 4204 | 4143 | " * This is LANL Copyright Disclosure C14043/LA-CC-14-003\n" |
| 4205 | 4144 | " */\n" |
| 4145 | "\n" |
| 4206 | 4146 | "int intintIdentityPerfectCLHash_InsertSingle(__global char *tableData,\n" |
| 4207 | 4147 | " int key, int value);\n" |
| 4208 | 4148 | "int intintIdentityPerfectCLHash_InnerInsertSingle(__global char *tableData,\n" |
| … | … | @@ -4400,6 +4340,7 @@ const char *HashFactory_source = |
| 4400 | 4340 | " __global int *values);\n" |
| 4401 | 4341 | "int intintHash_InsertSingleNoOverwrite(__global char *tableData, int key,\n" |
| 4402 | 4342 | " int value);\n" |
| 4343 | "\n" |
| 4403 | 4344 | "#define HASH_REPORT_NEVER /**/ 0\n" |
| 4404 | 4345 | "#define HASH_REPORT_CYCLE /**/ 1\n" |
| 4405 | 4346 | "#define HASH_REPORT_END /****/ 2\n" |
| … | … | @@ -4537,11 +4478,11 @@ const char *HashFactory_source = |
| 4537 | 4478 | " intintHash_CompressIdentity(((__global\n" |
| 4538 | 4479 | " intintIdentityPerfectCLHash_TableData\n" |
| 4539 | 4480 | " *) tableData)->compressFuncData, key);\n" |
| 4540 | | " if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( {\n" |
| 4541 | | " buckets[index].\n" |
| 4542 | | " key = key;\n" |
| 4543 | | " HASH_BUCKET_STATUS_EMPTY;}\n" |
| 4544 | | " ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4481 | " if (((buckets[index].key ==\n" |
| 4482 | " HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key =\n" |
| 4483 | " key,\n" |
| 4484 | " HASH_BUCKET_STATUS_EMPTY) :\n" |
| 4485 | " buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4545 | 4486 | " if (key == buckets[index].key) {\n" |
| 4546 | 4487 | " exitCode = HASH_SEARCH_CODE_MATCH;\n" |
| 4547 | 4488 | " } else {\n" |
| … | … | @@ -4582,13 +4523,11 @@ const char *HashFactory_source = |
| 4582 | 4523 | " intintIdentityPerfectCLHash_TableData\n" |
| 4583 | 4524 | " *) tableData)->\n" |
| 4584 | 4525 | " compressFuncData, key);\n" |
| 4585 | | " if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( {\n" |
| 4586 | | " buckets\n" |
| 4587 | | " [index].\n" |
| 4588 | | " key =\n" |
| 4589 | | " key;\n" |
| 4590 | | " HASH_BUCKET_STATUS_EMPTY;}\n" |
| 4591 | | " ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4526 | " if (((buckets[index].key ==\n" |
| 4527 | " HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key =\n" |
| 4528 | " key,\n" |
| 4529 | " HASH_BUCKET_STATUS_EMPTY) :\n" |
| 4530 | " buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4592 | 4531 | " if (key == buckets[index].key) {\n" |
| 4593 | 4532 | " exitCode = HASH_SEARCH_CODE_MATCH;\n" |
| 4594 | 4533 | " } else {\n" |
| … | … | @@ -4623,11 +4562,11 @@ const char *HashFactory_source = |
| 4623 | 4562 | " intintHash_CompressIdentity(((__global\n" |
| 4624 | 4563 | " intintIdentityPerfectCLHash_TableData\n" |
| 4625 | 4564 | " *) tableData)->compressFuncData, key);\n" |
| 4626 | | " if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( {\n" |
| 4627 | | " buckets[index].\n" |
| 4628 | | " key = key;\n" |
| 4629 | | " HASH_BUCKET_STATUS_EMPTY;}\n" |
| 4630 | | " ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4565 | " if (((buckets[index].key ==\n" |
| 4566 | " HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key =\n" |
| 4567 | " key,\n" |
| 4568 | " HASH_BUCKET_STATUS_EMPTY) :\n" |
| 4569 | " buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4631 | 4570 | " if (key == buckets[index].key) {\n" |
| 4632 | 4571 | " exitCode = HASH_SEARCH_CODE_MATCH;\n" |
| 4633 | 4572 | " } else {\n" |
| … | … | @@ -4667,13 +4606,11 @@ const char *HashFactory_source = |
| 4667 | 4606 | " intintIdentityPerfectCLHash_TableData\n" |
| 4668 | 4607 | " *) tableData)->\n" |
| 4669 | 4608 | " compressFuncData, key);\n" |
| 4670 | | " if (((buckets[index].key == HASH_BUCKET_STATUS_EMPTY) ? ( {\n" |
| 4671 | | " buckets\n" |
| 4672 | | " [index].\n" |
| 4673 | | " key =\n" |
| 4674 | | " key;\n" |
| 4675 | | " HASH_BUCKET_STATUS_EMPTY;}\n" |
| 4676 | | " ): buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4609 | " if (((buckets[index].key ==\n" |
| 4610 | " HASH_BUCKET_STATUS_EMPTY) ? (buckets[index].key =\n" |
| 4611 | " key,\n" |
| 4612 | " HASH_BUCKET_STATUS_EMPTY) :\n" |
| 4613 | " buckets[index].key) != HASH_BUCKET_STATUS_EMPTY) {\n" |
| 4677 | 4614 | " if (key == buckets[index].key) {\n" |
| 4678 | 4615 | " exitCode = HASH_SEARCH_CODE_MATCH;\n" |
| 4679 | 4616 | " } else {\n" |