-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
34 lines (27 loc) · 1.38 KB
/
Copy pathrun.sh
File metadata and controls
34 lines (27 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# #!/bin/bash
# # 1. Compile với đầy đủ cờ C++17 và Optimization (như bạn đã chạy tay)
# # Thêm đuôi .exe vào output để rõ ràng trên Windows
# g++ -std=c++17 -O2 -o autoencoder_train.exe main.cpp autoencoder.cpp layers.cpp cifar10_dataset.cpp
# # 2. Chạy file .exe
# # Lưu ý: Kiểm tra lại đường dẫn "../data/cifar-10-binary" xem có đúng cấu trúc thư mục của bạn không
# ./autoencoder_train.exe ../data/cifar-10-binary
# GPU
# nvcc -o gpu_train main_gpu_train.cpp gpu_autoencoder.cpp kernels.cu cifar10_dataset.cpp -O2
# ./gpu_train ../data/cifar-10-binary
#!/bin/bash
# Compile Unified Program
# Sử dụng nvcc để biên dịch cả mã C++ và CUDA
# Flags: -O2 (Tối ưu hóa), -std=c++17 (Chuẩn C++), -lpsapi (Thư viện đo RAM cho Windows)
echo "Compiling..."
nvcc -o autoencoder_main.exe main.cpp autoencoder.cpp gpu_autoencoder.cpp layers.cpp cifar10_dataset.cpp kernels.cu kernels_v2.cu -O2 -lpsapi
if [ $? -eq 0 ]; then
echo "Compilation Successful!"
echo "Usage Examples:"
echo " ./autoencoder_main.exe --cpu ../data/cifar-10-binary"
echo " ./autoencoder_main.exe --gpu ../data/cifar-10-binary"
echo " ./autoencoder_main.exe --gpu-v2 ../data/cifar-10-binary"
else
echo "Compilation Failed!"
fi
# ./autoencoder_main.exe --cpu ../data/cifar-10-binary
# ./autoencoder_main.exe --gpu ../data/cifar-10-binary