Compare commits
3 Commits
2e7b7313c3
...
8565ce782b
Author | SHA1 | Date | |
---|---|---|---|
|
8565ce782b | ||
|
1f5aa0874a | ||
|
179f106062 |
@ -1,15 +1,15 @@
|
|||||||
FROM nvidia/cuda:12.4.1-devel-ubi9 as builder
|
FROM nvidia/cuda:12.5.0-devel-ubi9 as builder
|
||||||
|
|
||||||
WORKDIR /home/ViolaJones/cpp
|
WORKDIR /home/ViolaJones/cpp
|
||||||
|
|
||||||
COPY *.cu *.cpp *.hpp Makefile ./
|
COPY *.cu *.cpp *.hpp Makefile ./
|
||||||
RUN make -j "$(nproc)"
|
RUN make -j "$(nproc)"
|
||||||
|
|
||||||
FROM nvidia/cuda:12.4.1-base-ubi9
|
FROM nvidia/cuda:12.5.0-base-ubi9
|
||||||
|
|
||||||
WORKDIR /home/ViolaJones/cpp
|
WORKDIR /home/ViolaJones/cpp
|
||||||
|
|
||||||
RUN dnf install -y make-1:4.3-7.el9 && dnf clean all
|
RUN dnf install -y make-1:4.3-8.el9 && dnf clean all
|
||||||
COPY --from=builder /home/ViolaJones/cpp/bin ./bin
|
COPY --from=builder /home/ViolaJones/cpp/bin ./bin
|
||||||
COPY --from=builder /home/ViolaJones/cpp/Makefile .
|
COPY --from=builder /home/ViolaJones/cpp/Makefile .
|
||||||
|
|
||||||
|
14
cpp/Makefile
14
cpp/Makefile
@ -8,7 +8,7 @@ DATA_PATH := ../data
|
|||||||
#CFLAGS := -O0 -g -G -pg -Xptxas=-w -Xcompiler -O0,-rdynamic,-g
|
#CFLAGS := -O0 -g -G -pg -Xptxas=-w -Xcompiler -O0,-rdynamic,-g
|
||||||
CFLAGS := -dlto -O2 -Xcompiler -O2
|
CFLAGS := -dlto -O2 -Xcompiler -O2
|
||||||
#CFLAGS := -dlto -O2 -g -Xcompiler -O2,-g,-ggdb
|
#CFLAGS := -dlto -O2 -g -Xcompiler -O2,-g,-ggdb
|
||||||
CFLAGS := $(CFLAGS) -MMD -MP -Werror=all-warnings -Xcompiler -Wall,-Werror,-Werror=implicit-fallthrough=0,-Wextra
|
CFLAGS := $(CFLAGS) -MMD -MP -Werror=all-warnings -Xcompiler -Wall,-Werror,-Wextra
|
||||||
EXEC := $(OBJ_DIR)/ViolaJones
|
EXEC := $(OBJ_DIR)/ViolaJones
|
||||||
DATA := $(DATA_PATH)/X_train.bin $(DATA_PATH)/X_test.bin $(DATA_PATH)/y_train.bin $(DATA_PATH)/y_test.bin
|
DATA := $(DATA_PATH)/X_train.bin $(DATA_PATH)/X_test.bin $(DATA_PATH)/y_train.bin $(DATA_PATH)/y_test.bin
|
||||||
SRC := $(shell find $(SRC_DIR) -name '*.cpp' -o -name '*.cu')
|
SRC := $(shell find $(SRC_DIR) -name '*.cpp' -o -name '*.cu')
|
||||||
@ -63,7 +63,7 @@ check: $(EXEC) $(DATA) | check-valgrind-works
|
|||||||
@valgrind -q -s --leak-check=full --show-leak-kinds=all $(EXEC)
|
@valgrind -q -s --leak-check=full --show-leak-kinds=all $(EXEC)
|
||||||
|
|
||||||
.PHONY: cudacheck
|
.PHONY: cudacheck
|
||||||
cudacheck: $(EXEC) $(DATA) | check-computer-sanitizer-works
|
cudacheck: $(EXEC) $(DATA) | check-compute-sanitizer-works
|
||||||
@compute-sanitizer --destroy-on-device-error kernel --tool memcheck --leak-check full --report-api-errors all --track-stream-ordered-races all --target-processes all $(EXEC)
|
@compute-sanitizer --destroy-on-device-error kernel --tool memcheck --leak-check full --report-api-errors all --track-stream-ordered-races all --target-processes all $(EXEC)
|
||||||
#@compute-sanitizer --destroy-on-device-error kernel --tool racecheck --racecheck-detect-level info --racecheck-report all $(EXEC)
|
#@compute-sanitizer --destroy-on-device-error kernel --tool racecheck --racecheck-detect-level info --racecheck-report all $(EXEC)
|
||||||
#@compute-sanitizer --destroy-on-device-error kernel --tool initcheck --track-unused-memory yes $(EXEC)
|
#@compute-sanitizer --destroy-on-device-error kernel --tool initcheck --track-unused-memory yes $(EXEC)
|
||||||
@ -88,9 +88,7 @@ log: $(DATA) reset
|
|||||||
.PHONY: reset
|
.PHONY: reset
|
||||||
reset:
|
reset:
|
||||||
@echo 'Deleting generated states and models'
|
@echo 'Deleting generated states and models'
|
||||||
@rm -frv $(OUT_DIR)/* $(MODELS_DIR)/*
|
@rm -frv $(OUT_DIR) $(MODELS_DIR)
|
||||||
#@ln -sv /mnt/pierre_stuffs/ViolaJones/cpp/models .
|
|
||||||
#@ln -sv /mnt/pierre_stuffs/ViolaJones/cpp/out .
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@ -130,8 +128,8 @@ check-dot-works:
|
|||||||
check-valgrind-works:
|
check-valgrind-works:
|
||||||
@valgrind --version >/dev/null 2>&1 || (echo 'Please install valgrind.' && exit 1)
|
@valgrind --version >/dev/null 2>&1 || (echo 'Please install valgrind.' && exit 1)
|
||||||
|
|
||||||
.PHONY: check-computer-sanitizer-works
|
.PHONY: check-compute-sanitizer-works
|
||||||
check-computer-sanitizer-works:
|
check-compute-sanitizer-works:
|
||||||
@computer-sanitizer --version >/dev/null 2>&1 || (echo 'Please install Compute Sanitizer from Cuda toolkit.' && exit 1)
|
@compute-sanitizer --version >/dev/null 2>&1 || (echo 'Please install Compute Sanitizer from Cuda toolkit.' && exit 1)
|
||||||
|
|
||||||
-include $(OBJ:.o=.d)
|
-include $(OBJ:.o=.d)
|
||||||
|
62
cpp/test.cpp
62
cpp/test.cpp
@ -1,62 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include "data.hpp"
|
|
||||||
#include "toolbox.hpp"
|
|
||||||
|
|
||||||
#define PBSTR "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"
|
|
||||||
#define PBWIDTH 60
|
|
||||||
|
|
||||||
void printProgress(const float64_t& percentage) noexcept {
|
|
||||||
const uint64_t val = static_cast<uint64_t>(percentage * 100);
|
|
||||||
const int32_t lpad = static_cast<int32_t>(percentage * PBWIDTH);
|
|
||||||
const int32_t rpad = PBWIDTH - lpad;
|
|
||||||
fprintf(stderr, "%3lu%% [%.*s%*s]\r", val, lpad, PBSTR, rpad, "");
|
|
||||||
fflush(stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void clearProgress(void) noexcept {
|
|
||||||
// Progress bar width + space before + num space + space after
|
|
||||||
fprintf(stderr, "%*c\r", PBWIDTH + 1 + 3 + 3, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void test(const uint64_t& N) noexcept {
|
|
||||||
#if __DEBUG
|
|
||||||
printf("DETERMINISTIC for N=%s of %s sized %s\n", thousand_sep(N).c_str(), typeid(T).name(), format_byte_size(sizeof(T)).c_str());
|
|
||||||
printf("Estimating memory footprint at : %s\n", format_byte_size(3 * N * sizeof(T)).c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
T *a = new T[N], *b = new T[N], *c = new T[N];
|
|
||||||
|
|
||||||
T mean = static_cast<T>(0.0);
|
|
||||||
const size_t percent = N / 100;
|
|
||||||
for(size_t i = 0; i < N; ++i){
|
|
||||||
if (i % percent == 0) printProgress(static_cast<float64_t>(i) / N);
|
|
||||||
a[i] = static_cast<T>(i < N>>1 ? 0.1 : 1.0);
|
|
||||||
b[i] = static_cast<T>(1.0);
|
|
||||||
c[i] = a[i] * b[i];
|
|
||||||
mean += c[i];
|
|
||||||
}
|
|
||||||
mean /= static_cast<T>(N);
|
|
||||||
|
|
||||||
clearProgress();
|
|
||||||
std::cout << mean << std::endl;
|
|
||||||
|
|
||||||
delete[] a, delete[] b, delete[] c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void test_float(void) noexcept {
|
|
||||||
std::cout << std::setprecision(1<<8);
|
|
||||||
const uint64_t N = static_cast<uint64_t>(1)<<28;
|
|
||||||
test<float128_t>(N);
|
|
||||||
test<float64_t>(N);
|
|
||||||
test<float32_t>(N);
|
|
||||||
|
|
||||||
//printf("%.128af\n", static_cast<float64_t>(1) / 3);
|
|
||||||
//std::cout << static_cast<float64_t>(1) / 3 << std::endl;
|
|
||||||
//std::cout << std::hexfloat << static_cast<float64_t>(1) / 3 << std::endl;
|
|
||||||
|
|
||||||
//printf("%.128Lf\n", static_cast<long float64_t>(1) / 3);
|
|
||||||
//printf("%.128lf\n", static_cast<float64_t>(1) / 3);
|
|
||||||
//printf("%.128f\n", static_cast<float>(1) / 3);
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
FROM alpine:3.19.1
|
FROM alpine:3.20.0
|
||||||
|
|
||||||
RUN apk add --no-cache curl=8.5.0-r0 python3=3.11.9-r0 && rm -rf /var/cache/apk*
|
RUN apk add --no-cache curl=8.7.1-r0 python3=3.12.3-r1 && rm -rf /var/cache/apk*
|
||||||
|
|
||||||
WORKDIR /home/ViolaJones/downloader
|
WORKDIR /home/ViolaJones/downloader
|
||||||
COPY requirements.txt activate.sh ./
|
COPY requirements.txt activate.sh ./
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
FROM nvidia/cuda:12.4.1-devel-ubi9 as builder
|
FROM nvidia/cuda:12.5.0-devel-ubi9 as builder
|
||||||
|
|
||||||
RUN dnf install -y python3.11-3.11.5-1.el9_3 && dnf clean all
|
RUN dnf install -y python3.11-3.11.7-1.el9 \
|
||||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
&& dnf clean all \
|
||||||
|
&& ln -s /usr/bin/python3 /usr/bin/python
|
||||||
|
|
||||||
WORKDIR /home/ViolaJones/python
|
WORKDIR /home/ViolaJones/python
|
||||||
COPY Makefile activate.sh requirements.txt ./
|
COPY Makefile activate.sh requirements.txt ./
|
||||||
|
Loading…
x
Reference in New Issue
Block a user