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

Caffe OpenCL support #2610

Closed
wants to merge 405 commits into from
Closed
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
405 commits
Select commit Hold shift + click to select a range
95a0194
Update README.md
Jul 6, 2015
75c1e9b
Update README.md
Jul 6, 2015
d197026
Update README.md
Jul 6, 2015
723f4cd
Malis debugging version.
naibaf7 Jul 6, 2015
5da63bb
Disabled debug in Malis-loss layer.
naibaf7 Jul 7, 2015
da4b704
Preparations for ND-SK kernels and build system fixes.
naibaf7 Jul 7, 2015
6e34c7d
Lint fix.
naibaf7 Jul 7, 2015
a4c9703
Fixed CMAKE build.
naibaf7 Jul 7, 2015
7fa198d
Separated Malis loss layer into connected component, affinity and mal…
naibaf7 Jul 8, 2015
bcf9d3f
Resetting loss memory blobs.
naibaf7 Jul 8, 2015
52818c7
MALIS loss memory resetting.
naibaf7 Jul 8, 2015
7b38bb9
Merge branch 'master' of github.com:naibaf7/caffe
naibaf7 Jul 8, 2015
614bff7
MALIS loss memory reset.
naibaf7 Jul 8, 2015
7066d27
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 8, 2015
a136e4b
Caffe tool initialization fix.
naibaf7 Jul 8, 2015
5f6ce45
TryCatch block for broken OpenCL implementations.
naibaf7 Jul 8, 2015
5bf9e26
My Makefile configuration. Without OpenMP for now.
Jul 8, 2015
b06162c
ND-SK forward/backward layers for CUDA and OpenCL.
naibaf7 Jul 8, 2015
7bf78c1
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 8, 2015
fa384d4
Fixed prefetch thread conflicts with OpenCL.
naibaf7 Jul 9, 2015
d732db3
Fixed test binary for CMAKE compilation.
naibaf7 Jul 9, 2015
0313a56
Fixed CMAKE test target build (runtest).
naibaf7 Jul 9, 2015
52bd791
Changed CPU-OpenCL memory paradigmas, fixed OpenCL kernel for MVN.
naibaf7 Jul 10, 2015
fa95ef8
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 10, 2015
c1948cb
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 11, 2015
ffda2d5
Unit-tested ND-SK convolution layer, improved CPU memory model on Ope…
naibaf7 Jul 11, 2015
b7921dd
Update for CPU mode when compiling with Greentea or CUDA.
naibaf7 Jul 11, 2015
7de2f44
LINT fix.
naibaf7 Jul 11, 2015
d685823
Revised ND-SK kernels for convolution and pooling.
naibaf7 Jul 15, 2015
6c7821c
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 15, 2015
ad781ee
Removed logfile.
naibaf7 Jul 15, 2015
1bdbbf6
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 17, 2015
0bbbcdf
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 17, 2015
d99153d
Fixed draw_net.py for ND, SK and new repeated fields in those layers.
naibaf7 Jul 18, 2015
f5ab436
Updated MergeCrop layer parameters.
naibaf7 Jul 18, 2015
b2bceb8
Fixed loss division by zero bug.
naibaf7 Jul 18, 2015
5bc7afe
2nd attempt fixing zero valid labels present.
naibaf7 Jul 18, 2015
642ea00
NaN failure.
naibaf7 Jul 18, 2015
e060fbf
Another attempt at NaN loss fixing.
naibaf7 Jul 18, 2015
51d9be6
Fixed div by zero bug in MALIS loss function.
naibaf7 Jul 20, 2015
03f7afb
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 21, 2015
df74233
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 22, 2015
2970da7
Include CUDA only if uing CUDA. Using OpenCL and CPU only didn't need…
tzutalin Jul 22, 2015
1b9b37b
Merge pull request #5 from tzutalin/master
Jul 22, 2015
3a2e976
Updated drawing scripts for ND-SK networks.
naibaf7 Jul 22, 2015
3cc3a45
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 22, 2015
61d8808
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 23, 2015
036e2c9
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 28, 2015
78a464b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jul 31, 2015
9ebb32c
Makefile fix for OS X.
naibaf7 Aug 2, 2015
b28b2dc
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 3, 2015
dd99072
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 4, 2015
d712392
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 6, 2015
3a301a0
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 6, 2015
38c0cfe
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 7, 2015
9a9d11e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 7, 2015
84794f7
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 8, 2015
e1c83b2
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 9, 2015
e056ede
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 9, 2015
2bf3a3e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 10, 2015
8f76789
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 11, 2015
da5926b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 11, 2015
d5ba37d
Added preparations for device abstraction and Multi-GPU training.
naibaf7 Aug 15, 2015
7aaa39d
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 15, 2015
19f756b
Removed include for CUDA when not present.
naibaf7 Aug 15, 2015
5bfcdf6
Excluded CUDA Multi-GPU code in Greentea-only build.
naibaf7 Aug 15, 2015
afc89be
GPU device vector fixed in caffe.cpp
naibaf7 Aug 15, 2015
c066af7
Fixed gradient solver test CUDA exclusions.
naibaf7 Aug 15, 2015
a8ca694
CPU only fix
naibaf7 Aug 15, 2015
5cc8147
Fixed CPU only (second).
naibaf7 Aug 15, 2015
3930017
Fixed CPU only (3rd).
naibaf7 Aug 15, 2015
6d0ec67
CPU only initialization fix.
naibaf7 Aug 15, 2015
a6e0eec
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 16, 2015
4e709ea
Updated pointer types for Caffe object.
naibaf7 Aug 16, 2015
2806b26
Python GPU device initialization compability fix.
naibaf7 Aug 16, 2015
e8eaeec
cuDNN compability fix.
naibaf7 Aug 17, 2015
7ea76a3
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 17, 2015
ced83da
Fix includes for Greentea build with CMake.
naibaf7 Aug 19, 2015
0d137e9
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 20, 2015
2d24b88
CPU only fix.
naibaf7 Aug 20, 2015
dbdd223
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 20, 2015
e828cf2
Critical bugfix with OpenCL queues.
naibaf7 Aug 20, 2015
7cbe93e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 21, 2015
082d35e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 23, 2015
f84c2a4
Catching up with BVLC master.
naibaf7 Aug 23, 2015
30f2a0b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 25, 2015
4a687d4
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 25, 2015
ac9d92a
Synchronization bugfix.
naibaf7 Aug 25, 2015
4715ab6
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 26, 2015
eb2bf8d
Embed layer OpenCL preparations. Will still fail during runtest. Open…
naibaf7 Aug 26, 2015
78c4b81
OpenCL/CPU fix.
naibaf7 Aug 26, 2015
84757de
Cleanup in embed_layer.cu.
naibaf7 Aug 26, 2015
451337b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 26, 2015
765f5b1
EmbedLayer and TileLayer support in OpenCL.
naibaf7 Aug 26, 2015
5a2b4b5
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 26, 2015
522bf16
Cleanup.
naibaf7 Aug 26, 2015
cfbd0f6
Device capability check for EmbedLayer (64 bit atomics).
naibaf7 Aug 26, 2015
b3f8cf1
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 27, 2015
2ed20a4
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 27, 2015
c6ba512
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Aug 30, 2015
891d4f4
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 1, 2015
e513947
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 2, 2015
05ded2e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 4, 2015
a18a4fa
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 9, 2015
5c211c2
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 14, 2015
afaa6dc
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 14, 2015
b5eec63
Update README.md
Sep 14, 2015
66a1cec
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 16, 2015
539ae6a
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 17, 2015
6ed797e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 17, 2015
079af2c
Merge branch 'master' of https://github.com/naibaf7/caffe
Sep 18, 2015
bd7953b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 21, 2015
383f092
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 22, 2015
dd07c6f
Change DeviceContext to device, refactoring convolution layer.
naibaf7 Sep 22, 2015
6654fe7
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 22, 2015
05641a3
Fusing convolution layer code.
naibaf7 Sep 22, 2015
0d63694
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 24, 2015
eab0c29
Consolidation of PoolingND, PoolingSK, Pooling layers.
naibaf7 Sep 24, 2015
0dd688c
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 24, 2015
c963f5c
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 25, 2015
d8d5373
Grouped convolution fix.
naibaf7 Sep 25, 2015
1e92888
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 26, 2015
3eb9619
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 26, 2015
117b029
Removed temporary txt file.
naibaf7 Sep 26, 2015
6afda54
Convolution bias fix.
naibaf7 Sep 28, 2015
04bce35
SPP/Pooling layer padding fix.
naibaf7 Sep 28, 2015
e37972a
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Sep 29, 2015
3335be6
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 1, 2015
d06ee17
OpenCL convolution adapted.
naibaf7 Oct 2, 2015
eb44091
im2col_nd kernel fix in OpenCL
naibaf7 Oct 2, 2015
f9f8720
CUDA im2col fix.
naibaf7 Oct 4, 2015
ce411d7
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 5, 2015
5cdbd66
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 5, 2015
5d1539a
Merge branch 'master' of https://github.com/naibaf7/caffe
Oct 7, 2015
456e24d
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 7, 2015
346af4d
Merge branch 'master' of https://github.com/naibaf7/caffe
Oct 8, 2015
61a05f3
Python update, Lint fixes.
naibaf7 Oct 11, 2015
faf003a
Pycaffe check update.
naibaf7 Oct 11, 2015
9b9c8de
Merge branch 'master' of https://github.com/naibaf7/caffe
Oct 12, 2015
733b328
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 12, 2015
d62911c
LINT fix.
naibaf7 Oct 12, 2015
09fa574
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 13, 2015
8c64b14
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 14, 2015
977bd72
Reworked MALIS (flexibility/feature), added batch reindex layer for O…
naibaf7 Oct 14, 2015
202473d
Memory Data Layer fix.
naibaf7 Oct 15, 2015
20edccc
Merge branch 'master' of https://github.com/naibaf7/caffe
Oct 15, 2015
b63ed18
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 15, 2015
288e981
LINT fix.
naibaf7 Oct 16, 2015
5d200ca
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 17, 2015
0df8d82
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 17, 2015
5037c27
Merge branch 'master' of https://github.com/naibaf7/caffe
Oct 17, 2015
dc11681
64 bit indexing support throughout Caffe.
naibaf7 Oct 21, 2015
d02c1ae
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 23, 2015
8169691
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 23, 2015
f332d2c
Full 64 bit indexing support throughout Caffe.
naibaf7 Oct 24, 2015
037b724
LINT fix.
naibaf7 Oct 24, 2015
5ebebfb
Pycaffe fixed.
naibaf7 Oct 24, 2015
5095917
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 25, 2015
d82979b
Softmax fix for >4 shape dims.
naibaf7 Oct 25, 2015
01139b0
Fix for Malis, Softmax.
naibaf7 Oct 26, 2015
0797331
ViennaCL fix.
naibaf7 Oct 27, 2015
a9612f3
Merge branch 'master' of https://github.com/naibaf7/caffe
srinituraga Oct 27, 2015
8a7bb1f
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 28, 2015
2ef972e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Oct 31, 2015
165d231
Removed duplicate function.
naibaf7 Oct 31, 2015
f33e280
CL pooling SK kernel fix.
naibaf7 Oct 31, 2015
23d6ffd
ND pooling fix.
naibaf7 Nov 4, 2015
af4667e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 4, 2015
551ad62
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 5, 2015
2ed8b65
Merge branch 'master' of https://github.com/naibaf7/caffe
srinituraga Nov 6, 2015
b55c9b9
changed to square loss
srinituraga Nov 6, 2015
4ee23f6
remove my personal config file
srinituraga Nov 6, 2015
181f195
Merge pull request #14 from srinituraga/master
Nov 6, 2015
2bdba45
Malis cleanup, OpenCL ND pooling fix
naibaf7 Nov 7, 2015
aecda3c
Malis niceification for Srini.
naibaf7 Nov 7, 2015
f4c7360
Malis fix (2).
naibaf7 Nov 7, 2015
bd906d9
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 9, 2015
abb8846
Fixed malis loss for aniso.
naibaf7 Nov 14, 2015
9606b54
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 14, 2015
1d47ba5
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 18, 2015
39bb9c5
Malis correction.
naibaf7 Nov 19, 2015
f4ce3c3
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 21, 2015
70f290b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 24, 2015
85794ea
Affinity layer cleanup.
naibaf7 Nov 26, 2015
6643498
Fixed connected components.
naibaf7 Nov 26, 2015
842464f
Affinity offset fix.
naibaf7 Nov 26, 2015
2243213
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 27, 2015
d534293
Fixed MALIS for 2 and > 3 edges with !(x==y==z) input sizes.
naibaf7 Nov 27, 2015
bc5b3b8
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 27, 2015
91b022c
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Nov 29, 2015
3a51391
Malis small indexing change.
naibaf7 Nov 30, 2015
dbc1d1d
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 3, 2015
1148d80
Lint fix.
naibaf7 Dec 3, 2015
48ecfee
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 4, 2015
984745d
Expose SolverParameter to Python.
naibaf7 Dec 5, 2015
e2f8e70
Improved pycaffe interface.
naibaf7 Dec 6, 2015
576a347
Extended python interface.
naibaf7 Dec 7, 2015
a1a0d7f
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 10, 2015
52732be
Merge, stronger PyCaffe interface.
naibaf7 Dec 10, 2015
5b9bad5
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 12, 2015
97f9648
Multi-device advancements.
naibaf7 Dec 14, 2015
0cc7dc2
Updated device initialization.
naibaf7 Dec 17, 2015
03276d4
updated pycaffe init
naibaf7 Dec 19, 2015
d41646f
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 21, 2015
2de1d73
Euclidean loss rescaling.
naibaf7 Dec 21, 2015
a247341
Euclidean loss cast update.
naibaf7 Dec 21, 2015
d96e148
Euclid zero loss bug.
naibaf7 Dec 21, 2015
adf0049
Fixed euclid scaling.
naibaf7 Dec 22, 2015
615f802
Malis loss averaging.
naibaf7 Dec 23, 2015
923146a
Merge branch 'master' of github.com:naibaf7/caffe
naibaf7 Dec 23, 2015
2104120
CuDNN ND support
naibaf7 Dec 27, 2015
f2fcc37
CuDNN Pooling/Convolution ND fix.
naibaf7 Dec 27, 2015
677e844
Fallback to Caffe SK convolution/pooling when using cuDNN.
naibaf7 Dec 27, 2015
c40513d
Removed legacy accessor.Removed legacy accessor.
naibaf7 Dec 27, 2015
2d2052c
Colbuffer allocation prevention in cuDNN.
naibaf7 Dec 27, 2015
a38d44a
deterministic GEMM backard.
naibaf7 Dec 27, 2015
6e9fba4
Layer factory and dropout ND update.
naibaf7 Dec 27, 2015
7fd1f1e
Update layer_factory.cpp
Dec 28, 2015
ae61b64
32/64 bit indexing
naibaf7 Dec 29, 2015
f1a46f9
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 29, 2015
c366816
Selectable 64/32bit indexing compilation.
naibaf7 Dec 31, 2015
3dacf6f
Merge branch 'master' of github.com:naibaf7/caffe
naibaf7 Dec 31, 2015
0e998aa
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Dec 31, 2015
4d5edc0
Cleanup
naibaf7 Dec 31, 2015
938b362
Index64 definition in Makefile.
naibaf7 Dec 31, 2015
14537bf
Convolution kernel update, queue count update.
naibaf7 Dec 31, 2015
5c99e6c
Cleanup.
naibaf7 Dec 31, 2015
c1cdaa7
Convolution kernel fixes.
naibaf7 Jan 1, 2016
30cab07
Intel Beignet 1.1.1 kernel fixes.
naibaf7 Jan 1, 2016
fdd7efb
Linking ISAAC option.
naibaf7 Jan 3, 2016
5efd4f9
ISAAC support.
naibaf7 Jan 3, 2016
2860463
typo fix.
naibaf7 Jan 3, 2016
c0d52ce
CuDNN at least 4 dimensional tensors fix.
naibaf7 Jan 4, 2016
96b84b6
Expose snapshot format to python
naibaf7 Jan 6, 2016
2d0881e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 7, 2016
146687d
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 8, 2016
f85058b
Type int_tp fix.
naibaf7 Jan 8, 2016
d7962d1
OpenCL stochastic kernel backward bugfix.
naibaf7 Jan 9, 2016
782b8ac
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 20, 2016
5f2578e
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 23, 2016
87a2417
Merge branch 'master' of github.com:naibaf7/caffe
naibaf7 Jan 23, 2016
164218e
LINT fix.
naibaf7 Jan 23, 2016
84354bf
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 23, 2016
762d512
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 26, 2016
38cf580
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 26, 2016
8865334
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 26, 2016
cd7277b
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 27, 2016
8473f67
OpenCL Bias and Scale layers.
naibaf7 Jan 27, 2016
3181e8f
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 27, 2016
4085154
Merge branch 'master' of github.com:BVLC/caffe
naibaf7 Jan 29, 2016
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
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ include(cmake/Summary.cmake)
include(cmake/ConfigGen.cmake)

