-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
3,985 additions
and
954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
name: Build benchmarks on Ubuntu | ||
on: [push, pull_request] | ||
name: Build Benchmarks on Ubuntu | ||
on: [push] | ||
jobs: | ||
BuildBenchmarks: | ||
# Only Ubuntu for now. | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: sudo apt-get update | ||
- run: sudo apt-get install -y build-essential ocl-icd-opencl-dev opencl-headers libnuma-dev | ||
- name: Install prerequisites | ||
run: sudo apt update && sudo apt -qq --assume-yes full-upgrade && sudo apt install -qq -y build-essential crossbuild-essential-arm64 gcc-riscv64-linux-gnu ocl-icd-opencl-dev opencl-headers libnuma-dev b3sum unzip | ||
- name: Wild tomfoolery attempt | ||
run: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew install mingw-w64 | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Try to build all benchmarks with a Makefile | ||
run: make -j4 all | ||
- name: Build all benchmarks | ||
run: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && make ci | ||
- name: Package benchmarks | ||
run: make package | ||
- name: b3sum | ||
run: b3sum clammarks.txz | ||
- name: Upload package | ||
env: | ||
UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }} | ||
UPLOAD_URL: ${{ secrets.UPLOAD_URL }} | ||
run: curl -X PUT -T clammarks.txz -H "$UPLOAD_KEY" "$UPLOAD_URL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
include ../Common/arch_detect.mk | ||
|
||
CFLAGS = -pthread -O3 | ||
|
||
all: $(TARGET) | ||
|
||
amd64: | ||
$(CC) $(CFLAGS) PThreadsCoherencyLatency.c -o CoherencyLatency_amd64 $(LDFLAGS) | ||
|
||
aarch64: | ||
$(CC) $(CFLAGS) PThreadsCoherencyLatency.c -o CoherencyLatency_aarch64 $(LDFLAGS) | ||
|
||
riscv64: | ||
$(CC) $(CFLAGS) PThreadsCoherencyLatency.c -o CoherencyLatency_riscv64 $(LDFLAGS) | ||
|
||
w64: | ||
$(CC) $(CFLAGS) CoherencyLatency.cpp -o CoherencyLatency_w64.exe $(LDFLAGS) | ||
|
||
# w64 can build with mingw 11, which isn't available on jammy | ||
|
||
ci: amd64 aarch64 riscv64 | ||
|
||
clean: | ||
rm -rf *.o *.zip "ocl-icd-libopencl1*" "OpenCL-SDK*" && find . -type f -executable -delete | ||
|
||
.PHONY: all ci clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
TARGET ?= amd64 | ||
|
||
ifeq ($(OS),Windows_NT) | ||
TARGET = w64 | ||
else | ||
UNAME_M := $(shell uname -m) | ||
ifeq ($(UNAME_M),x86_64) | ||
TARGET = amd64 | ||
endif | ||
ifeq ($(UNAME_M),aarch64) | ||
TARGET = aarch64 | ||
endif | ||
ifeq ($(UNAME_M),riscv64) | ||
TARGET = riscv64 | ||
endif | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Darwin) | ||
TARGET = darwin | ||
endif | ||
endif | ||
|
||
amd64: CC = x86_64-linux-gnu-gcc | ||
amd64_numa: CC = x86_64-linux-gnu-gcc | ||
aarch64: CC := aarch64-linux-gnu-gcc | ||
aarch64_numa: CC = aarch64-linux-gnu-gcc | ||
riscv64: CC = riscv64-linux-gnu-gcc | ||
w64: CC = x86_64-w64-mingw32-gcc | ||
darwin: CC = clang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
make_all () { | ||
make amd64 | ||
make clean-obj | ||
LDFLAGS="-lm -L ocl-icd-arm64/usr/lib/aarch64-linux-gnu -lOpenCL" make aarch64 | ||
make clean-obj | ||
LDFLAGS="-lm -L ocl-icd-riscv64/usr/lib/riscv64-linux-gnu -lOpenCL" make riscv64 | ||
make clean-obj | ||
CPPFLAGS="-I OpenCL-SDK-${OCL_VER}-Win-x64/include" LDFLAGS="-lm -L OpenCL-SDK-${OCL_VER}-Win-x64/lib -lOpenCL" make w64 | ||
make clean-obj | ||
} | ||
|
||
linux_deps () { | ||
for ARCH in arm64 riscv64; do | ||
if ! grep -q $ARCH /etc/apt/sources.list; then | ||
echo "deb [arch=${ARCH}] http://ports.ubuntu.com/ubuntu-ports $(lsb_release -c -s) universe" | sudo tee -a /etc/apt/sources.list | ||
echo "deb-src [arch=${ARCH}] http://ports.ubuntu.com/ubuntu-ports $(lsb_release -c -s) universe" | sudo tee -a /etc/apt/sources.list | ||
sudo apt update | ||
fi | ||
apt-get download "ocl-icd-libopencl1:${ARCH}" | ||
find . -type f -name "*${ARCH}*.deb" -exec dpkg-deb -x {} "ocl-icd-${ARCH}" \; | ||
done | ||
cp ocl-icd-arm64/usr/lib/aarch64-linux-gnu/libOpenCL.so.1 ocl-icd-arm64/usr/lib/aarch64-linux-gnu/libOpenCL.so | ||
cp ocl-icd-riscv64/usr/lib/riscv64-linux-gnu/libOpenCL.so.1 ocl-icd-riscv64/usr/lib/riscv64-linux-gnu/libOpenCL.so | ||
} | ||
|
||
w64_deps () { | ||
curl -fssLO "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/${OCL_VER}/OpenCL-SDK-${OCL_VER}-Win-x64.zip" | ||
unzip "OpenCL-SDK-${OCL_VER}-Win-x64.zip" | ||
} | ||
|
||
linux_deps | ||
w64_deps | ||
make_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
PKG="clammarks-$(git rev-parse --short HEAD)" | ||
rm -rf "$PKG" "clammarks.txz" | ||
mkdir -p "$PKG" | ||
|
||
for TARGET in "amd64" "aarch64" "riscv64" "w64"; do | ||
mkdir "$PKG/$TARGET" | ||
for COMPONENT in CoherencyLatency MemoryLatency MemoryBandwidth InstructionRate Meshsim CoreClockChecker GpuMemLatency; do | ||
find "$COMPONENT" -type f -name "*$TARGET*" -executable -exec cp {} "$PKG/$TARGET" \; | ||
done | ||
find "GpuMemLatency" -type f -name "*.cl" -exec cp {} "$PKG/$TARGET" \; | ||
done | ||
|
||
cp "LICENSE" "$PKG" | ||
|
||
tar caf "clammarks.txz" "$PKG" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
include ../Common/arch_detect.mk | ||
|
||
CFLAGS = -O3 | ||
LDFLAGS = -lm | ||
|
||
all: $(TARGET) | ||
|
||
amd64: | ||
x86_64-linux-gnu-gcc -pthread -O3 CoreClockChecker.c CoreClockChecker_x86.s -o CoreClockChecker -lm | ||
win64: | ||
x86_64-w64-mingw32-gcc -pthread -O3 CoreClockChecker.c CoreClockChecker_x86.s -o CoreClockChecker -lm | ||
boostclockchecker: | ||
gcc -O3 BoostClockChecker.c BoostClockChecker.s -o BoostClockChecker | ||
win64boostclockchecker: | ||
x86_64-w64-mingw32-gcc BoostClockChecker.c BoostClockChecker.s -o BoostClockChecker.exe | ||
$(CC) $(CFLAGS) -pthread CoreClockChecker.c CoreClockChecker_x86.s -o CoreClockChecker_amd64 $(LDFLAGS) | ||
$(CC) $(CFLAGS) BoostClockChecker.c BoostClockChecker_x86.s -o BoostClockChecker_amd64 $(LDFLAGS) | ||
|
||
aarch64: | ||
$(CC) $(CFLAGS) BoostClockChecker.c BoostClockChecker_arm.s -o BoostClockChecker_aarch64 $(LDFLAGS) | ||
|
||
w64: | ||
$(CC) $(CFLAGS) BoostClockChecker.c BoostClockChecker_x86.s -o BoostClockChecker_w64.exe $(LDFLAGS) | ||
|
||
ci: amd64 aarch64 w64 | ||
|
||
clean: | ||
rm -f *.o && find . -type f -executable -delete | ||
|
||
.PHONY: all ci clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,52 @@ | ||
UNAME_S := $(shell uname -s) | ||
CC = gcc | ||
CFLAGS = -O3 | ||
DEPS = ../common/timings.h | ||
OBJ = opencltest.o latency_test.o bw_test.o common.o atomic_test.o instruction_rate.o timing.o | ||
include ../Common/arch_detect.mk | ||
|
||
OCL_VER = v2023.04.17 | ||
CI_SCRIPT = ../Common/ci_gpumemlatency.sh | ||
|
||
ifeq ($(UNAME_S),Darwin) | ||
LDFLAGS += -framework OpenCL | ||
else | ||
LDFLAGS += -lOpenCL | ||
CFLAGS = -O3 -I ../Common | ||
DEPS = ../Common/timings.h | ||
OBJ = opencltest.o latency_test.o bw_test.o common.o atomic_test.o instruction_rate.o timing.o | ||
LDFLAGS ?= -lm -lOpenCL | ||
ifeq ($(TARGET), Darwin) | ||
LDFLAGS = -lm -framework OpenCL | ||
endif | ||
|
||
opencltest: $(OBJ) | ||
gcc $(CFLAGS) $^ -o $@ -lm $(LDFLAGS) | ||
all: $(TARGET) | ||
|
||
GpuMemLatency: $(OBJ) | ||
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
|
||
%.o: %.c $(DEPS) | ||
$(CC) $(CFLAGS) -c -o $@ $< | ||
|
||
timing.o: | ||
$(CC) $(CFLAGS) -c ../common/timing.c -o timing.o | ||
$(CC) $(CFLAGS) -c ../Common/timing.c -o timing.o | ||
|
||
amd64: $(OBJ) | ||
$(CC) $(CFLAGS) $^ -o GpuMemLatency_amd64 $(LDFLAGS) | ||
|
||
aarch64: $(OBJ) | ||
$(CC) $(CFLAGS) $^ -o GpuMemLatency_aarch64 $(LDFLAGS) | ||
|
||
riscv64: $(OBJ) | ||
$(CC) $(CFLAGS) $^ -o GpuMemLatency_riscv64 $(LDFLAGS) | ||
|
||
w64: $(OBJ) | ||
$(CC) $(CFLAGS) $^ -o GpuMemLatency_w64.exe $(LDFLAGS) | ||
|
||
darwin: $(OBJ) | ||
$(CC) $(CFLAGS) $^ -o GpuMemLatency_darwin $(LDFLAGS) | ||
|
||
ci: clean | ||
@OCL_VER=$(OCL_VER) sh $(CI_SCRIPT) | ||
|
||
clean-ci: | ||
rm -rf "*.deb" "*.zip" "ocl-icd-*" "OpenCL-SDK-*" | ||
|
||
clean-obj: | ||
rm -f *.o | ||
|
||
clean: clean-ci clean-obj | ||
find . -type f -executable -delete | ||
|
||
.PHONY: all ci clean-ci clean-obj clean |
Oops, something went wrong.