-
Notifications
You must be signed in to change notification settings - Fork 9
convert hard-coded values to macros #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
728bb5a
replace hard-coded values with macros
ixfd64 d0a166c
correct mfaktc.ini to mfakto.ini
ixfd64 7616b02
fix C4108
ixfd64 1db8da0
Apply suggestions from code review
ixfd64 f9b0e7b
I think this should be snprintf()
ixfd64 05f79c8
update code comments
ixfd64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,6 @@ from 2^66 to 2^67. The OpenCL version, mfakto, requires MORE_CLASSES be defined. | |
| #define MORE_CLASSES | ||
|
|
||
|
|
||
|
|
||
| /* | ||
| THREADS_PER_BLOCK is not needed for OpenCL - it dynamically uses the device's maximum | ||
| All GPU-sieve kernels also have 256 threads per block. | ||
|
|
@@ -139,7 +138,6 @@ All GPU-sieve kernels also have 256 threads per block. | |
| //#define THREADS_PER_BLOCK 256 | ||
|
|
||
|
|
||
|
|
||
| /* | ||
| SIEVE_PRIMES defines how far we sieve the factor candidates. | ||
| The first <SIEVE_PRIMES> odd primes are sieved. | ||
|
|
@@ -213,7 +211,7 @@ Larger values may lead to less wasted cycles by reducing the number of times all | |
| are not TFing a candidate. However, more shared memory is used which may reduce occupancy. | ||
| Smaller values should lead to a more responsive system (each kernel takes less time to execute). | ||
|
|
||
| The actual configuration is done in mfaktc.ini. | ||
| The actual configuration is done in mfakto.ini. | ||
| The following lines define the min, default and max value. | ||
| */ | ||
|
|
||
|
|
@@ -229,15 +227,22 @@ The following lines define the min, default and max value. | |
| #define GPU_SIEVE_PROCESS_SIZE_DEFAULT 16 /* Default is processing 16K bits */ | ||
| #define GPU_SIEVE_PROCESS_SIZE_MAX 32 /* Upper limit is 64K, since we store k values as "short". Shared memory requirements limit usable values */ | ||
|
|
||
| /* For worktodo.txt files */ | ||
| #define MAX_LINE_LENGTH 100 | ||
| /* settings related to worktodo.txt file */ | ||
| #define WORKTODO_FILE "worktodo.txt" | ||
|
||
| #define MAX_LINE_LENGTH 100 | ||
|
|
||
| #define MAX_FACTORS_PER_JOB 20 | ||
| #define MAX_DEZ_96_STRING_LENGTH 30 // max value of int96 (unsigned) has 29 digits + 1 byte for NUL | ||
|
|
||
| #define MAX_FACTORS_PER_JOB 20 | ||
| #define MAX_DEZ_96_STRING_LENGTH 30 // max value of int96 (unsigned) has 29 digits + 1 byte for NUL | ||
| #define MAX_FACTOR_BUFFER_LENGTH MAX_FACTORS_PER_JOB * MAX_DEZ_96_STRING_LENGTH | ||
| #define MAX_BUFFER_LENGTH MAX_FACTOR_BUFFER_LENGTH + 100 | ||
|
|
||
| #define MAX_FACTOR_BUFFER_LENGTH MAX_FACTORS_PER_JOB * MAX_DEZ_96_STRING_LENGTH | ||
| #define MAX_BUFFER_LENGTH MAX_FACTOR_BUFFER_LENGTH + 100 | ||
| /* other files */ | ||
| #define CFG_FILE "mfakto.ini" | ||
| #define RESULTS_FILE "results.txt" | ||
| #define RESULTS_JSON_FILE "results.json.txt" | ||
|
|
||
| #define GHZDAYS_MAGIC_TF_TOP 0.016968 // magic constant for TF to 65 bits and above | ||
| #define GHZDAYS_MAGIC_TF_MID 0.017832 // magic constant for 63 and 64 bits | ||
| #define GHZDAYS_MAGIC_TF_BOT 0.011160 // magic constant for 62 bits and below | ||
| /* for GHz-day calculations */ | ||
| #define GHZDAYS_MAGIC_TF_TOP 0.016968 // magic constant for TF to 65 bits and above | ||
| #define GHZDAYS_MAGIC_TF_MID 0.017832 // magic constant for 63 and 64 bits | ||
| #define GHZDAYS_MAGIC_TF_BOT 0.011160 // magic constant for 62 bits and below | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.