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

a CUDA port of libsvm #160

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b19161b
Kernel interface change to batch_kernel_function(from kernel_function)
panqingfeng Jan 20, 2020
b1cc0e4
a CUDA port of libsvm
panqingfeng Jan 22, 2020
e8523d7
Update README
panqingfeng Jan 22, 2020
68d6cd9
a faster RBF_k_function
panqingfeng Jan 23, 2020
caa30c2
Merge branch 'master' of https://github.com/panqingfeng/libsvm
panqingfeng Jan 23, 2020
8c4d66a
a faster RBF_k_function, with less cudaMalloc/cudaFree
panqingfeng Feb 2, 2020
4dbd835
a faster RBF_kernel_function
panqingfeng Feb 5, 2020
75952f7
speed up with OpenMP, 2x speed up than single thread one
panqingfeng Feb 8, 2020
7edbb48
Update README
panqingfeng Feb 8, 2020
62243fb
Update README
panqingfeng Feb 8, 2020
d3df56d
use OpenMP collapse() for better performance
panqingfeng Feb 8, 2020
23f75c6
Merge branch 'master' of https://github.com/panqingfeng/libsvm
panqingfeng Feb 8, 2020
1489f5d
default omp_set_num_threads set to 2
panqingfeng Feb 9, 2020
d2ebf58
Change loop style to make new version OpenMP happy
panqingfeng Feb 10, 2020
6b86f45
less cudaMalloc/cudaFree, a new -u command line argument
panqingfeng Feb 11, 2020
a8b1b89
Update README
panqingfeng Feb 11, 2020
497d570
speed up host code with OpenMP, to catch up with the speed of GPU
panqingfeng Feb 12, 2020
e0c8f61
Merge branch 'master' of https://github.com/panqingfeng/libsvm
panqingfeng Feb 12, 2020
2a0d4c8
Update README
panqingfeng Feb 12, 2020
39d381a
speed up host code with OpenMP, to catch up with the speed of GPU
panqingfeng Feb 14, 2020
a287722
speed up host code with OpenMP, to catch up with the speed of GPU
panqingfeng Aug 28, 2020
78b2b62
Update README
panqingfeng Jan 7, 2021
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
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ svm-scale: svm-scale.c
svm.o: svm.cpp svm.h
$(CXX) $(CFLAGS) -c svm.cpp
clean:
rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER)
rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) svm-train-cuda svm-train.o svm-cuda.o

svm-train.o: svm-train.c
$(CXX) $(CFLAGS) -c svm-train.c
svm-cuda.o: svm.cpp
nvcc -Xcompiler -fopenmp -O3 -x cu -DSVM_CUDA -c svm.cpp -o svm-cuda.o
svm-train-cuda: svm-train.o svm-cuda.o
$(CXX) $(CFLAGS) svm-train.o svm-cuda.o -o svm-train-cuda -lm -lcusparse -lcublas -lcudart -fopenmp
14 changes: 14 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
How to build:
make clean; make svm-train-cuda

How to use:
run svm-train-cuda instead of svm-train, with same command line arguments of svm-train

tips
try add -h 0 as arguments of svm-train-cuda, it may faster than default one(-h 1)


///////////////////////////////////////////////////////////////////////////////////////



Libsvm is a simple, easy-to-use, and efficient software for SVM
classification and regression. It solves C-SVM classification, nu-SVM
classification, one-class-SVM, epsilon-SVM regression, and nu-SVM
Expand Down
Loading