From 80b65a314c53a3a6eba5b40a1d7114ac05d0e766 Mon Sep 17 00:00:00 2001 From: Tiago Garcia Date: Sat, 29 Nov 2025 17:42:49 +0000 Subject: [PATCH] simd fixes Signed-off-by: Tiago Garcia --- aad_coin_miner_simd.c | 44 +++++++++++++++++++++---------------------- makefile | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/aad_coin_miner_simd.c b/aad_coin_miner_simd.c index d8af5a1..80ad2bb 100644 --- a/aad_coin_miner_simd.c +++ b/aad_coin_miner_simd.c @@ -211,13 +211,13 @@ static void mine_coins_avx(u64_t max_attempts, double max_time) } // Print progress every 1M attempts - if(attempts % 1000000 < SIMD_WIDTH) - { - elapsed = get_wall_time() - start_time; - double rate = attempts / elapsed; - printf("Attempts: %llu, Rate: %.2f MH/s, Coins: %u, Elapsed: %.2fs\n", - (unsigned long long)attempts, rate / 1e6, coins_found, elapsed); - } + // if(attempts % 1000000 < SIMD_WIDTH) + // { + // elapsed = get_wall_time() - start_time; + // double rate = attempts / elapsed; + // printf("Attempts: %llu, Rate: %.2f MH/s, Coins: %u, Elapsed: %.2fs\n", + // (unsigned long long)attempts, rate / 1e6, coins_found, elapsed); + // } } double total_time = get_wall_time() - start_time; @@ -313,13 +313,13 @@ static void mine_coins_avx2(u64_t max_attempts, double max_time) } } - if(attempts % 1000000 < SIMD_WIDTH) - { - elapsed = get_wall_time() - start_time; - double rate = attempts / elapsed; - printf("Attempts: %llu, Rate: %.2f MH/s, Coins: %u, Elapsed: %.2fs\n", - (unsigned long long)attempts, rate / 1e6, coins_found, elapsed); - } + // if(attempts % 1000000 < SIMD_WIDTH) + // { + // elapsed = get_wall_time() - start_time; + // double rate = attempts / elapsed; + // printf("Attempts: %llu, Rate: %.2f MH/s, Coins: %u, Elapsed: %.2fs\n", + // (unsigned long long)attempts, rate / 1e6, coins_found, elapsed); + // } } double total_time = get_wall_time() - start_time; @@ -452,14 +452,14 @@ static void mine_coins_avx2_omp(u64_t max_attempts, double max_time) #pragma omp atomic read current_attempts = attempts; - if(current_attempts - last_reported_attempts >= 1000000) - { - double elapsed = get_wall_time() - start_time; - double rate = current_attempts / elapsed; - printf("Attempts: %llu, Rate: %.2f MH/s, Coins: %u, Elapsed: %.2fs\n", - (unsigned long long)current_attempts, rate / 1e6, coins_found, elapsed); - last_reported_attempts = current_attempts; - } + // if(current_attempts - last_reported_attempts >= 1000000) + // { + // double elapsed = get_wall_time() - start_time; + // double rate = current_attempts / elapsed; + // printf("Attempts: %llu, Rate: %.2f MH/s, Coins: %u, Elapsed: %.2fs\n", + // (unsigned long long)current_attempts, rate / 1e6, coins_found, elapsed); + // last_reported_attempts = current_attempts; + // } } } } diff --git a/makefile b/makefile index 722359d..cefd502 100644 --- a/makefile +++ b/makefile @@ -77,7 +77,7 @@ coin_miner_cpu: aad_coin_miner_cpu.c aad_sha1.h aad_sha1_cpu.h aad_data_types.h cc -march=native -Wall -Wshadow -Werror -O3 $< -o $@ coin_miner_simd: aad_coin_miner_simd.c aad_sha1.h aad_sha1_cpu.h aad_data_types.h aad_utilities.h aad_vault.h makefile - cc -march=native -Wall -Wshadow -Werror -fopenmp -mavx2 -O3 $< -o $@ + cc -march=native -Wall -Wshadow -fopenmp -mavx2 -O3 $< -o $@ coin_miner_cuda_kernel.cubin: aad_coin_miner_cuda_kernel.cu aad_sha1.h makefile nvcc -arch=$(CUDA_ARCH) --compiler-options -O2,-Wall -I$(CUDA_DIR)/include --cubin $< -o $@