-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget-opencl-headers.sh
51 lines (42 loc) · 2.47 KB
/
get-opencl-headers.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Created by Robert Wang.
# From: https://github.com/robertwgh/get-opencl-headers
DIR=$(pwd)/include/
echo " Start downloading from Khronous's repository:"
for VERSION in 10 11 12 20 21; do
echo " Downloading OpenCL headers for version ${VERSION}..."
CLDIR="${DIR}/CL${VERSION}"
if [ -d "$CLDIR" ]; then rm -rf $CLDIR; fi
mkdir -p $CLDIR
cd $CLDIR
wget -q https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_d3d10.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_ext.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_gl.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_gl_ext.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_platform.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/opencl.h
if [ $VERSION -eq 12 ] || [ $VERSION -eq 20 ] || [ $VERSION -eq 21 ]; then
wget -q https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_d3d11.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_dx9_media_sharing.h \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/cl_egl.h
fi
if [ -n "$1" ] && [ $1 = "--include-clhpp" ]; then
if [ $VERSION -eq 10 ] || [ $VERSION -eq 11 ] || [ $VERSION -eq 12 ]; then
wget -q https://raw.githubusercontent.com/KhronosGroup/OpenCL-CLHPP/master/input_cl.hpp \
https://raw.githubusercontent.com/KhronosGroup/OpenCL-CLHPP/master/gen_cl_hpp.py
python gen_cl_hpp.py
rm input_cl.hpp
rm gen_cl_hpp.py
fi
if [ $VERSION -eq 20 ] || [ $VERSION -eq 21 ]; then
wget -q https://raw.githubusercontent.com/KhronosGroup/OpenCL-CLHPP/master/input_cl2.hpp
mv input_cl2.hpp cl2.hpp
fi
fi
done
echo " Linking default CL folder to OpenCL 1.1..."
cd "${DIR}"
if [ -d "CL" ]; then rm CL; fi
ln -s CL11 CL
echo " Done!"; echo " ";