# ---[ Options
caffe_option(CPU_ONLY "Build Caffe wihtout CUDA support" OFF) # TODO: rename to USE_CUDA
caffe_option(USE_CUDNN "Build Caffe with cuDNN libary support" ON IF NOT CPU_ONLY)
caffe_option(CPU_ONLY "Build Caffe wihtout CUDA and OpenCL support" OFF) # TODO: rename to USE_CUDA
caffe_option(USE_CUDA "Build Caffe with CUDA support" ON)
caffe_option(USE_GREENTEA "Build Caffe with OpenCL support" ON)
caffe_option(USE_CUDNN "Build Caffe with cuDNN libary support" ON IF USE_CUDA AND NOT CPU_ONLY)
caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
caffe_option(BUILD_python "Build Python wrapper" ON)
set(python_version "2" CACHE STRING "Specify which python version to use")
Expand All @@ -29,11 +31,11 @@ include(cmake/Dependencies.cmake)

# ---[ Flags
if(UNIX OR APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for the big contribution 👍 .

Would -std=c++0x work? I think travis runs GCC 4.6 and only GCC 4.7 and later support -std=c++11.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: it's trivial to install a newer toolchain on Travis, see krasin/CuraEngine@976b373

endif()

if(USE_libstdcpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -std=c++11")
message("-- Warning: forcing libstdc++ (controlled by USE_libstdcpp option in cmake)")
endif()

Expand Down
25 changes: 25 additions & 0 deletions Greentea_Building_Blocks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
GREENTEA BUILDING BLOCKS:

viennacl::ocl::context &ctx = viennacl::ocl::get_context(
this->device_context_.id());
viennacl::ocl::program &program = Caffe::Get().GetDeviceProgram(
this->device_context_.id());

viennacl::ocl::kernel &oclk_kernel = program.get_kernel(
CL_KERNEL_SELECT("kernel"));
viennacl::ocl::enqueue(
oclk_kernel(WrapHandle((cl_mem) data, ctx)),
ctx.get_queue());

if (this->device_context_.backend() == BACKEND_CUDA) {
#ifdef USE_CUDA
#endif // USE_CUDA
} else {
#ifdef USE_GREENTEA
#endif // USE_GREENTEA
}

#ifdef USE_GREENTEA
#include "caffe/greentea/greentea.hpp"
#include "caffe/greentea/greentea_math_functions.hpp"
#endif
112 changes: 101 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ $(error $(CONFIG_FILE) not found. See $(CONFIG_FILE).example.)
endif
include $(CONFIG_FILE)

ifeq ($(CPU_ONLY),1)
USE_CUDA := 0
USE_GREENTEA := 0
endif

CXXFLAGS += -std=c++11 -Wno-deprecated-declarations
LINKFLAGS += -std=c++11 -Wno-deprecated-declarations
NVCCFLAGS += -Xcompiler "-Wno-deprecated-declarations" -Xlinker "-Wno-deprecated-declarations" -Xarchive "-Wno-deprecated-declarations" -Xnvlink "-Wno-deprecated-declarations"

BUILD_DIR_LINK := $(BUILD_DIR)
ifeq ($(RELEASE_BUILD_DIR),)
RELEASE_BUILD_DIR := .$(BUILD_DIR)_release
Expand All @@ -24,6 +33,7 @@ else
OTHER_BUILD_DIR := $(DEBUG_BUILD_DIR)
endif


# All of the directories containing code.
SRC_DIRS := $(shell find * -type d -exec bash -c "find {} -maxdepth 1 \
\( -name '*.cpp' -o -name '*.proto' \) | grep -q ." \; -print)
Expand Down Expand Up @@ -151,6 +161,78 @@ ALL_WARNS := $(ALL_CXX_WARNS) $(ALL_CU_WARNS)
EMPTY_WARN_REPORT := $(BUILD_DIR)/.$(WARNS_EXT)
NONEMPTY_WARN_REPORT := $(BUILD_DIR)/$(WARNS_EXT)

##############################
# GreenTea backend related include and lib
##############################

ifeq ($(USE_GREENTEA),1)
# Find a valid OpenCL library
# TODO: Validate and complete this based on different SDKs
ifdef OPENCL_INC
CLLINC = '$(OPENCL_INC)'
endif

ifdef OPENCL_LIB
CLLIBS = '$(OPENCL_LIB)'
endif

ifdef OPENCLROOT
CLLIBS = '$(OPENCLROOT)'
endif

ifdef CUDA_PATH
CLLIBS = '$(CUDA_PATH)/lib/x64'
endif

ifdef INTELOCLSDKROOT
CLLIBS = '$(INTELOCLSDKROOT)/lib/x64'
endif

ifdef AMDAPPSDKROOT
CLLIBS = '$(AMDAPPSDKROOT)/lib/x86_64'
CLLINC = '$(AMDAPPSDKROOT)/include'
endif

# Use AMD clBLAS
ifeq ($(USE_CLBLAS), 1)
LIBRARIES += clBLAS
COMMON_FLAGS += -DUSE_CLBLAS
endif

# Use ViennaCL BLAS
ifeq ($(USE_VIENNACLBLAS), 1)
LIBRARIES += viennacl
COMMON_FLAGS += -DUSE_VIENNACLBLAS
endif

# Requires valid OpenCL library
LIBRARY_DIRS += $(CLLIBS)
# Requires valid OpenCL headers and valid ViennaCL
INCLUDE_DIRS += $(CLLINC) $(VIENNACL_DIR)
# Requires OpenCL compile library flag and librt
LIBRARIES += OpenCL rt
# Additional flags
COMMON_FLAGS += -DUSE_GREENTEA -DVIENNACL_WITH_OPENCL

# Viennacl runtime debug output
ifeq ($(DEBUG), 1)
COMMON_FLAGS += -DVIENNACL_DEBUG_ALL
endif

ifeq ($(GREENTEA_DOUBLE_SUPPORT), 1)
COMMON_FLAGS += -DGREENTEA_DOUBLE_SUPPORT
endif

CL_KERNELS_CPP = src/caffe/greentea/cl_kernels.cpp
CL_KERNELS = src/caffe/greentea/cl_kernels/*.cl
CL_HEADERS = src/caffe/greentea/cl_headers/*.cl
CL_KERNELS_SH = src/caffe/greentea/cl_kernels.sh
endif

ifeq ($(USE_CUDA), 1)
COMMON_FLAGS += -DUSE_CUDA
endif

##############################
# Derive include and lib directories
##############################
Expand All @@ -167,7 +249,7 @@ INCLUDE_DIRS += $(BUILD_INCLUDE_DIR) ./src ./include
ifneq ($(CPU_ONLY), 1)
INCLUDE_DIRS += $(CUDA_INCLUDE_DIR)
LIBRARY_DIRS += $(CUDA_LIB_DIR)
LIBRARIES := cudart cublas curand
LIBRARIES += cudart cublas curand
endif
LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
Expand All @@ -179,7 +261,6 @@ WARNINGS := -Wall -Wno-sign-compare
# Set build directories
##############################

DISTRIBUTE_DIR ?= distribute
DISTRIBUTE_SUBDIRS := $(DISTRIBUTE_DIR)/bin $(DISTRIBUTE_DIR)/lib
DIST_ALIASES := dist
ifneq ($(strip $(DISTRIBUTE_DIR)),distribute)
Expand Down Expand Up @@ -241,15 +322,13 @@ endif
# libstdc++ for NVCC compatibility on OS X >= 10.9 with CUDA < 7.0
ifeq ($(OSX), 1)
CXX := /usr/bin/clang++
ifneq ($(CPU_ONLY), 1)
CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release \d' | grep -o '\d')
ifeq ($(shell echo $(CUDA_VERSION) \< 7.0 | bc), 1)
CXXFLAGS += -stdlib=libstdc++
LINKFLAGS += -stdlib=libstdc++
endif
# clang throws this warning for cuda headers
WARNINGS += -Wno-unneeded-internal-declaration
CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release \d' | grep -o '\d')
ifeq ($(shell echo $(CUDA_VERSION) \< 7.0 | bc), 1)
CXXFLAGS += -stdlib=libstdc++
LINKFLAGS += -stdlib=libstdc++
endif
# clang throws this warning for cuda headers
WARNINGS += -Wno-unneeded-internal-declaration
# gtest needs to use its own tuple to not conflict with clang
COMMON_FLAGS += -DGTEST_USE_OWN_TR1_TUPLE=1
# boost::thread is called boost_thread-mt to mark multithreading on OS X
Expand Down Expand Up @@ -390,7 +469,7 @@ endif
py mat py$(PROJECT) mat$(PROJECT) proto runtest \
superclean supercleanlist supercleanfiles warn everything

all: $(STATIC_NAME) $(DYNAMIC_NAME) tools examples
all: $(CL_KERNELS_CPP) $(STATIC_NAME) $(DYNAMIC_NAME) tools examples

everything: $(EVERYTHING_TARGETS)

Expand Down Expand Up @@ -526,12 +605,19 @@ $(PROTO_BUILD_DIR)/%.pb.o: $(PROTO_BUILD_DIR)/%.pb.cc $(PROTO_GEN_HEADER) \
@ cat $@.$(WARNS_EXT)

$(BUILD_DIR)/cuda/%.o: %.cu | $(ALL_BUILD_DIRS)
ifeq ($(USE_CUDA), 1)
@ echo NVCC $<
$(Q)$(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -M $< -o ${@:.o=.d} \
-odir $(@D)
$(Q)$(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -c $< -o $@ 2> $@.$(WARNS_EXT) \
|| (cat $@.$(WARNS_EXT); exit 1)
@ cat $@.$(WARNS_EXT)
else
@ echo CXX $<
$(Q)$(CXX) $(CXXFLAGS) -c -x c++ $< -o $@ 2> $@.$(WARNS_EXT) \
|| (cat $@.$(WARNS_EXT); exit 1)
@ cat $@.$(WARNS_EXT)
endif

$(TEST_ALL_BIN): $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJ) \
| $(DYNAMIC_NAME) $(TEST_BIN_DIR)
Expand Down Expand Up @@ -566,6 +652,10 @@ $(EXAMPLE_BINS): %.bin : %.o | $(DYNAMIC_NAME)
$(Q)$(CXX) $< -o $@ $(LINKFLAGS) -l$(PROJECT) $(LDFLAGS) \
-Wl,-rpath,$(ORIGIN)/../../lib

# Copy the OpenCL kernels into C++ char strings
$(CL_KERNELS_CPP) : $(CL_HEADERS) $(CL_KERNELS)
$(CL_KERNELS_SH)

proto: $(PROTO_GEN_CC) $(PROTO_GEN_HEADER)

$(PROTO_BUILD_DIR)/%.pb.cc $(PROTO_BUILD_DIR)/%.pb.h : \
Expand Down
24 changes: 23 additions & 1 deletion Makefile.config.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# GreenTea (ViennaCL/OpenCL) backend switch

# Enable the CUDA backend
USE_CUDA := 1

# Enable the OpenCL/Greentea backend
USE_GREENTEA := 1

# Folder of the ViennaCL header-only library
VIENNACL_DIR = ../ViennaCL

# Either set CLBLAS or VIENNACLBLAS to 1, not both.
# If you want to use OpenCL/Greentea on the CPU only, you can also disable both.
# When both are disabled, GPUs won't work. CPUs always use CBLAS (Atlas, MKL or OpenBLAS).
# The chosen BLAS library needs to be compiled and installed from source.
# CLBLAS should be faster, especially on AMD cards.
USE_CLBLAS := 1
USE_VIENNACLBLAS := 0

# Enable or disable double precision support for OpenCL/Greentea
GREENTEA_DOUBLE_SUPPORT := 1

# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1

Expand Down Expand Up @@ -30,7 +52,7 @@ CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
Expand Down
2 changes: 1 addition & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ list(APPEND Caffe_LINKER_LIBS ${Snappy_LIBRARIES})
# ---[ CUDA
include(cmake/Cuda.cmake)
if(NOT HAVE_CUDA)
if(CPU_ONLY)
if(CPU_ONLY OR NOT USE_CUDA)
message("-- CUDA is disabled. Building without it...")
else()
message("-- CUDA is not detected by cmake. Building without it...")
Expand Down
Loading