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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ buildbot/ @intel/dpcpp-devops-reviewers
devops/ @intel/dpcpp-devops-reviewers

# Kernel fusion JIT compiler
sycl-fusion/ @intel/dpcpp-kernel-fusion-reviewers
sycl-jit/ @intel/dpcpp-kernel-fusion-reviewers
sycl/doc/design/KernelFusionJIT.md @intel/dpcpp-kernel-fusion-reviewers
sycl/doc/extensions/experimental/sycl_ext_codeplay_kernel_fusion.asciidoc @intel/dpcpp-kernel-fusion-reviewers
sycl/include/sycl/ext/codeplay/experimental/fusion_properties.hpp @intel/dpcpp-kernel-fusion-reviewers
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sycl-detect-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
clang: &clang
- *llvm
- 'clang/**'
sycl_fusion: &sycl-fusion
sycl_jit: &sycl-jit
- *llvm
- 'sycl-fusion/**'
- 'sycl-jit/**'
xptifw: &xptifw
- 'xptifw/**'
libclc: &libclc
Expand All @@ -41,7 +41,7 @@ jobs:
- 'libclc/**'
sycl: &sycl
- *clang
- *sycl-fusion
- *sycl-jit
- *llvm_spirv
- *xptifw
- *libclc
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
return '${{ steps.changes.outputs.changes }}';
}
// Treat everything as changed for huge PRs.
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci", "esimd"];
return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd"];

- run: echo '${{ steps.result.outputs.result }}'

18 changes: 9 additions & 9 deletions buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def do_configure(args):
libclc_amd_target_names = ";amdgcn--amdhsa"
libclc_nvidia_target_names = ";nvptx64--nvidiacl"

sycl_enable_fusion = "OFF"
if not args.disable_fusion:
llvm_external_projects += ";sycl-fusion"
sycl_enable_fusion = "ON"
sycl_enable_jit = "OFF"
if not args.disable_jit:
llvm_external_projects += ";sycl-jit"
sycl_enable_jit = "ON"

