Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: [ "ocl-open-220" ]
pull_request:
branches: [ "main" ]
branches: [ "ocl-open-220" ]

permissions:
contents: read

env:
LLVM_VERSION: 23
LLVM_VERSION_MINOR: 0
LLVM_VERSION: 22
LLVM_VERSION_MINOR: 1

jobs:
analyze:
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Install llvm and its dependencies
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/llvm.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install \
clang-${{ env.LLVM_VERSION }} \
Expand All @@ -65,7 +65,7 @@ jobs:
with:
repository: KhronosGroup/SPIRV-LLVM-Translator
path: SPIRV-LLVM-Translator
ref: main
ref: llvm_release_220

- name: Build SPIRV-LLVM-Translator
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-push-verification-in-tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ on:
push:
branches:
- main
- ocl-open-*
- ocl-open-220
Comment thread
wenju-he marked this conversation as resolved.
pull_request:
branches:
- main
- ocl-open-*
- ocl-open-220
types:
- opened
- reopened
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/on-push-verification-out-of-tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ permissions:
contents: read

env:
LLVM_VERSION: 23
LLVM_VERSION_MINOR: 0
LLVM_VERSION: 22
LLVM_VERSION_MINOR: 1

on:
push:
branches:
- main
- ocl-open-220
pull_request:
branches:
- main
- ocl-open-220
types:
- opened
- reopened
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Install llvm and its dependencies
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/llvm.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install \
clang-${{ env.LLVM_VERSION }} \
Expand All @@ -59,7 +59,7 @@ jobs:
with:
repository: KhronosGroup/SPIRV-LLVM-Translator
path: SPIRV-LLVM-Translator
ref: main
ref: llvm_release_220

- name: Build SPIRV-LLVM-Translator
run: |
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.20.0)

if(NOT DEFINED BASE_LLVM_VERSION)
set(BASE_LLVM_VERSION 22.1)
endif(NOT DEFINED BASE_LLVM_VERSION)
set(OPENCL_CLANG_VERSION ${BASE_LLVM_VERSION}.0)

if(NOT DEFINED OPENCL_CLANG_BUILD_EXTERNAL)
# check if we build inside llvm or not
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand Down Expand Up @@ -39,7 +44,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_definitions(-DUSE_PREBUILT_LLVM)

if(NOT PREFERRED_LLVM_VERSION)
set(PREFERRED_LLVM_VERSION "22.0")
set(PREFERRED_LLVM_VERSION "22.1")
endif(NOT PREFERRED_LLVM_VERSION)
message(STATUS "[OPENCL-CLANG] Looking for LLVM version ${PREFERRED_LLVM_VERSION}")
find_package(LLVM ${PREFERRED_LLVM_VERSION} REQUIRED)
Expand Down Expand Up @@ -152,9 +157,9 @@ if(NOT USE_PREBUILT_LLVM)
)
endif()

set(CLANG_BASE_REVISION main)
set(SPIRV_BASE_REVISION main)
set(TARGET_BRANCH main)
set(CLANG_BASE_REVISION release/22.x)
set(SPIRV_BASE_REVISION llvm_release_220)
set(TARGET_BRANCH ocl-open-220)

apply_patches(${CLANG_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Before the build all dependencies must be downloaded and laid out as follows:
This can be done using the following commands:
```bash
cd <workspace>
git clone https://github.com/llvm/llvm-project.git .
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
git clone https://github.com/intel/opencl-clang.git
git clone https://github.com/llvm/llvm-project.git . -b release/22.x
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_220
git clone https://github.com/intel/opencl-clang.git -b ocl-open-220
```

Then we need to create a build directory and run the build:
Expand Down Expand Up @@ -61,7 +61,7 @@ documented in [Embedding LLVM in your project](https://llvm.org/docs/CMake.html#
Commands to checkout sources and build:
```bash
cd <workspace>
git clone https://github.com/intel/opencl-clang.git
git clone https://github.com/intel/opencl-clang.git -b ocl-open-220
mkdir build && cd build
cmake ../opencl-clang
make all -j`nproc`
Expand All @@ -71,13 +71,13 @@ make all -j`nproc`

##### Preferred LLVM version

By default, opencl-clang's cmake script is searching for LLVM which is built
based on the latest version of current branch. You can override target version of
LLVM by using the `PREFERRED_LLVM_VERSION` cmake option:
By default, opencl-clang's cmake script is searching for LLVM 22.1. You can
override target version of LLVM by using the `PREFERRED_LLVM_VERSION` cmake
option:

Example:
```bash
cmake -DPREFERRED_LLVM_VERSION="22.0" ../opencl-clang
cmake -DPREFERRED_LLVM_VERSION="22.1" ../opencl-clang
```

##### Custom LLVM installation
Expand Down
Loading