forked from codeplaysoftware/portBLAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (53 loc) · 2.31 KB
/
Dockerfile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM ubuntu:xenial
# Default values for the build
ARG git_branch
ARG git_slug
ARG c_compiler
ARG cxx_compiler
ARG impl
ARG target
RUN apt-get -yq update
# Utilities
RUN apt-get install -yq --allow-downgrades --allow-remove-essential \
--allow-change-held-packages git wget python-pip apt-utils cmake unzip \
libboost-all-dev software-properties-common python-software-properties libcompute-dev
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get -yq update
RUN pip install enum34
# Clang 6.0
RUN if [ "${c_compiler}" = 'clang-6.0' ]; then apt-get install -yq \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
clang-6.0 libomp-dev; fi
# GCC 7
RUN if [ "${c_compiler}" = 'gcc-7' ]; then apt-get install -yq \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
g++-7 gcc-7; fi
# OpenCL ICD Loader
RUN apt-get install -yq --allow-downgrades --allow-remove-essential \
--allow-change-held-packages ocl-icd-opencl-dev ocl-icd-dev opencl-headers
RUN git clone https://github.com/${git_slug}.git --recursive -b ${git_branch} /sycl-blas
#OpenBLAS
RUN bash /sycl-blas/.scripts/build_OpenBLAS.sh
# Intel OpenCL Runtime
RUN if [ "${target}" = 'opencl' ]; then bash /sycl-blas/.scripts/install_intel_opencl.sh; fi
# SYCL
RUN if [ "${impl}" = 'triSYCL' ]; then cd /sycl-blas && bash /sycl-blas/.scripts/build_triSYCL.sh; fi
RUN if [ "${impl}" = 'COMPUTECPP' ]; then cd /sycl-blas && bash /sycl-blas/.scripts/build_computecpp.sh; fi
ENV CC=${c_compiler}
ENV CXX=${cxx_compiler}
ENV SYCL_IMPL=${impl}
ENV TARGET=${target}
CMD cd /sycl-blas && \
export CMAKE_ARGS='-DBLAS_ENABLE_STATIC_LIBRARY=ON -DGEMM_TALL_SKINNY_SUPPORT=OFF' && \
if [ "${SYCL_IMPL}" = 'triSYCL' ]; then \
./build.sh --trisycl -DTRISYCL_INCLUDE_DIR=/tmp/triSYCL-master/include; \
elif [ "${SYCL_IMPL}" = 'COMPUTECPP' ]; then \
if [ "${TARGET}" = 'host' ]; then \
COMPUTECPP_TARGET="host" ./build.sh /tmp/ComputeCpp-latest /tmp/OpenBLAS/build; \
else \
/tmp/ComputeCpp-latest/bin/computecpp_info && \
COMPUTECPP_TARGET="intel:cpu" ./build.sh /tmp/ComputeCpp-latest /tmp/OpenBLAS/build; \
fi \
else \
echo "Unknown SYCL implementation ${SYCL_IMPL}"; return 1; \
fi