Skip to content
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

CPP/solution_2: add mask implementation #985

Merged
merged 11 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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