mirror of
https://codeberg.org/wownero/RandomWOW
synced 2026-03-05 22:27:33 -05:00
Flags ordered by their impact on performance
Additional error handling
This commit is contained in:
@@ -8,8 +8,7 @@ int main() {
|
||||
|
||||
randomx_cache *myCache = randomx_alloc_cache(RANDOMX_FLAG_DEFAULT);
|
||||
randomx_init_cache(myCache, mySeed, sizeof mySeed);
|
||||
randomx_vm *myMachine = randomx_create_vm(RANDOMX_FLAG_DEFAULT);
|
||||
randomx_vm_set_cache(myMachine, myCache);
|
||||
randomx_vm *myMachine = randomx_create_vm(RANDOMX_FLAG_DEFAULT, myCache, NULL);
|
||||
|
||||
randomx_calculate_hash(myMachine, &myInput, sizeof myInput, hash);
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@ int main() {
|
||||
t2.join();
|
||||
randomx_release_cache(myCache);
|
||||
|
||||
randomx_vm *myMachine = randomx_create_vm((randomx_flags)(RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_LARGE_PAGES));
|
||||
randomx_vm_set_dataset(myMachine, myDataset);
|
||||
randomx_vm *myMachine = randomx_create_vm((randomx_flags)(RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_LARGE_PAGES), nullptr, myDataset);
|
||||
|
||||
randomx_calculate_hash(myMachine, &myInput, sizeof myInput, hash);
|
||||
|
||||
|
||||
@@ -201,11 +201,11 @@ int main(int argc, char** argv) {
|
||||
std::cout << "Memory initialized in " << sw.getElapsed() << " s" << std::endl;
|
||||
std::cout << "Initializing " << threadCount << " virtual machine(s) ..." << std::endl;
|
||||
for (int i = 0; i < threadCount; ++i) {
|
||||
randomx_vm *vm = randomx_create_vm(flags);
|
||||
if (miningMode)
|
||||
randomx_vm_set_dataset(vm, dataset);
|
||||
else
|
||||
randomx_vm_set_cache(vm, cache);
|
||||
randomx_vm *vm = randomx_create_vm(flags, cache, dataset);
|
||||
if (vm == nullptr) {
|
||||
std::cout << "ERROR: Unsupported virtual machine options" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
vms.push_back(vm);
|
||||
}
|
||||
std::cout << "Running benchmark (" << noncesCount << " nonces) ..." << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user