if args.llvm_external_projects:
llvm_external_projects += ";" + args.llvm_external_projects.replace(",", ";")
Expand All @@ -45,7 +45,7 @@ def do_configure(args):
xpti_dir = os.path.join(abs_src_dir, "xpti")
xptifw_dir = os.path.join(abs_src_dir, "xptifw")
libdevice_dir = os.path.join(abs_src_dir, "libdevice")
fusion_dir = os.path.join(abs_src_dir, "sycl-fusion")
jit_dir = os.path.join(abs_src_dir, "sycl-jit")
llvm_targets_to_build = args.host_target
llvm_enable_projects = "clang;" + llvm_external_projects
libclc_build_native = "OFF"
Expand Down Expand Up @@ -174,7 +174,7 @@ def do_configure(args):
"-DXPTI_SOURCE_DIR={}".format(xpti_dir),
"-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR={}".format(xptifw_dir),
"-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR={}".format(libdevice_dir),
"-DLLVM_EXTERNAL_SYCL_FUSION_SOURCE_DIR={}".format(fusion_dir),
"-DLLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR={}".format(jit_dir),
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
"-DSYCL_BUILD_PI_HIP_PLATFORM={}".format(sycl_build_pi_hip_platform),
"-DLLVM_BUILD_TOOLS=ON",
Expand All @@ -189,7 +189,7 @@ def do_configure(args):
"-DXPTI_ENABLE_WERROR={}".format(xpti_enable_werror),
"-DSYCL_CLANG_EXTRA_FLAGS={}".format(sycl_clang_extra_flags),
"-DSYCL_ENABLE_PLUGINS={}".format(";".join(set(sycl_enabled_plugins))),
"-DSYCL_ENABLE_KERNEL_FUSION={}".format(sycl_enable_fusion),
"-DSYCL_ENABLE_EXTENSION_JIT={}".format(sycl_enable_jit),
"-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB={}".format(sycl_preview_lib),
"-DBUG_REPORT_URL=https://github.com/intel/llvm/issues",
]
Expand Down Expand Up @@ -379,9 +379,9 @@ def main():
help="Disable building of the SYCL runtime major release preview library",
)
parser.add_argument(
"--disable-fusion",
"--disable-jit",
action="store_true",
help="Disable the kernel fusion JIT compiler",
help="Disable the kernel JIT compiler for AMD and Nvidia",
)
parser.add_argument(
"--add_security_flags",
Expand Down
12 changes: 6 additions & 6 deletions sycl-fusion/CMakeLists.txt → sycl-jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ set(SYCL_JIT_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LLVM_SPIRV_INCLUDE_DIRS "${LLVM_MAIN_SRC_DIR}/../llvm-spirv/include")

# Set library-wide warning options.
set(SYCL_FUSION_WARNING_FLAGS -Wall -Wextra)
set(SYCL_JIT_WARNING_FLAGS -Wall -Wextra)

option(SYCL_FUSION_ENABLE_WERROR "Treat all warnings as errors in SYCL kernel fusion library" ON)
if(SYCL_FUSION_ENABLE_WERROR)
list(APPEND SYCL_FUSION_WARNING_FLAGS -Werror)
endif(SYCL_FUSION_ENABLE_WERROR)
option(SYCL_JIT_ENABLE_WERROR "Treat all warnings as errors in SYCL kernel JIT library" ON)
if(SYCL_JIT_ENABLE_WERROR)
list(APPEND SYCL_JIT_WARNING_FLAGS -Werror)
endif(SYCL_JIT_ENABLE_WERROR)

if(WIN32)
message(WARNING "Kernel fusion not yet supported on Windows")
message(WARNING "Kernel JIT not yet supported on Windows")
else(WIN32)
add_subdirectory(common)
add_subdirectory(jit-compiler)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
add_llvm_library(sycl-fusion-common
add_llvm_library(sycl-jit-common
lib/NDRangesHelper.cpp

LINK_COMPONENTS
Support
)

target_compile_options(sycl-fusion-common PRIVATE ${SYCL_FUSION_WARNING_FLAGS})
target_compile_options(sycl-jit-common PRIVATE ${SYCL_JIT_WARNING_FLAGS})

# Mark LLVM headers as system headers to ignore warnigns in them. This
# classification remains intact even if the same path is added as a normal
# include path in GCC and Clang.
target_include_directories(sycl-fusion-common
target_include_directories(sycl-jit-common
SYSTEM PRIVATE
${LLVM_MAIN_INCLUDE_DIR}
)
target_include_directories(sycl-fusion-common
target_include_directories(sycl-jit-common
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/lib
)

add_dependencies(sycl-fusion-common sycl-headers)
add_dependencies(sycl-jit-common sycl-headers)

if (BUILD_SHARED_LIBS)
if(NOT MSVC AND NOT APPLE)
# Manage symbol visibility through the linker to make sure no LLVM symbols
# are exported and confuse the drivers.
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/ld-version-script.txt")
target_link_libraries(
sycl-fusion-common PRIVATE "-Wl,--version-script=${linker_script}")
set_target_properties(sycl-fusion-common
sycl-jit-common PRIVATE "-Wl,--version-script=${linker_script}")
set_target_properties(sycl-jit-common
PROPERTIES
LINK_DEPENDS
${linker_script})
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

add_llvm_library(sycl-fusion
add_llvm_library(sycl-jit
lib/KernelFusion.cpp
lib/translation/KernelTranslation.cpp
lib/translation/SPIRVLLVMTranslation.cpp
Expand Down Expand Up @@ -31,17 +31,17 @@ add_llvm_library(sycl-fusion
${LLVM_TARGETS_TO_BUILD}
)

target_compile_options(sycl-fusion PRIVATE ${SYCL_FUSION_WARNING_FLAGS})
target_compile_options(sycl-jit PRIVATE ${SYCL_JIT_WARNING_FLAGS})

# Mark LLVM and SPIR-V headers as system headers to ignore warnigns in them.
# This classification remains intact even if the same paths are added as normal
# include paths in GCC and Clang.
target_include_directories(sycl-fusion
target_include_directories(sycl-jit
SYSTEM PRIVATE
${LLVM_MAIN_INCLUDE_DIR}
${LLVM_SPIRV_INCLUDE_DIRS}
)
target_include_directories(sycl-fusion
target_include_directories(sycl-jit
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand All @@ -52,29 +52,29 @@ target_include_directories(sycl-fusion

find_package(Threads REQUIRED)

target_link_libraries(sycl-fusion
target_link_libraries(sycl-jit
PRIVATE
sycl-fusion-common
sycl-jit-common
LLVMSPIRVLib
SYCLKernelFusionPasses
SYCLKernelJITPasses
${CMAKE_THREAD_LIBS_INIT}
)

add_dependencies(sycl-fusion sycl-headers)
add_dependencies(sycl-jit sycl-headers)

if("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
target_compile_definitions(sycl-fusion PRIVATE FUSION_JIT_SUPPORT_PTX)
target_compile_definitions(sycl-jit PRIVATE JIT_SUPPORT_PTX)
endif()

if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
target_compile_definitions(sycl-fusion PRIVATE FUSION_JIT_SUPPORT_AMDGCN)
target_compile_definitions(sycl-jit PRIVATE JIT_SUPPORT_AMDGCN)
endif()

if(NOT MSVC AND NOT APPLE)
# Manage symbol visibility through the linker to make sure no LLVM symbols
# are exported and confuse the drivers.
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/ld-version-script.txt")
target_link_libraries(
sycl-fusion PRIVATE "-Wl,--version-script=${linker_script}")
set_target_properties(sycl-fusion PROPERTIES LINK_DEPENDS ${linker_script})
sycl-jit PRIVATE "-Wl,--version-script=${linker_script}")
set_target_properties(sycl-jit PROPERTIES LINK_DEPENDS ${linker_script})
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ static bool isTargetFormatSupported(BinaryFormat TargetFormat) {
case BinaryFormat::SPIRV:
return true;
case BinaryFormat::PTX: {
#ifdef FUSION_JIT_SUPPORT_PTX
#ifdef JIT_SUPPORT_PTX
return true;
#else // FUSION_JIT_SUPPORT_PTX
#else // JIT_SUPPORT_PTX
return false;
#endif // FUSION_JIT_SUPPORT_PTX
#endif // JIT_SUPPORT_PTX
}
case BinaryFormat::AMDGCN: {
#ifdef FUSION_JIT_SUPPORT_AMDGCN
#ifdef JIT_SUPPORT_AMDGCN
return true;
#else // FUSION_JIT_SUPPORT_AMDGCN
#else // JIT_SUPPORT_AMDGCN
return false;
#endif // FUSION_JIT_SUPPORT_AMDGCN
#endif // JIT_SUPPORT_AMDGCN
}
default:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ llvm::Expected<KernelBinary *> KernelTranslator::translateToPTX(
SYCLKernelInfo &KernelInfo, llvm::Module &Mod, JITContext &JITCtx,
[[maybe_unused]] const std::string &TargetCPU,
[[maybe_unused]] const std::string &TargetFeatures) {
#ifndef FUSION_JIT_SUPPORT_PTX
#ifndef JIT_SUPPORT_PTX
(void)KernelInfo;
(void)Mod;
(void)JITCtx;
return createStringError(inconvertibleErrorCode(),
"PTX translation not supported in this build");
#else // FUSION_JIT_SUPPORT_PTX
#else // JIT_SUPPORT_PTX
LLVMInitializeNVPTXTargetInfo();
LLVMInitializeNVPTXTarget();
LLVMInitializeNVPTXAsmPrinter();
Expand Down Expand Up @@ -306,20 +306,20 @@ llvm::Expected<KernelBinary *> KernelTranslator::translateToPTX(
}

return &JITCtx.emplaceKernelBinary(std::move(PTXASM), BinaryFormat::PTX);
#endif // FUSION_JIT_SUPPORT_PTX
#endif // JIT_SUPPORT_PTX
}

llvm::Expected<KernelBinary *> KernelTranslator::translateToAMDGCN(
SYCLKernelInfo &KernelInfo, llvm::Module &Mod, JITContext &JITCtx,
[[maybe_unused]] const std::string &TargetCPU,
[[maybe_unused]] const std::string &TargetFeatures) {
#ifndef FUSION_JIT_SUPPORT_AMDGCN
#ifndef JIT_SUPPORT_AMDGCN
(void)KernelInfo;
(void)Mod;
(void)JITCtx;
return createStringError(inconvertibleErrorCode(),
"AMDGPU translation not supported in this build");
#else // FUSION_JIT_SUPPORT_AMDGCN
#else // JIT_SUPPORT_AMDGCN

LLVMInitializeAMDGPUTargetInfo();
LLVMInitializeAMDGPUTarget();
Expand Down Expand Up @@ -383,5 +383,5 @@ llvm::Expected<KernelBinary *> KernelTranslator::translateToAMDGCN(
}

return &JITCtx.emplaceKernelBinary(std::move(AMDObj), BinaryFormat::AMDGCN);
#endif // FUSION_JIT_SUPPORT_AMDGCN
#endif // JIT_SUPPORT_AMDGCN
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Module library for usage as library/pass-plugin with LLVM opt.
add_llvm_library(SYCLKernelFusion MODULE
add_llvm_library(SYCLKernelJIT MODULE
SYCLFusionPasses.cpp
kernel-fusion/Builtins.cpp
kernel-fusion/SYCLKernelFusion.cpp
Expand All @@ -15,39 +15,39 @@ add_llvm_library(SYCLKernelFusion MODULE
intrinsics_gen
)

target_compile_options(SYCLKernelFusion PRIVATE ${SYCL_FUSION_WARNING_FLAGS})
target_compile_options(SYCLKernelJIT PRIVATE ${SYCL_JIT_WARNING_FLAGS})

# Mark LLVM headers as system headers to ignore warnigns in them. This
# classification remains intact even if the same path is added as a normal
# include path in GCC and Clang.
target_include_directories(SYCLKernelFusion
target_include_directories(SYCLKernelJIT
SYSTEM PRIVATE
${LLVM_MAIN_INCLUDE_DIR}
)
target_include_directories(SYCLKernelFusion
target_include_directories(SYCLKernelJIT
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
${SYCL_JIT_BASE_DIR}/common/include
)

target_link_libraries(SYCLKernelFusion
target_link_libraries(SYCLKernelJIT
PRIVATE
sycl-fusion-common
sycl-jit-common
)

add_dependencies(SYCLKernelFusion sycl-headers)
add_dependencies(SYCLKernelJIT sycl-headers)

if("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
target_compile_definitions(SYCLKernelFusion PRIVATE FUSION_JIT_SUPPORT_PTX)
target_compile_definitions(SYCLKernelJIT PRIVATE JIT_SUPPORT_PTX)
endif()

if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
target_compile_definitions(SYCLKernelFusion PRIVATE FUSION_JIT_SUPPORT_AMDGCN)
target_compile_definitions(SYCLKernelJIT PRIVATE JIT_SUPPORT_AMDGCN)
endif()

# Static library for linking with the jit_compiler
add_llvm_library(SYCLKernelFusionPasses
add_llvm_library(SYCLKernelJITPasses
SYCLFusionPasses.cpp
kernel-fusion/Builtins.cpp
kernel-fusion/SYCLKernelFusion.cpp
Expand All @@ -71,33 +71,33 @@ add_llvm_library(SYCLKernelFusionPasses
SYCLLowerIR
)

target_compile_options(SYCLKernelFusionPasses PRIVATE ${SYCL_FUSION_WARNING_FLAGS})
target_compile_options(SYCLKernelJITPasses PRIVATE ${SYCL_JIT_WARNING_FLAGS})

# Mark LLVM headers as system headers to ignore warnigns in them. This
# classification remains intact even if the same path is added as a normal
# include path in GCC and Clang.
target_include_directories(SYCLKernelFusionPasses
target_include_directories(SYCLKernelJITPasses
SYSTEM PRIVATE
${LLVM_MAIN_INCLUDE_DIR}
)
target_include_directories(SYCLKernelFusionPasses
target_include_directories(SYCLKernelJITPasses
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PRIVATE
${SYCL_JIT_BASE_DIR}/common/include
)

target_link_libraries(SYCLKernelFusionPasses
target_link_libraries(SYCLKernelJITPasses
PRIVATE
sycl-fusion-common
sycl-jit-common
)

add_dependencies(SYCLKernelFusionPasses sycl-headers)
add_dependencies(SYCLKernelJITPasses sycl-headers)

if("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
target_compile_definitions(SYCLKernelFusionPasses PRIVATE FUSION_JIT_SUPPORT_PTX)
target_compile_definitions(SYCLKernelJITPasses PRIVATE JIT_SUPPORT_PTX)
endif()

if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
target_compile_definitions(SYCLKernelFusionPasses PRIVATE FUSION_JIT_SUPPORT_AMDGCN)
target_compile_definitions(SYCLKernelJITPasses PRIVATE JIT_SUPPORT_AMDGCN)
endif()
Loading