Skip to content

Commit bdb9a66

Browse files
committed
Added devcontainer
1 parent d12717f commit bdb9a66

File tree

6 files changed

+38
-23
lines changed

6 files changed

+38
-23
lines changed

mlir/cuda-tile/.devcontainer/Dockerfile

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
FROM alwaysproblem/fastdev-u2204:zsh
1+
FROM alwaysproblem/fastdev-u2204:nv13.1.0
22

33
ARG UID=1000
44
ARG GID=1000
55

66
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" > /etc/apt/sources.list.d/llvm.list \
77
&& echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" >> /etc/apt/sources.list.d/llvm.list \
8-
&& echo "# 18" >> /etc/apt/sources.list.d/llvm.list \
9-
&& echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list.d/llvm.list \
10-
&& echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list.d/llvm.list \
11-
&& echo "# 19" >> /etc/apt/sources.list.d/llvm.list \
12-
&& echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" >> /etc/apt/sources.list.d/llvm.list \
13-
&& echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" >> /etc/apt/sources.list.d/llvm.list \
8+
&& echo "# 20" >> /etc/apt/sources.list.d/llvm.list \
9+
&& echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" >> /etc/apt/sources.list.d/llvm.list \
10+
&& echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" >> /etc/apt/sources.list.d/llvm.list \
11+
&& echo "# 21" >> /etc/apt/sources.list.d/llvm.list \
12+
&& echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" >> /etc/apt/sources.list.d/llvm.list \
13+
&& echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" >> /etc/apt/sources.list.d/llvm.list \
1414
&& wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \
1515
&& apt update -y && \
1616
apt install -y \
1717
python3 python3-dev python3-setuptools python3-pip \
1818
libtinfo-dev zlib1g-dev \
1919
build-essential cmake ninja-build \
20-
clang-19 clang-tidy-19 clangd-19 cmake-format \
21-
clang-format-19 lldb-19 lld-19 libfmt-dev libspdlog-dev \
22-
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100 \
23-
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100 \
24-
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-19 100 \
25-
&& update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 100 \
26-
&& update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100 \
27-
&& update-alternatives --install /usr/bin/lld lld /usr/bin/lld-19 100 \
28-
&& update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-19 100
20+
clang-20 clang-tidy-20 clangd-20 cmake-format \
21+
clang-format-20 lldb-20 lld-20 libfmt-dev libspdlog-dev \
22+
&& apt clean -y && rm -rf /var/lib/apt/lists/* \
23+
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100 \
24+
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100 \
25+
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-20 100 \
26+
&& update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-20 100 \
27+
&& update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-20 100 \
28+
&& update-alternatives --install /usr/bin/lld lld /usr/bin/lld-20 100 \
29+
&& update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-20 100
30+
31+
RUN apt update -y && apt install -yq software-properties-common \
32+
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
33+
&& apt update -yq \
34+
&& apt install -yq gcc-13 g++-13 gdb \
35+
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 \
36+
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100 \
37+
&& apt clean -y && rm -rf /var/lib/apt/lists/*
2938

3039
RUN git config --global --add safe.directory '*' && \
3140
/root/.local/bin/setup_new_user ${UID} ${GID} && \

mlir/cuda-tile/.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"context": "${localWorkspaceFolder}/.devcontainer",
1010
"dockerfile": "Dockerfile",
1111
"options": [
12-
"--net=host"
12+
"--network=host"
1313
],
1414
"args": {
1515
"UID": "1000",
@@ -41,7 +41,7 @@
4141
// "seccomp=unconfined",
4242
"--name",
4343
// "${localEnv:USER}-tvm",
44-
"yyx-mlir-example",
44+
"yyx-cuda-tile",
4545
// "-v",
4646
// "/data/rech/yongxiy/Desktop/dockerVolumn:/root/Desktop/dockerVolumn"
4747
],

mlir/cuda-tile/Toy/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ add_dependencies(toy-cuda
3737

3838
include_directories(${CMAKE_CURRENT_BINARY_DIR})
3939
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
40+
target_link_directories(toy-cuda PRIVATE ${CUDA_TILE_BINARY_DIR}/lib)
41+
4042
target_link_libraries(toy-cuda
4143
PRIVATE
4244
MLIRAnalysis

mlir/cuda-tile/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ cmake .. -Wno-dev -G Ninja \
1818
-DMLIR_DIR=${_workspaceFolder}/third_party/llvm/lib/cmake/mlir \
1919
-DLLVM_DIR=${_workspaceFolder}/third_party/llvm/lib/cmake/llvm \
2020
-DCMAKE_MODULE_PATH="${_workspaceFolder}/third_party/llvm/lib/cmake/mlir;${_workspaceFolder}/third_party/llvm/lib/cmake/llvm" \
21-
-DMLIR_TABLEGEN_EXE=${_workspaceFolder}/third_party/llvm/bin/mlir-tblgen
21+
-DMLIR_TABLEGEN_EXE=${_workspaceFolder}/third_party/llvm/bin/mlir-tblgen \
22+
-DCUDA_TILE_BINARY_DIR=${_workspaceFolder}/third_party/cuda-tile/build/ \
23+
-DCUDA_TILE_SOURCE_DIR=${_workspaceFolder}/third_party/cuda-tile
2224

2325
# ninja
2426
cmake \

mlir/cuda-tile/scripts/build_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ cmake -GNinja \
6464
-DLLVM_BUILD_UTILS=ON \
6565
-DLLVM_INCLUDE_TOOLS=ON \
6666
-DLLVM_BUILD_TOOLS=ON \
67-
-DMLIR_ENABLE_CUDA_RUNNER=ON \
6867
-DLLVM_BUILD_LLVM_DYLIB=ON \
6968
-DCMAKE_CXX_COMPILER=clang++ \
69+
-DMLIR_ENABLE_CUDA_RUNNER=ON \
7070
-DCMAKE_C_COMPILER=clang \
7171
-DLLVM_LINK_LLVM_DYLIB=ON
7272

mlir/cuda-tile/scripts/sync_deps.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
mkdir -p third_party
44

5-
git clone -b release/19.x --depth 1 https://github.com/llvm/llvm-project.git third_party/llvm-project
5+
git clone --filter=blob:none --no-checkout https://github.com/llvm/llvm-project.git third_party/llvm-project
66
cd third_party/llvm-project
77

8-
git switch -c cfbb4cc31215d615f605466aef0bcfb42aa9faa5
8+
git fetch --depth=1 origin cfbb4cc31215d615f605466aef0bcfb42aa9faa5
9+
git checkout --detach cfbb4cc31215d615f605466aef0bcfb42aa9faa5
910

10-
git clone https://github.com/Alwaysproblem/cuda-tile third_party/cuda-tile
11+
cd -
1112

13+
git clone https://github.com/Alwaysproblem/cuda-tile third_party/cuda-tile

0 commit comments

Comments
 (0)