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
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ git:
branches:
only:
- master
- ocl-open-120

env:
global:
Expand All @@ -31,14 +32,17 @@ before_install:
libclang-cpp${LLVM_VERSION}-dev

install:
- wget https://github.com/KhronosGroup/SPIRV-LLVM-Translator/releases/download/dev-build/SPIRV-LLVM-Translator-dev-build-linux-Release.zip -O /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip
- unzip /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip -d spirv-llvm-translator
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git spirv-llvm-translator -b llvm_release_${LLVM_VERSION}0
- mkdir spirv-llvm-translator/build && cd spirv-llvm-translator/build
- cmake .. -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make -j`nproc` && make install
- cd ../../

compiler:
- gcc
- clang

script:
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_NO_DEAD_STRIP=ON -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=./spirv-llvm-translator -DCMAKE_INSTALL_PREFIX=./install ..
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_NO_DEAD_STRIP=ON -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=${TRAVIS_BUILD_DIR}/spirv-llvm-translator/build/install -DCMAKE_INSTALL_PREFIX=./install ..
- make install
24 changes: 16 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
if(NOT USE_PREBUILT_LLVM)

if(NOT LLVM_EXTERNAL_CLANG_SOURCE_DIR)
set(LLVM_BASE_REVISION release_12)
set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang)
set(CLANG_BASE_REVISION release_12)
elseif(EXISTS "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/CMakeLists.txt")
set(LLVM_BASE_REVISION release/12.x)
set(CLANG_SOURCE_DIR "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
set(CLANG_BASE_REVISION release/12.x)
endif()
if(EXISTS ${CLANG_SOURCE_DIR})
message(STATUS "[OPENCL-CLANG] Using Clang source code direcotry: ${CLANG_SOURCE_DIR}")
Expand Down Expand Up @@ -117,18 +121,22 @@ if(NOT USE_PREBUILT_LLVM)
)
endif()

set(CLANG_BASE_REVISION master)
set(SPIRV_BASE_REVISION master)
set(TARGET_BRANCH "ocl-open-110")

apply_patches(${CLANG_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang
${CLANG_BASE_REVISION}
${TARGET_BRANCH})
set(SPIRV_BASE_REVISION llvm_release_120)
set(TARGET_BRANCH "ocl-open-120")
get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
apply_patches(${LLVM_MONOREPO_DIR}
"${LLVM_PATCHES_DIRS}"
${LLVM_BASE_REVISION}
${TARGET_BRANCH}
ret)
apply_patches(${SPIRV_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
${SPIRV_BASE_REVISION}
${TARGET_BRANCH})
${TARGET_BRANCH}
ret)
endif(NOT USE_PREBUILT_LLVM)

#
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,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/12.x
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_120
git clone https://github.com/intel/opencl-clang.git -b ocl-open-120
```

Then we need to create a build directory and run the build:
Expand Down Expand Up @@ -58,7 +58,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-120
mkdir build && cd build
cmake ../opencl-clang
make all -j`nproc`
Expand All @@ -68,13 +68,13 @@ make all -j`nproc`

##### Preferred LLVM version

By default, openclc-clang's cmake script is searching for LLVM 12.0.0. You can
By default, opencl-clang's cmake script is searching for LLVM 12.0.0. You can
override target version of LLVM by using the `PREFERRED_LLVM_VERSION` cmake
option:

Example:
```bash
cmake -DPREFERRED_LLVM_VERSION="10.0.0" ../opencl-clang
cmake -DPREFERRED_LLVM_VERSION="12.0.0" ../opencl-clang
```

##### Custom LLVM installation
Expand Down
1 change: 0 additions & 1 deletion options_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args,
effectiveArgs.push_back("-cl-kernel-arg-info");
effectiveArgs.push_back("-fno-validate-pch");
effectiveArgs.push_back("-fno-caret-diagnostics");
effectiveArgs.push_back("-dwarf-column-info");

if (std::find_if(effectiveArgs.begin(), effectiveArgs.end(),
[](const ArgsVector::value_type& a) {
Expand Down