Skip to content
Open
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
47 changes: 29 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,31 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
cxx: [g++, clang++]
exclude:
- os: ubuntu-22.04-arm
cxx: clang++
fail-fast: false
env:
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install
run: |
sudo apt-get update -y
sudo apt-get install -y cppcheck ocl-icd-opencl-dev pocl-opencl-icd
$CXX --version
- name: Script
run: |
make prpll -O -j "$(nproc)"
make -O -j "$(nproc)"
cd build-release
rm -f -- *.o
./prpll -h
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
if: always()
with:
name: ${{ matrix.os }}_${{ matrix.cxx }}_prpll
name: ${{ matrix.os }}_${{ endsWith(matrix.os, '-arm') && 'arm' || 'x86' }}_${{ matrix.cxx }}_prpll
path: ${{ github.workspace }}
- name: Cppcheck
run: cppcheck --enable=all --force .
Expand All @@ -49,15 +52,17 @@ jobs:
Windows:
name: Windows

runs-on: windows-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest] # windows-11-arm
cxx: [g++, clang++]
fail-fast: false
env:
CXX: ${{ matrix.cxx }}
PACKAGE_PREFIX: mingw-w64-${{ endsWith(matrix.os, '-arm') && 'clang-aarch64' || 'x86_64' }}-
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Before Install
run: |
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand All @@ -66,42 +71,48 @@ jobs:
echo "LIBPATH=-LC:\msys64\mingw64\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install
run: |
pacman -S --noconfirm mingw-w64-x86_64-gmp mingw-w64-x86_64-opencl-icd
pacman -S --noconfirm "${env:PACKAGE_PREFIX}opencl-icd"
& $env:CXX --version
- name: Install Clang
if: ${{ matrix.cxx == 'clang++' }}
run: |
pacman -S --noconfirm mingw-w64-x86_64-clang
& $env:CXX --version
- name: Script
run: | # Cannot use `make exe`, as the OpenCL ICD Loader does not support static linking
make prpll -O -j $env:NUMBER_OF_PROCESSORS
run: |
make -O -j $env:NUMBER_OF_PROCESSORS
cd build-release
rm *.o
.\prpll.exe -h
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
if: always()
with:
name: win_${{ matrix.cxx }}_prpll
name: win_${{ endsWith(matrix.os, '-arm') && 'arm' || 'x86' }}_${{ matrix.cxx }}_prpll
path: ${{ github.workspace }}

macOS:
name: macOS

runs-on: macos-13
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15-intel, macos-latest]
fail-fast: false
env:
CXX: g++-15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install
run: |
brew install gcc@14
$CXX --version
- name: Script
run: |
make prpll -j "$(sysctl -n hw.ncpu)"
make -j "$(sysctl -n hw.ncpu)"
cd build-release
rm -f -- *.o
./prpll -h
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
if: always()
with:
name: macos_prpll
name: macos_${{ endsWith(matrix.os, '-intel') && 'x86' || 'arm' }}_prpll
path: ${{ github.workspace }}
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ HOST_OS = $(shell uname -s)

ifeq ($(HOST_OS), Darwin)
# Real GCC (not clang), needed for 128-bit floats and std::filesystem::path
CXX = g++-14
CXX ?= g++-15
else
CXX = g++
CXX ?= g++
endif

ifneq ($(findstring MINGW, $(HOST_OS)), MINGW)
Expand Down Expand Up @@ -45,7 +45,7 @@ else

BIN=build-release

CXXFLAGS = -O2 -DNDEBUG $(COMMON_FLAGS)
CXXFLAGS = -O3 -DNDEBUG $(COMMON_FLAGS)
STRIP=-s

endif
Expand Down Expand Up @@ -90,7 +90,7 @@ $(BIN)/%.o : src/%.cpp $(DEPDIR)/%.d
# src/bundle.cpp is just a wrapping of the OpenCL sources (*.cl) as a C string.

src/bundle.cpp: genbundle.sh src/cl/*.cl
./genbundle.sh $^ > src/bundle.cpp
bash genbundle.sh $^ > src/bundle.cpp

$(DEPDIR)/%.d: ;
.PRECIOUS: $(DEPDIR)/%.d
Expand Down
17 changes: 9 additions & 8 deletions genbundle.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
cat <<EOM
// Copyright (C) Mihai Preda
// Generated file, do not edit. See genbundle.sh and src/cl/*.cl
Expand All @@ -9,24 +10,24 @@ EOM

names=

for xx in $*
for xx in "$@"
do
x=`basename $xx`
x=$(basename "$xx")

if [ "$x" = "genbundle.sh" ] ; then continue ; fi

names=${names}\"${x}\",

echo // $xx
echo "// $xx"
#echo const char ${x}_cl[] = R\"cltag\(
echo R\"cltag\(
cat $xx
echo \)cltag\"\,
echo 'R"cltag('
cat "$xx"
echo ')cltag",'
echo
done
echo \}\;
echo '};'

echo static const std::vector\<const char*\> CL_FILE_NAMES\{${names}\}\;
echo "static const std::vector<const char*> CL_FILE_NAMES{${names}};"

cat <<EOM
const std::vector<const char*>& getClFileNames() { return CL_FILE_NAMES; }
Expand Down
2 changes: 1 addition & 1 deletion src/Args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ and should be able to run.
PRPLL keeps the active tasks in per-worker files worktodo-0.txt, worktodo-1.txt etc in the local directory.
These per-worker files are supplied from the global worktodo.txt file if -pool is used.
In turn the global worktodo.txt can be supplied through the primenet.py script,
either the one located at gpuowl/tools/primenet.py or https://download.mersenne.ca/primenet.py
either the one located at gpuowl/tools/primenet.py or https://download.mersenne.ca/AutoPrimeNet

It is also possible to manually add exponents by adding lines of the form "PRP=118063003" to worktodo-<N>.txt

Expand Down
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using i64 = int64_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
// using f128 = __float128;

static_assert(sizeof(u8) == 1, "size u8");
static_assert(sizeof(u32) == 4, "size u32");
Expand Down
2 changes: 1 addition & 1 deletion src/tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ void Tune::tune() {
config.write("\n -log 1000000\n");
}
if (args->workers < 2) {
config.write("\n# Running two workers sometimes gives better throughput. Autoprimenet will need to create up a second worktodo file.");
config.write("\n# Running two workers sometimes gives better throughput. AutoPrimeNet will need to create up a second worktodo file (use --num-workers 2).");
config.write("\n# -workers 2\n");
config.write("\n# Changing TAIL_KERNELS to 3 when running two workers may be better.");
config.write("\n# -use TAIL_KERNELS=3\n");
Expand Down
Loading