Import SIMD feature and add some workload samples (#438)
This commit is contained in:
1
samples/workload/docker/.gitignore
vendored
Normal file
1
samples/workload/docker/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
build_scripts
|
||||
77
samples/workload/docker/Dockerfile
Normal file
77
samples/workload/docker/Dockerfile
Normal file
@ -0,0 +1,77 @@
|
||||
FROM ubuntu:18.04 as builder
|
||||
|
||||
#
|
||||
# install clang and llvm
|
||||
COPY llvm.sh /tmp
|
||||
RUN apt update \
|
||||
&& apt install -y lsb-release wget software-properties-common build-essential \
|
||||
&& cd /tmp \
|
||||
&& chmod a+x llvm.sh \
|
||||
&& ./llvm.sh 11
|
||||
|
||||
ARG WASI_SDK_VER=11.0
|
||||
ARG WABT_VER=1.0.19
|
||||
ARG CMAKE_VER=3.16.2
|
||||
ARG BINARYEN_VER=version_97
|
||||
|
||||
#
|
||||
# install wasi-sdk
|
||||
ARG WASI_SDK_FILE="wasi-sdk-${WASI_SDK_VER}-linux.tar.gz"
|
||||
COPY ${WASI_SDK_FILE} /opt
|
||||
RUN cd /opt \
|
||||
&& tar zxf ${WASI_SDK_FILE} \
|
||||
&& rm ${WASI_SDK_FILE} \
|
||||
&& ln -sf /opt/wasi-sdk-${WASI_SDK_VER} /opt/wasi-sdk \
|
||||
&& ln -sf /opt/wasi-sdk/lib/clang/10.0.0/lib/wasi/ /usr/lib/llvm-11/lib/clang/11.0.0/lib/
|
||||
|
||||
#
|
||||
# install wabt
|
||||
ARG WABT_FILE="wabt-${WABT_VER}-ubuntu.tar.gz"
|
||||
COPY ${WABT_FILE} /opt
|
||||
RUN cd /opt \
|
||||
&& tar zxf ${WABT_FILE} \
|
||||
&& rm ${WABT_FILE} \
|
||||
&& ln -sf /opt/wabt-${WABT_VER} /opt/wabt
|
||||
|
||||
#
|
||||
# install cmake
|
||||
ARG CMAKE_FILE="cmake-${CMAKE_VER}-Linux-x86_64.sh"
|
||||
COPY ${CMAKE_FILE} /tmp
|
||||
RUN cd /tmp \
|
||||
&& chmod a+x ${CMAKE_FILE} \
|
||||
&& mkdir /opt/cmake \
|
||||
&& ./${CMAKE_FILE} --prefix=/opt/cmake --skip-license \
|
||||
&& ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake
|
||||
|
||||
#
|
||||
# install tools
|
||||
RUN apt install -y git tree
|
||||
|
||||
#
|
||||
# install emsdk
|
||||
RUN cd /opt \
|
||||
&& git clone https://github.com/emscripten-core/emsdk.git \
|
||||
&& cd emsdk \
|
||||
&& git pull \
|
||||
&& ./emsdk install latest \
|
||||
&& ./emsdk activate latest \
|
||||
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
|
||||
|
||||
#
|
||||
# install binaryen
|
||||
ARG BINARYEN_FILE="binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz"
|
||||
COPY ${BINARYEN_FILE} /opt
|
||||
RUN cd /opt \
|
||||
&& tar zxf ${BINARYEN_FILE} \
|
||||
&& rm ${BINARYEN_FILE} \
|
||||
&& ln -sf /opt/binaryen-${BINARYEN_VER} /opt/binaryen
|
||||
|
||||
#
|
||||
# Clean up
|
||||
RUN apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
VOLUME /data
|
||||
WORKDIR /data
|
||||
48
samples/workload/docker/build.sh
Executable file
48
samples/workload/docker/build.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! -d build_scripts ]]; then
|
||||
mkdir build_scripts
|
||||
fi
|
||||
|
||||
WASI_SDK_VER=11.0
|
||||
WABT_VER=1.0.19
|
||||
CMAKE_VER=3.16.2
|
||||
BINARYEN_VER=version_97
|
||||
|
||||
cd build_scripts
|
||||
if [[ ! -f wasi-sdk-${WASI_SDK_VER}-linux.tar.gz ]]; then
|
||||
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sdk-${WASI_SDK_VER}-linux.tar.gz
|
||||
fi
|
||||
|
||||
if [[ ! -f wabt-${WABT_VER}-ubuntu.tar.gz ]]; then
|
||||
wget https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz
|
||||
fi
|
||||
|
||||
if [[ ! -f llvm.sh ]]; then
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
fi
|
||||
|
||||
if [[ ! -f cmake-${CMAKE_VER}-Linux-x86_64.sh ]]; then
|
||||
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh
|
||||
fi
|
||||
|
||||
if [[ ! -f binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz ]]; then
|
||||
wget https://github.com/WebAssembly/binaryen/releases/download/${BINARYEN_VER}/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz
|
||||
fi
|
||||
cd -
|
||||
|
||||
docker build \
|
||||
--build-arg http_proxy=${http_proxy} \
|
||||
--build-arg https_proxy=${https_proxy} \
|
||||
--build-arg HTTP_PROXY=${http_proxy} \
|
||||
--build-arg HTTPS_PROXY=${https_proxy} \
|
||||
--build-arg WASI_SDK_VER=11.0 \
|
||||
--build-arg WABT_VER=${WABT_VER} \
|
||||
--build-arg CMAKE_VER=${CMAKE_VER} \
|
||||
--build-arg BINARYEN_VER=${BINARYEN_VER} \
|
||||
-t clang_env:0.1 -f Dockerfile build_scripts
|
||||
10
samples/workload/docker/run.sh
Executable file
10
samples/workload/docker/run.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker run --rm -it \
|
||||
-e http_proxy=${http_proxy} \
|
||||
-e https_proxy=${https_proxy} \
|
||||
-e HTTP_PROXY=${http_proxy} \
|
||||
-e HTTPS_PROXY=${htpps_proxy} \
|
||||
--name workload_w_clang \
|
||||
--mount type=bind,source=$(pwd)/..,target=/data \
|
||||
clang_env:0.1
|
||||
Reference in New Issue
Block a user