Skip to content

Commit 904cc86

Browse files
committed
Add 'unified-runtime/' from commit '1b71c333d1e211730412a92642bc042408fae500'
git-subtree-dir: unified-runtime git-subtree-mainline: 2a9ca31 git-subtree-split: 1b71c33
2 parents 2a9ca31 + 1b71c33 commit 904cc86

File tree

907 files changed

+273187
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

907 files changed

+273187
-0
lines changed

unified-runtime/.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
...

unified-runtime/.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[*]
2+
indent_style = space
3+
indent_size = 2
4+
5+
[*.py]
6+
indent_size = 4
7+
8+
[scripts/core/*]
9+
indent_size = 4
10+
11+
[CMakeLists.txt]
12+
indent_size = 4
13+
14+
[*.cmake]
15+
indent_size = 4

unified-runtime/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

unified-runtime/.github/CODEOWNERS

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
* @oneapi-src/unified-runtime-maintain
2+
3+
# Level Zero adapter
4+
source/adapters/level_zero @oneapi-src/unified-runtime-level-zero-write
5+
test/adapters/level_zero @oneapi-src/unified-runtime-level-zero-write
6+
7+
# CUDA and HIP adapters
8+
source/adapters/cuda @oneapi-src/unified-runtime-cuda-write
9+
test/adapters/cuda @oneapi-src/unified-runtime-cuda-write
10+
source/adapters/hip @oneapi-src/unified-runtime-hip-write
11+
test/adapters/hip @oneapi-src/unified-runtime-hip-write
12+
13+
# OpenCL adapter
14+
source/adapters/opencl @oneapi-src/unified-runtime-opencl-write
15+
test/adapters/opencl @oneapi-src/unified-runtime-opencl-write
16+
17+
# Native CPU adapter
18+
source/adapters/native_cpu @oneapi-src/unified-runtime-native-cpu-write
19+
test/adapters/native_cpu @oneapi-src/unified-runtime-native-cpu-write
20+
21+
# Command-buffer experimental feature
22+
source/adapters/**/command_buffer.* @oneapi-src/unified-runtime-command-buffer-write
23+
scripts/core/EXP-COMMAND-BUFFER.rst @oneapi-src/unified-runtime-command-buffer-write
24+
scripts/core/exp-command-buffer.yml @oneapi-src/unified-runtime-command-buffer-write
25+
test/conformance/exp_command_buffer** @oneapi-src/unified-runtime-command-buffer-write
26+
27+
# Bindless Images experimental feature
28+
source/adapters/**/image.* @oneapi-src/unified-runtime-bindless-images-write
29+
scripts/core/EXP-BINDLESS-IMAGES.rst @oneapi-src/unified-runtime-bindless-images-write
30+
scripts/core/exp-bindless-images.yml @oneapi-src/unified-runtime-bindless-images-write
31+
test/conformance/exp_bindless_images** @oneapi-src/unified-runtime-bindless-images-write
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Run dependencies versions update
2+
version: 2
3+
updates:
4+
- package-ecosystem: "pip"
5+
directory: "/third_party" # Location of package manifests
6+
schedule:
7+
interval: "daily"
8+
# Run only required security updates
9+
open-pull-requests-limit: 0
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Content
2+
3+
Dockerfiles and scripts placed in this directory are intended to be used as
4+
development process vehicles and part of continuous integration process.
5+
6+
Images built out of those recipes may be used with Docker or podman as
7+
development environment.
8+
9+
# How to build docker image
10+
11+
To build docker image on local machine, enter the root dir of the repository and execute:
12+
13+
```sh
14+
docker build -t ur:ubuntu-22.04 -f .github/docker/ubuntu-22.04.Dockerfile .
15+
```
16+
17+
To set any build time variable (e.g., an optional ARG from docker recipe), add to the command (after `build`), e.g.:
18+
19+
```sh
20+
--build-arg SKIP_DPCPP_BUILD=1
21+
```
22+
23+
One other example of using these extra build arguments are proxy settings. They are required for accessing network
24+
(e.g., to download dependencies within docker), if a host is using a proxy server. Example usage:
25+
26+
```sh
27+
--build-arg https_proxy=http://proxy.com:port --build-arg http_proxy=http://proxy.com:port
28+
```
29+
30+
# How to use docker image
31+
32+
To run docker container (using the previously built image) execute:
33+
34+
```sh
35+
docker run --shm-size=4G -v /your/workspace/path/:/opt/workspace:z -w /opt/workspace/ -it ur:ubuntu-22.04 /bin/bash
36+
```
37+
38+
To set (or override) any docker environment variable, add to the command (after `run`):
39+
40+
```sh
41+
-e ENV_VARIABLE=VALUE
42+
```
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Copyright (C) 2023-2024 Intel Corporation
2+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See LICENSE.TXT
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
#
7+
# Dockerfile - a 'recipe' for Docker to build an image of fedora-based
8+
# environment for building the Unified Runtime project.
9+
#
10+
11+
# Pull base image ("40")
12+
FROM registry.hub.docker.com/library/fedora@sha256:5ce8497aeea599bf6b54ab3979133923d82aaa4f6ca5ced1812611b197c79eb0
13+
14+
# Set environment variables
15+
ENV OS fedora
16+
ENV OS_VER 40
17+
ENV NOTTY 1
18+
19+
# Additional parameters to build docker without building components.
20+
# These ARGs can be set in docker building phase and are used
21+
# within bash scripts (executed within docker).
22+
ARG SKIP_DPCPP_BUILD
23+
ARG SKIP_LIBBACKTRACE_BUILD
24+
25+
# Base development packages
26+
ARG BASE_DEPS="\
27+
cmake \
28+
git \
29+
make"
30+
31+
# Unified Runtime's dependencies
32+
ARG UR_DEPS="\
33+
doxygen \
34+
python3 \
35+
python3-pip"
36+
37+
# Miscellaneous for our builds/CI (optional)
38+
ARG MISC_DEPS="\
39+
clang \
40+
ncurses-libs-6.4 \
41+
passwd \
42+
sudo \
43+
wget"
44+
45+
# Update and install required packages
46+
RUN dnf update -y \
47+
&& dnf install -y \
48+
${BASE_DEPS} \
49+
${UR_DEPS} \
50+
${MISC_DEPS} \
51+
&& dnf clean all
52+
53+
# Prepare a dir (accessible by anyone)
54+
RUN mkdir --mode 777 /opt/ur/
55+
56+
# Additional dev. dependencies (installed via pip)
57+
#
58+
# It's actively used and tested only on selected distros. Be aware
59+
# they may not work, because pip packages list differ from OS to OS.
60+
COPY third_party/requirements.txt /opt/ur/requirements.txt
61+
62+
# Install DPC++
63+
COPY .github/docker/install_dpcpp.sh /opt/ur/install_dpcpp.sh
64+
ENV DPCPP_PATH=/opt/dpcpp
65+
RUN /opt/ur/install_dpcpp.sh
66+
67+
# Install libbacktrace
68+
COPY .github/docker/install_libbacktrace.sh /opt/ur/install_libbacktrace.sh
69+
RUN /opt/ur/install_libbacktrace.sh
70+
71+
# Add a new (non-root) 'test_user'
72+
ENV USER test_user
73+
ENV USERPASS pass
74+
# Change shell to bash with safe pipe usage
75+
SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]
76+
RUN useradd -m ${USER} \
77+
&& echo "${USER}:${USERPASS}" | chpasswd \
78+
&& gpasswd wheel -a ${USER}
79+
80+
# Change shell back to default and switch to 'test_user'
81+
SHELL ["/bin/sh", "-c"]
82+
USER test_user
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# Copyright (C) 2023-2024 Intel Corporation
3+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See LICENSE.TXT
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
#
8+
# install_dpcpp.sh - unpacks DPC++ in ${DPCPP_PATH}, to be used while building UR
9+
#
10+
11+
set -e
12+
13+
if [ "${SKIP_DPCPP_BUILD}" ]; then
14+
echo "Variable 'SKIP_DPCPP_BUILD' is set; skipping building DPC++"
15+
exit
16+
fi
17+
18+
mkdir -p ${DPCPP_PATH}/dpcpp_compiler
19+
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
20+
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/dpcpp_compiler
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
# Copyright (C) 2023 Intel Corporation
3+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See LICENSE.TXT
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
#
8+
# install_libbacktrace.sh - builds and installs tracing library
9+
#
10+
11+
set -e
12+
13+
if [ "${SKIP_LIBBACKTRACE_BUILD}" ]; then
14+
echo "Variable 'SKIP_LIBBACKTRACE_BUILD' is set; skipping building libbacktrace"
15+
exit
16+
fi
17+
18+
git clone https://github.com/ianlancetaylor/libbacktrace.git
19+
pushd libbacktrace
20+
./configure
21+
make -j$(nproc)
22+
make install -j$(nproc)
23+
popd
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright (C) 2023-2024 Intel Corporation
2+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See LICENSE.TXT
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
#
7+
# Dockerfile - a 'recipe' for Docker to build an image of opensuse-leap-based
8+
# environment for building the Unified Runtime project.
9+
#
10+
11+
# Pull base image ("15")
12+
FROM registry.hub.docker.com/opensuse/leap@sha256:1cf79e78bb69f39fb2f78a7c2c7ebc4b64cf8d82eb1df76cd36767a595ada7a8
13+
14+
# Set environment variables
15+
ENV OS opensuse-leap
16+
ENV OS_VER 15
17+
ENV NOTTY 1
18+
19+
# Additional parameters to build docker without building components.
20+
# These ARGs can be set in docker building phase and are used
21+
# within bash scripts (executed within docker).
22+
ARG SKIP_DPCPP_BUILD
23+
ARG SKIP_LIBBACKTRACE_BUILD
24+
25+
# Base development packages
26+
ARG BASE_DEPS="\
27+
cmake \
28+
gcc \
29+
gcc-c++ \
30+
git \
31+
glibc-devel \
32+
libstdc++-devel \
33+
make"
34+
35+
# Unified Runtime's dependencies
36+
ARG UR_DEPS="\
37+
doxygen \
38+
python3 \
39+
python3-devel \
40+
python3-pip"
41+
42+
# Miscellaneous for our builds/CI (optional)
43+
ARG MISC_DEPS="\
44+
clang \
45+
gzip \
46+
libncurses5 \
47+
sudo \
48+
tar \
49+
wget"
50+
51+
# add openSUSE Leap 15.5 Oss repo
52+
RUN zypper ar -f https://download.opensuse.org/distribution/leap/15.5/repo/oss/ oss
53+
54+
# Update and install required packages
55+
RUN zypper update -y \
56+
&& zypper install -y \
57+
${BASE_DEPS} \
58+
${UR_DEPS} \
59+
${MISC_DEPS} \
60+
&& zypper clean all
61+
62+
# Prepare a dir (accessible by anyone)
63+
RUN mkdir --mode 777 /opt/ur/
64+
65+
# Additional dev. dependencies (installed via pip)
66+
#
67+
# It's actively used and tested only on selected distros. Be aware
68+
# they may not work, because pip packages list differ from OS to OS.
69+
COPY third_party/requirements.txt /opt/ur/requirements.txt
70+
71+
# Install DPC++
72+
COPY .github/docker/install_dpcpp.sh /opt/ur/install_dpcpp.sh
73+
ENV DPCPP_PATH=/opt/dpcpp
74+
RUN /opt/ur/install_dpcpp.sh
75+
76+
# Install libbacktrace
77+
COPY .github/docker/install_libbacktrace.sh /opt/ur/install_libbacktrace.sh
78+
RUN /opt/ur/install_libbacktrace.sh
79+
80+
# Add a new (non-root) 'test_user' and switch to it
81+
ENV USER test_user
82+
ENV USERPASS pass
83+
ENV PFILE ./password
84+
RUN useradd -m ${USER} \
85+
&& echo ${USERPASS} > ${PFILE} \
86+
&& echo ${USERPASS} >> ${PFILE} \
87+
&& passwd ${USER} < ${PFILE} \
88+
&& rm -f ${PFILE} \
89+
&& sed -i 's/# %wheel/%wheel/g' /etc/sudoers \
90+
&& groupadd wheel \
91+
&& gpasswd wheel -a ${USER}
92+
USER test_user

0 commit comments

Comments
 (0)