| … | … | @@ -579,6 +579,7 @@ struct intintHash_Table_ { |
| 579 | 579 | char *tableData; |
| 580 | 580 | cl_mem tableDataBuffer; |
| 581 | 581 | int (*destroyFunc) (intintHash_Table *); |
| 582 | int (*setupFunc) (intintHash_Table *); |
| 582 | 583 | int (*emptyFunc) (intintHash_Table *); |
| 583 | 584 | int (*queryFunc) (intintHash_Table *, size_t, int *, int *); |
| 584 | 585 | int (*querySingleFunc) (intintHash_Table *, int, int *); |
| … | … | @@ -874,6 +875,10 @@ intintHash_Table *intintHash_CreateTable(intintHash_Factory * factory, |
| 874 | 875 | numEntries, loadFactor); |
| 875 | 876 | return table; |
| 876 | 877 | } |
| 878 | int intintHash_SetupTable(intintHash_Table * table) { |
| 879 | table->setupFunc(table); |
| 880 | return (0); |
| 881 | } |
| 877 | 882 | int intintHash_EmptyTable(intintHash_Table * table) { |
| 878 | 883 | table->emptyFunc(table); |
| 879 | 884 | return (0); |
| … | … | @@ -952,6 +957,7 @@ intintHash_Table *intintIdentityPerfectHash_CreateTable(intintHash_Factory * |
| 952 | 957 | intintHash_Table *table = |
| 953 | 958 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 954 | 959 | table->destroyFunc = &intintIdentityPerfectHash_DestroyTable; |
| 960 | table->setupFunc = &intintIdentityPerfectHash_SetupTable; |
| 955 | 961 | table->emptyFunc = &intintIdentityPerfectHash_EmptyTable; |
| 956 | 962 | table->queryFunc = &intintIdentityPerfectHash_Query; |
| 957 | 963 | table->querySingleFunc = &intintIdentityPerfectHash_QuerySingle; |
| … | … | @@ -995,6 +1001,23 @@ int intintIdentityPerfectHash_DestroyTable(intintHash_Table * table) { |
| 995 | 1001 | free(table); |
| 996 | 1002 | return exitCode; |
| 997 | 1003 | } |
| 1004 | int intintIdentityPerfectHash_SetupTable(intintHash_Table * table) { |
| 1005 | int exitCode = 0; |
| 1006 | intintIdentityPerfectHash_Bucket *buckets = |
| 1007 | (intintIdentityPerfectHash_Bucket *) & table-> |
| 1008 | tableData[sizeof(intintIdentityPerfectHash_TableData)]; |
| 1009 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 1010 | int index; |
| 1011 | for (index = 0; |
| 1012 | index < |
| 1013 | ((intintIdentityPerfectHash_TableData *) table-> |
| 1014 | tableData)->numBuckets; index++) { |
| 1015 | buckets[index].key = HASH_BUCKET_STATUS_EMPTY; |
| 1016 | } |
| 1017 | } |
| 1018 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 1019 | return exitCode; |
| 1020 | } |
| 998 | 1021 | int intintIdentityPerfectHash_EmptyTable(intintHash_Table * table) { |
| 999 | 1022 | int exitCode = 0; |
| 1000 | 1023 | intintIdentityPerfectHash_Bucket *buckets = |
| … | … | @@ -1286,6 +1309,7 @@ intintHash_Table *intintIdentityPerfectCLHash_CreateTable(intintHash_Factory * |
| 1286 | 1309 | intintHash_Table *table = |
| 1287 | 1310 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 1288 | 1311 | table->destroyFunc = &intintIdentityPerfectCLHash_DestroyTable; |
| 1312 | table->setupFunc = &intintIdentityPerfectCLHash_SetupTable; |
| 1289 | 1313 | table->emptyFunc = &intintIdentityPerfectCLHash_EmptyTable; |
| 1290 | 1314 | table->queryFunc = &intintIdentityPerfectCLHash_Query; |
| 1291 | 1315 | table->querySingleFunc = &intintIdentityPerfectCLHash_QuerySingle; |
| … | … | @@ -1427,6 +1451,30 @@ int intintIdentityPerfectCLHash_DestroyTable(intintHash_Table * table) { |
| 1427 | 1451 | free(table); |
| 1428 | 1452 | return exitCode; |
| 1429 | 1453 | } |
| 1454 | int intintIdentityPerfectCLHash_SetupTable(intintHash_Table * table) { |
| 1455 | int exitCode = 0; |
| 1456 | cl_int err; |
| 1457 | err = |
| 1458 | clSetKernelArg(table->emptyKernel, 0, sizeof(cl_mem), |
| 1459 | &table->tableDataBuffer); |
| 1460 | CLHash_Utilities_HandleError(err, |
| 1461 | "intintIdentityPerfectCLHash_EmptyTable", |
| 1462 | "clSetKernelArg"); |
| 1463 | const size_t groupWorkSize = |
| 1464 | roundUpToNearest(((intintIdentityPerfectHash_TableData *) table-> |
| 1465 | tableData)->numBuckets, |
| 1466 | table->emptyKernelLocalWorkSize); |
| 1467 | err = |
| 1468 | clEnqueueNDRangeKernel(table->queue, table->emptyKernel, 1, 0, |
| 1469 | &groupWorkSize, |
| 1470 | (const size_t *)&table-> |
| 1471 | emptyKernelLocalWorkSize, 0, NULL, NULL); |
| 1472 | CLHash_Utilities_HandleError(err, |
| 1473 | "intintIdentityPerfectCLHash_EmptyTable", |
| 1474 | "clEnqueueNDRangeKernel"); |
| 1475 | exitCode = HASH_EXIT_CODE_NORMAL;; |
| 1476 | return exitCode; |
| 1477 | } |
| 1430 | 1478 | int intintIdentityPerfectCLHash_EmptyTable(intintHash_Table * table) { |
| 1431 | 1479 | int exitCode = 0; |
| 1432 | 1480 | cl_int err; |
| … | … | @@ -1681,6 +1729,7 @@ intintHash_Table *intintIdentityPerfectOpenMPHash_CreateTable(intintHash_Factory |
| 1681 | 1729 | intintHash_Table *table = |
| 1682 | 1730 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 1683 | 1731 | table->destroyFunc = &intintIdentityPerfectOpenMPHash_DestroyTable; |
| 1732 | table->setupFunc = &intintIdentityPerfectOpenMPHash_SetupTable; |
| 1684 | 1733 | table->emptyFunc = &intintIdentityPerfectOpenMPHash_EmptyTable; |
| 1685 | 1734 | table->queryFunc = &intintIdentityPerfectOpenMPHash_Query; |
| 1686 | 1735 | table->querySingleFunc = &intintIdentityPerfectOpenMPHash_QuerySingle; |
| … | … | @@ -1725,6 +1774,23 @@ int intintIdentityPerfectOpenMPHash_DestroyTable(intintHash_Table * table) { |
| 1725 | 1774 | free(table); |
| 1726 | 1775 | return exitCode; |
| 1727 | 1776 | } |
| 1777 | int intintIdentityPerfectOpenMPHash_SetupTable(intintHash_Table * table) { |
| 1778 | int exitCode = 0; |
| 1779 | intintIdentityPerfectOpenMPHash_Bucket *buckets = |
| 1780 | (intintIdentityPerfectOpenMPHash_Bucket *) & table-> |
| 1781 | tableData[sizeof(intintIdentityPerfectOpenMPHash_TableData)]; |
| 1782 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 1783 | int index; |
| 1784 | for (index = 0; |
| 1785 | index < |
| 1786 | ((intintIdentityPerfectOpenMPHash_TableData *) table-> |
| 1787 | tableData)->numBuckets; index++) { |
| 1788 | buckets[index].key = HASH_BUCKET_STATUS_EMPTY; |
| 1789 | } |
| 1790 | } |
| 1791 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 1792 | return exitCode; |
| 1793 | } |
| 1728 | 1794 | int intintIdentityPerfectOpenMPHash_EmptyTable(intintHash_Table * table) { |
| 1729 | 1795 | int exitCode = 0; |
| 1730 | 1796 | intintIdentityPerfectOpenMPHash_Bucket *buckets = |
| … | … | @@ -2026,6 +2092,7 @@ intintHash_Table |
| 2026 | 2092 | intintHash_Table *table = |
| 2027 | 2093 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 2028 | 2094 | table->destroyFunc = &intintIdentitySentinelPerfectHash_DestroyTable; |
| 2095 | table->setupFunc = &intintIdentitySentinelPerfectHash_SetupTable; |
| 2029 | 2096 | table->emptyFunc = &intintIdentitySentinelPerfectHash_EmptyTable; |
| 2030 | 2097 | table->queryFunc = &intintIdentitySentinelPerfectHash_Query; |
| 2031 | 2098 | table->querySingleFunc = &intintIdentitySentinelPerfectHash_QuerySingle; |
| … | … | @@ -2073,6 +2140,25 @@ int intintIdentitySentinelPerfectHash_DestroyTable(intintHash_Table * table) { |
| 2073 | 2140 | free(table); |
| 2074 | 2141 | return exitCode; |
| 2075 | 2142 | } |
| 2143 | int intintIdentitySentinelPerfectHash_SetupTable(intintHash_Table * table) { |
| 2144 | int exitCode = 0; |
| 2145 | intintIdentitySentinelPerfectHash_Bucket *buckets = |
| 2146 | (intintIdentitySentinelPerfectHash_Bucket *) & table-> |
| 2147 | tableData[sizeof(intintIdentitySentinelPerfectHash_TableData)]; |
| 2148 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 2149 | int index; |
| 2150 | for (index = 0; |
| 2151 | index < |
| 2152 | ((intintIdentitySentinelPerfectHash_TableData *) table-> |
| 2153 | tableData)->numBuckets; index++) { |
| 2154 | buckets[index].value = |
| 2155 | ((intintIdentitySentinelPerfectHash_TableData *) |
| 2156 | table->tableData)->emptyValue; |
| 2157 | } |
| 2158 | } |
| 2159 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 2160 | return exitCode; |
| 2161 | } |
| 2076 | 2162 | int intintIdentitySentinelPerfectHash_EmptyTable(intintHash_Table * table) { |
| 2077 | 2163 | int exitCode = 0; |
| 2078 | 2164 | intintIdentitySentinelPerfectHash_Bucket *buckets = |
| … | … | @@ -2349,6 +2435,7 @@ intintHash_Table |
| 2349 | 2435 | intintHash_Table *table = |
| 2350 | 2436 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 2351 | 2437 | table->destroyFunc = &intintIdentitySentinelPerfectCLHash_DestroyTable; |
| 2438 | table->setupFunc = &intintIdentitySentinelPerfectCLHash_SetupTable; |
| 2352 | 2439 | table->emptyFunc = &intintIdentitySentinelPerfectCLHash_EmptyTable; |
| 2353 | 2440 | table->queryFunc = &intintIdentitySentinelPerfectCLHash_Query; |
| 2354 | 2441 | table->querySingleFunc = |
| … | … | @@ -2499,6 +2586,30 @@ int intintIdentitySentinelPerfectCLHash_DestroyTable(intintHash_Table * table) { |
| 2499 | 2586 | free(table); |
| 2500 | 2587 | return exitCode; |
| 2501 | 2588 | } |
| 2589 | int intintIdentitySentinelPerfectCLHash_SetupTable(intintHash_Table * table) { |
| 2590 | int exitCode = 0; |
| 2591 | cl_int err; |
| 2592 | err = |
| 2593 | clSetKernelArg(table->emptyKernel, 0, sizeof(cl_mem), |
| 2594 | &table->tableDataBuffer); |
| 2595 | CLHash_Utilities_HandleError(err, |
| 2596 | "intintIdentitySentinelPerfectCLHash_EmptyTable", |
| 2597 | "clSetKernelArg"); |
| 2598 | const size_t groupWorkSize = |
| 2599 | roundUpToNearest(((intintIdentitySentinelPerfectHash_TableData *) |
| 2600 | table->tableData)->numBuckets, |
| 2601 | table->emptyKernelLocalWorkSize); |
| 2602 | err = |
| 2603 | clEnqueueNDRangeKernel(table->queue, table->emptyKernel, 1, 0, |
| 2604 | &groupWorkSize, |
| 2605 | (const size_t *)&table-> |
| 2606 | emptyKernelLocalWorkSize, 0, NULL, NULL); |
| 2607 | CLHash_Utilities_HandleError(err, |
| 2608 | "intintIdentitySentinelPerfectCLHash_EmptyTable", |
| 2609 | "clEnqueueNDRangeKernel"); |
| 2610 | exitCode = HASH_EXIT_CODE_NORMAL;; |
| 2611 | return exitCode; |
| 2612 | } |
| 2502 | 2613 | int intintIdentitySentinelPerfectCLHash_EmptyTable(intintHash_Table * table) { |
| 2503 | 2614 | int exitCode = 0; |
| 2504 | 2615 | cl_int err; |
| … | … | @@ -2772,6 +2883,7 @@ intintHash_Table |
| 2772 | 2883 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 2773 | 2884 | table->destroyFunc = |
| 2774 | 2885 | &intintIdentitySentinelPerfectOpenMPHash_DestroyTable; |
| 2886 | table->setupFunc = &intintIdentitySentinelPerfectOpenMPHash_SetupTable; |
| 2775 | 2887 | table->emptyFunc = &intintIdentitySentinelPerfectOpenMPHash_EmptyTable; |
| 2776 | 2888 | table->queryFunc = &intintIdentitySentinelPerfectOpenMPHash_Query; |
| 2777 | 2889 | table->querySingleFunc = |
| … | … | @@ -2825,6 +2937,26 @@ int intintIdentitySentinelPerfectOpenMPHash_DestroyTable(intintHash_Table * |
| 2825 | 2937 | free(table); |
| 2826 | 2938 | return exitCode; |
| 2827 | 2939 | } |
| 2940 | int intintIdentitySentinelPerfectOpenMPHash_SetupTable(intintHash_Table * table) { |
| 2941 | int exitCode = 0; |
| 2942 | intintIdentitySentinelPerfectOpenMPHash_Bucket *buckets = |
| 2943 | (intintIdentitySentinelPerfectOpenMPHash_Bucket *) & table-> |
| 2944 | tableData[sizeof |
| 2945 | (intintIdentitySentinelPerfectOpenMPHash_TableData)]; |
| 2946 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 2947 | int index; |
| 2948 | for (index = 0; |
| 2949 | index < |
| 2950 | ((intintIdentitySentinelPerfectOpenMPHash_TableData *) |
| 2951 | table->tableData)->numBuckets; index++) { |
| 2952 | buckets[index].value = |
| 2953 | ((intintIdentitySentinelPerfectOpenMPHash_TableData |
| 2954 | *) table->tableData)->emptyValue; |
| 2955 | } |
| 2956 | } |
| 2957 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 2958 | return exitCode; |
| 2959 | } |
| 2828 | 2960 | int intintIdentitySentinelPerfectOpenMPHash_EmptyTable(intintHash_Table * table) { |
| 2829 | 2961 | int exitCode = 0; |
| 2830 | 2962 | intintIdentitySentinelPerfectOpenMPHash_Bucket *buckets = |
| … | … | @@ -3123,6 +3255,7 @@ intintHash_Table *intintLCGLinearOpenCompactHash_CreateTable(intintHash_Factory |
| 3123 | 3255 | intintHash_Table *table = |
| 3124 | 3256 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 3125 | 3257 | table->destroyFunc = &intintLCGLinearOpenCompactHash_DestroyTable; |
| 3258 | table->setupFunc = &intintLCGLinearOpenCompactHash_SetupTable; |
| 3126 | 3259 | table->emptyFunc = &intintLCGLinearOpenCompactHash_EmptyTable; |
| 3127 | 3260 | table->queryFunc = &intintLCGLinearOpenCompactHash_Query; |
| 3128 | 3261 | table->querySingleFunc = &intintLCGLinearOpenCompactHash_QuerySingle; |
| … | … | @@ -3177,6 +3310,23 @@ int intintLCGLinearOpenCompactHash_DestroyTable(intintHash_Table * table) { |
| 3177 | 3310 | free(table); |
| 3178 | 3311 | return exitCode; |
| 3179 | 3312 | } |
| 3313 | int intintLCGLinearOpenCompactHash_SetupTable(intintHash_Table * table) { |
| 3314 | int exitCode = 0; |
| 3315 | intintLCGLinearOpenCompactHash_Bucket *buckets = |
| 3316 | (intintLCGLinearOpenCompactHash_Bucket *) & table-> |
| 3317 | tableData[sizeof(intintLCGLinearOpenCompactHash_TableData)]; |
| 3318 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 3319 | int index; |
| 3320 | for (index = 0; |
| 3321 | index < |
| 3322 | ((intintLCGLinearOpenCompactHash_TableData *) table-> |
| 3323 | tableData)->numBuckets; index++) { |
| 3324 | buckets[index].key = HASH_BUCKET_STATUS_EMPTY; |
| 3325 | } |
| 3326 | } |
| 3327 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 3328 | return exitCode; |
| 3329 | } |
| 3180 | 3330 | int intintLCGLinearOpenCompactHash_EmptyTable(intintHash_Table * table) { |
| 3181 | 3331 | int exitCode = 0; |
| 3182 | 3332 | intintLCGLinearOpenCompactHash_Bucket *buckets = |
| … | … | @@ -3556,6 +3706,7 @@ intintHash_Table |
| 3556 | 3706 | intintHash_Table *table = |
| 3557 | 3707 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 3558 | 3708 | table->destroyFunc = &intintLCGLinearOpenCompactCLHash_DestroyTable; |
| 3709 | table->setupFunc = &intintLCGLinearOpenCompactCLHash_SetupTable; |
| 3559 | 3710 | table->emptyFunc = &intintLCGLinearOpenCompactCLHash_EmptyTable; |
| 3560 | 3711 | table->queryFunc = &intintLCGLinearOpenCompactCLHash_Query; |
| 3561 | 3712 | table->querySingleFunc = &intintLCGLinearOpenCompactCLHash_QuerySingle; |
| … | … | @@ -3710,6 +3861,30 @@ int intintLCGLinearOpenCompactCLHash_DestroyTable(intintHash_Table * table) { |
| 3710 | 3861 | free(table); |
| 3711 | 3862 | return exitCode; |
| 3712 | 3863 | } |
| 3864 | int intintLCGLinearOpenCompactCLHash_SetupTable(intintHash_Table * table) { |
| 3865 | int exitCode = 0; |
| 3866 | cl_int err; |
| 3867 | err = |
| 3868 | clSetKernelArg(table->emptyKernel, 0, sizeof(cl_mem), |
| 3869 | &table->tableDataBuffer); |
| 3870 | CLHash_Utilities_HandleError(err, |
| 3871 | "intintLCGLinearOpenCompactCLHash_EmptyTable", |
| 3872 | "clSetKernelArg"); |
| 3873 | const size_t groupWorkSize = |
| 3874 | roundUpToNearest(((intintLCGLinearOpenCompactHash_TableData *) |
| 3875 | table->tableData)->numBuckets, |
| 3876 | table->emptyKernelLocalWorkSize); |
| 3877 | err = |
| 3878 | clEnqueueNDRangeKernel(table->queue, table->emptyKernel, 1, 0, |
| 3879 | &groupWorkSize, |
| 3880 | (const size_t *)&table-> |
| 3881 | emptyKernelLocalWorkSize, 0, NULL, NULL); |
| 3882 | CLHash_Utilities_HandleError(err, |
| 3883 | "intintLCGLinearOpenCompactCLHash_EmptyTable", |
| 3884 | "clEnqueueNDRangeKernel"); |
| 3885 | exitCode = HASH_EXIT_CODE_NORMAL;; |
| 3886 | return exitCode; |
| 3887 | } |
| 3713 | 3888 | int intintLCGLinearOpenCompactCLHash_EmptyTable(intintHash_Table * table) { |
| 3714 | 3889 | int exitCode = 0; |
| 3715 | 3890 | cl_int err; |
| … | … | @@ -3973,6 +4148,7 @@ intintHash_Table |
| 3973 | 4148 | intintHash_Table *table = |
| 3974 | 4149 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 3975 | 4150 | table->destroyFunc = &intintLCGLinearOpenCompactOpenMPHash_DestroyTable; |
| 4151 | table->setupFunc = &intintLCGLinearOpenCompactOpenMPHash_SetupTable; |
| 3976 | 4152 | table->emptyFunc = &intintLCGLinearOpenCompactOpenMPHash_EmptyTable; |
| 3977 | 4153 | table->queryFunc = &intintLCGLinearOpenCompactOpenMPHash_Query; |
| 3978 | 4154 | table->querySingleFunc = |
| … | … | @@ -4032,6 +4208,23 @@ int intintLCGLinearOpenCompactOpenMPHash_DestroyTable(intintHash_Table * table) |
| 4032 | 4208 | free(table); |
| 4033 | 4209 | return exitCode; |
| 4034 | 4210 | } |
| 4211 | int intintLCGLinearOpenCompactOpenMPHash_SetupTable(intintHash_Table * table) { |
| 4212 | int exitCode = 0; |
| 4213 | intintLCGLinearOpenCompactOpenMPHash_Bucket *buckets = |
| 4214 | (intintLCGLinearOpenCompactOpenMPHash_Bucket *) & table-> |
| 4215 | tableData[sizeof(intintLCGLinearOpenCompactOpenMPHash_TableData)]; |
| 4216 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 4217 | int index; |
| 4218 | for (index = 0; |
| 4219 | index < |
| 4220 | ((intintLCGLinearOpenCompactOpenMPHash_TableData *) table-> |
| 4221 | tableData)->numBuckets; index++) { |
| 4222 | buckets[index].key = HASH_BUCKET_STATUS_EMPTY; |
| 4223 | } |
| 4224 | } |
| 4225 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 4226 | return exitCode; |
| 4227 | } |
| 4035 | 4228 | int intintLCGLinearOpenCompactOpenMPHash_EmptyTable(intintHash_Table * table) { |
| 4036 | 4229 | int exitCode = 0; |
| 4037 | 4230 | intintLCGLinearOpenCompactOpenMPHash_Bucket *buckets = |
| … | … | @@ -4425,6 +4618,7 @@ intintHash_Table |
| 4425 | 4618 | intintHash_Table *table = |
| 4426 | 4619 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 4427 | 4620 | table->destroyFunc = &intintLCGQuadraticOpenCompactHash_DestroyTable; |
| 4621 | table->setupFunc = &intintLCGQuadraticOpenCompactHash_SetupTable; |
| 4428 | 4622 | table->emptyFunc = &intintLCGQuadraticOpenCompactHash_EmptyTable; |
| 4429 | 4623 | table->queryFunc = &intintLCGQuadraticOpenCompactHash_Query; |
| 4430 | 4624 | table->querySingleFunc = &intintLCGQuadraticOpenCompactHash_QuerySingle; |
| … | … | @@ -4484,6 +4678,23 @@ int intintLCGQuadraticOpenCompactHash_DestroyTable(intintHash_Table * table) { |
| 4484 | 4678 | free(table); |
| 4485 | 4679 | return exitCode; |
| 4486 | 4680 | } |
| 4681 | int intintLCGQuadraticOpenCompactHash_SetupTable(intintHash_Table * table) { |
| 4682 | int exitCode = 0; |
| 4683 | intintLCGQuadraticOpenCompactHash_Bucket *buckets = |
| 4684 | (intintLCGQuadraticOpenCompactHash_Bucket *) & table-> |
| 4685 | tableData[sizeof(intintLCGQuadraticOpenCompactHash_TableData)]; |
| 4686 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 4687 | int index; |
| 4688 | for (index = 0; |
| 4689 | index < |
| 4690 | ((intintLCGQuadraticOpenCompactHash_TableData *) table-> |
| 4691 | tableData)->numBuckets; index++) { |
| 4692 | buckets[index].key = HASH_BUCKET_STATUS_EMPTY; |
| 4693 | } |
| 4694 | } |
| 4695 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 4696 | return exitCode; |
| 4697 | } |
| 4487 | 4698 | int intintLCGQuadraticOpenCompactHash_EmptyTable(intintHash_Table * table) { |
| 4488 | 4699 | int exitCode = 0; |
| 4489 | 4700 | intintLCGQuadraticOpenCompactHash_Bucket *buckets = |
| … | … | @@ -4884,6 +5095,7 @@ intintHash_Table |
| 4884 | 5095 | intintHash_Table *table = |
| 4885 | 5096 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 4886 | 5097 | table->destroyFunc = &intintLCGQuadraticOpenCompactCLHash_DestroyTable; |
| 5098 | table->setupFunc = &intintLCGQuadraticOpenCompactCLHash_SetupTable; |
| 4887 | 5099 | table->emptyFunc = &intintLCGQuadraticOpenCompactCLHash_EmptyTable; |
| 4888 | 5100 | table->queryFunc = &intintLCGQuadraticOpenCompactCLHash_Query; |
| 4889 | 5101 | table->querySingleFunc = |
| … | … | @@ -5045,6 +5257,30 @@ int intintLCGQuadraticOpenCompactCLHash_DestroyTable(intintHash_Table * table) { |
| 5045 | 5257 | free(table); |
| 5046 | 5258 | return exitCode; |
| 5047 | 5259 | } |
| 5260 | int intintLCGQuadraticOpenCompactCLHash_SetupTable(intintHash_Table * table) { |
| 5261 | int exitCode = 0; |
| 5262 | cl_int err; |
| 5263 | err = |
| 5264 | clSetKernelArg(table->emptyKernel, 0, sizeof(cl_mem), |
| 5265 | &table->tableDataBuffer); |
| 5266 | CLHash_Utilities_HandleError(err, |
| 5267 | "intintLCGQuadraticOpenCompactCLHash_EmptyTable", |
| 5268 | "clSetKernelArg"); |
| 5269 | const size_t groupWorkSize = |
| 5270 | roundUpToNearest(((intintLCGQuadraticOpenCompactHash_TableData *) |
| 5271 | table->tableData)->numBuckets, |
| 5272 | table->emptyKernelLocalWorkSize); |
| 5273 | err = |
| 5274 | clEnqueueNDRangeKernel(table->queue, table->emptyKernel, 1, 0, |
| 5275 | &groupWorkSize, |
| 5276 | (const size_t *)&table-> |
| 5277 | emptyKernelLocalWorkSize, 0, NULL, NULL); |
| 5278 | CLHash_Utilities_HandleError(err, |
| 5279 | "intintLCGQuadraticOpenCompactCLHash_EmptyTable", |
| 5280 | "clEnqueueNDRangeKernel"); |
| 5281 | exitCode = HASH_EXIT_CODE_NORMAL;; |
| 5282 | return exitCode; |
| 5283 | } |
| 5048 | 5284 | int intintLCGQuadraticOpenCompactCLHash_EmptyTable(intintHash_Table * table) { |
| 5049 | 5285 | int exitCode = 0; |
| 5050 | 5286 | cl_int err; |
| … | … | @@ -5318,6 +5554,7 @@ intintHash_Table |
| 5318 | 5554 | (intintHash_Table *) malloc(sizeof(intintHash_Table)); |
| 5319 | 5555 | table->destroyFunc = |
| 5320 | 5556 | &intintLCGQuadraticOpenCompactOpenMPHash_DestroyTable; |
| 5557 | table->setupFunc = &intintLCGQuadraticOpenCompactOpenMPHash_SetupTable; |
| 5321 | 5558 | table->emptyFunc = &intintLCGQuadraticOpenCompactOpenMPHash_EmptyTable; |
| 5322 | 5559 | table->queryFunc = &intintLCGQuadraticOpenCompactOpenMPHash_Query; |
| 5323 | 5560 | table->querySingleFunc = |
| … | … | @@ -5382,6 +5619,24 @@ int intintLCGQuadraticOpenCompactOpenMPHash_DestroyTable(intintHash_Table * |
| 5382 | 5619 | free(table); |
| 5383 | 5620 | return exitCode; |
| 5384 | 5621 | } |
| 5622 | int intintLCGQuadraticOpenCompactOpenMPHash_SetupTable(intintHash_Table * table) { |
| 5623 | int exitCode = 0; |
| 5624 | intintLCGQuadraticOpenCompactOpenMPHash_Bucket *buckets = |
| 5625 | (intintLCGQuadraticOpenCompactOpenMPHash_Bucket *) & table-> |
| 5626 | tableData[sizeof |
| 5627 | (intintLCGQuadraticOpenCompactOpenMPHash_TableData)]; |
| 5628 | if (intintHash_GetTableType(table) & ~HASH_SENTINEL_PERFECT_HASHES) { |
| 5629 | int index; |
| 5630 | for (index = 0; |
| 5631 | index < |
| 5632 | ((intintLCGQuadraticOpenCompactOpenMPHash_TableData *) |
| 5633 | table->tableData)->numBuckets; index++) { |
| 5634 | buckets[index].key = HASH_BUCKET_STATUS_EMPTY; |
| 5635 | } |
| 5636 | } |
| 5637 | exitCode = HASH_EXIT_CODE_NORMAL; |
| 5638 | return exitCode; |
| 5639 | } |
| 5385 | 5640 | int intintLCGQuadraticOpenCompactOpenMPHash_EmptyTable(intintHash_Table * table) { |
| 5386 | 5641 | int exitCode = 0; |
| 5387 | 5642 | intintLCGQuadraticOpenCompactOpenMPHash_Bucket *buckets = |