Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang transpiler integration #756

Open
wants to merge 18 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e3c0d25
development based clang transpiler integration
ViktorYastrebov May 9, 2024
0bf0c9d
added missing GitSubmodules.cmake
ViktorYastrebov May 9, 2024
5fc800e
fixes for code review & OpenMP/Serial bug fix of non-polymorphic call…
vyast-softserveinc May 9, 2024
240fed3
refactoring of integration, use function composition & callbacks stra…
vyast-softserveinc May 10, 2024
0892ad7
make unchanged files unchanged
vyast-softserveinc May 10, 2024
8e2f4a0
fix hipDeviceProp_t type to be the same as original HIP & revert back…
vyast-softserveinc May 14, 2024
3e0f167
fix package build without occa-transpiler
vyast-softserveinc May 14, 2024
9484255
update occa-transpiler version to v1.1
vyast-softserveinc May 14, 2024
1728fe7
update occa-transpiler to latest devel(fix cuda/hip intrinsics)
vyast-softserveinc May 15, 2024
7a98cc1
update occa-transpiler taggeed version
vyast-softserveinc May 15, 2024
6186901
move to tag v1.1 occa-transpiler
vyast-softserveinc May 16, 2024
85b3c35
added example with occa-transpiler and C++ featured okl kernel
vyast-softserveinc May 20, 2024
5767389
fixes for code review, move getTranspilerVersion from options to bin/…
vyast-softserveinc Jun 7, 2024
415ef25
update INSTALL.md & README.md documentation files
vyast-softserveinc Jun 26, 2024
73f9381
update occa-transpiler repo
IuriiKobein Aug 1, 2024
02d32bf
add option to build new transpiler with local installed clang
IuriiKobein Aug 2, 2024
7f82ac6
fix example of new oklt to support serial, openmp modes; remove debug…
IuriiKobein Sep 23, 2024
388bb47
add unsigned int to OCCA builtin types
IuriiKobein Sep 25, 2024
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "deps/occa-transpiler"]
path = deps/occa-transpiler
url = https://github.com/libocca/occa-transpiler.git
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ option(OCCA_ENABLE_DPCPP "Build with SYCL/DPCPP if available" ON)
option(OCCA_ENABLE_TESTS "Build tests" OFF)
option(OCCA_ENABLE_EXAMPLES "Build simple examples" OFF)
option(OCCA_ENABLE_FORTRAN "Enable Fortran interface" OFF)
option(OCCA_CLANG_BASED_TRANSPILER "Build with occa-transpiler dependecy" OFF)

if(OCCA_ENABLE_FORTRAN)
enable_language(Fortran)
Expand Down Expand Up @@ -67,6 +68,20 @@ else()
set(OCCA_OS "OCCA_WINDOWS_OS")
endif()

# INFO: order is important, deps should not apply compiler flags
if (OCCA_CLANG_BASED_TRANSPILER)
include(cmake/CPM_0.38.6.cmake)
include(cmake/GitSubmodules.cmake)

init_submodules(${PROJECT_SOURCE_DIR})

CPMAddPackage(
NAME occa-transpiler
SOURCE_DIR ${CMAKE_SOURCE_DIR}/deps/occa-transpiler
OPTIONS "TRANSPILER_TESTS OFF"
)
endif()

include(SetCompilerFlags)
include(CheckCXXCompilerFlag)

Expand Down Expand Up @@ -113,6 +128,14 @@ target_include_directories(libocca PRIVATE
$<BUILD_INTERFACE:${OCCA_SOURCE_DIR}/src>)

target_compile_definitions(libocca PRIVATE -DUSE_CMAKE)
if (OCCA_CLANG_BASED_TRANSPILER)
target_link_libraries(libocca
PRIVATE
occa-transpiler
)
target_compile_definitions(libocca PRIVATE -DBUILD_WITH_CLANG_BASED_TRANSPILER)
endif()

#=======================================

#---[ OpenMP ]--------------------------
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Mission critical computational science and engineering applications from the pub
- SYCL 2020 or later
- OpenCL 2.0 or later
- OpenMP 4.0 or later
- C++ support with clang based occa-transpiler

## Build, Test, Install

Expand All @@ -67,6 +68,14 @@ $ cmake --install build --prefix install

If dependencies are installed in a non-standard location, set the corresponding [environment variable](INSTALL.md#dependency-paths) to this path.

For building with C++ support/occa-transpiler:
vyast-softserveinc marked this conversation as resolved.
Show resolved Hide resolved
```shell
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DOCCA_CLANG_BASED_TRANSPILER=ON ..
$ cmake --build . --parallel <number-of-threads>
$ cmake --install . --prefix install
```

## Use

Expand Down
Loading