Skip to content

Commit

Permalink
CPP/solution_2: add mask implementation (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
davepl authored Nov 8, 2024
1 parent 9f09787 commit fed6d05
Show file tree
Hide file tree
Showing 9 changed files with 499 additions and 12 deletions.
3 changes: 2 additions & 1 deletion PrimeCPP/solution_2/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.vscore/**
.vscore/**
*.exe
14 changes: 10 additions & 4 deletions PrimeCPP/solution_2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
FROM ubuntu:22.04 AS build

RUN apt-get update -qq \
&& apt-get install -y clang
&& apt-get install -y bash clang

WORKDIR /opt/app
COPY *.cpp .
RUN clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_PAR.cpp -oprimes_par
RUN clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_array.cpp -oprimes_array \
&& clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_mask.cpp -oprimes_mask

FROM ubuntu:22.04
COPY --from=build /opt/app/primes_par /usr/local/bin

ENTRYPOINT [ "primes_par", "-l", "1000000" ]
COPY --from=build /opt/app/primes_array /opt/app/primes_mask /opt/app/

WORKDIR /opt/app
COPY benchmark.sh .

ENTRYPOINT [ "./benchmark.sh"]
CMD ["both", "-l", "1000000" ]
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class prime_sieve

// Following 2 lines added by rbergen to conform to drag race output format
cout << "\n";
cout << "davepl_par;" << passes << ";" << duration << ";" << threads << ";algorithm=base,faithful=yes,bits=1\n";
cout << "davepl_array;" << passes << ";" << duration << ";" << threads << ";algorithm=base,faithful=yes,bits=1\n";
}

};
Expand Down
Loading

0 comments on commit fed6d05

Please sign in to comment.