-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][ESIMD][EMU] URL for pre-built CM_EMU library package #6027
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
Changes from 4 commits
e205b99
deb9552
157c4b6
8081fec
03c036b
44d34f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -22,21 +22,37 @@ else() | |||
set(LIBIGFXCMRT_EMU ${LLVM_BINARY_DIR}/pi_esimd_emulator_deps/lib/libigfxcmrt_emu${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||||
endif() | ||||
|
||||
if (DEFINED CM_LOCAL_SOURCE_DIR) | ||||
# Using local CM directory for online building without downloading | ||||
set (DEFAULT_CM_EMU_PREBUILT_PACKAGE "https://github.com/intel/cm-cpu-emulation/releases/download/v2022-02-11/intel-cmemu-1.0.20.u20.04-release.x86_64.tar.xz") | ||||
set (DEFAULT_CM_EMU_SOURCE_URL "https://github.com/intel/cm-cpu-emulation.git") | ||||
|
||||
if (DEFINED USE_DEFAULT_CM_EMU_SOURCE) | ||||
if ((DEFINED USE_LOCAL_CM_EMU_SOURCE) OR (DEFINED USE_CM_EMU_PREBUILT_PACKAGE)) | ||||
message(FATAL_ERROR "Configuration failure : Building CM_EMU library with local source or using pre-built one with online-building of CM_EMU") | ||||
endif() | ||||
if (MSVC) | ||||
message(FATAL_ERROR "Online-building of CM_EMU library is not supported under Windows environment") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to factor out the MSVC check and do it once (there is another one at line 50). |
||||
else() | ||||
ExternalProject_Add(cm-emu | ||||
DOWNLOAD_COMMAND "" | ||||
SOURCE_DIR ${CM_LOCAL_SOURCE_DIR} | ||||
GIT_REPOSITORY ${DEFAULT_CM_EMU_SOURCE_URL} | ||||
GIT_TAG f9d167edbcb995e713d5a8 | ||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_build | ||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install | ||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||||
CMAKE_ARGS -DLIBVA_INSTALL_PATH=/usr | ||||
-D__SYCL_EXPLICIT_SIMD_PLUGIN__=true | ||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||||
BUILD_BYPRODUCTS ${LIBCM} ${LIBIGFXCMRT_EMU} | ||||
) | ||||
endif() | ||||
elseif (DEFINED USE_LOCAL_CM_EMU_SOURCE) | ||||
if (DEFINED USE_CM_EMU_PREBUILT_PACKAGE) | ||||
message(FATAL_ERROR "Configuration failure : Using pre-built CM_EMU package with online-building of it") | ||||
endif() | ||||
if (MSVC) | ||||
message(FATAL_ERROR "Building of CM_EMU library is not supported under Windows environment") | ||||
else() | ||||
ExternalProject_Add(cm-emu | ||||
DOWNLOAD_COMMAND "" | ||||
SOURCE_DIR ${CM_LOCAL_SOURCE_DIR} | ||||
SOURCE_DIR ${USE_LOCAL_CM_EMU_SOURCE} | ||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_build | ||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install | ||||
CMAKE_ARGS -DLIBVA_INSTALL_PATH=/usr | ||||
|
@@ -45,42 +61,23 @@ if (DEFINED CM_LOCAL_SOURCE_DIR) | |||
BUILD_BYPRODUCTS ${LIBCM} ${LIBIGFXCMRT_EMU} | ||||
) | ||||
endif() | ||||
else () | ||||
if (DEFINED CM_PACKAGE_URL) | ||||
# Downloading pre-built CM Package | ||||
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install) | ||||
ExternalProject_Add(cm-emu | ||||
URL ${CM_PACKAGE_URL} | ||||
CONFIGURE_COMMAND "" | ||||
BUILD_COMMAND "" | ||||
UPDATE_COMMAND "" | ||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install | ||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/cm-emu-prefix/src/cm-emu/ <INSTALL_DIR> | ||||
BUILD_BYPRODUCTS ${LIBCM} ${LIBIGFXCMRT_EMU} | ||||
) | ||||
else() | ||||
# Build from CM source tree fetched from github | ||||
if (MSVC) | ||||
message(FATAL_ERROR "Online-building of CM_EMU library is not supported under Windows environment") | ||||
else() | ||||
# Arguments for online patching to suppress log message from CM_EMU | ||||
# Replacing CM_EMU's log print-out macro controlled by 'GFX_EMU_WITH_FLAGS_' | ||||
# with blank space from $CM_EMU_SRC/common/emu_log.h | ||||
set (replacing_pattern s/{\ ?GFX_EMU_WITH_FLAGS_.*//g) | ||||
ExternalProject_Add(cm-emu | ||||
GIT_REPOSITORY https://github.com/intel/cm-cpu-emulation.git | ||||
GIT_TAG f9d167edbcb995e713d5a8 | ||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_build | ||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install | ||||
PATCH_COMMAND perl -pi.back -e ${replacing_pattern} ${CMAKE_CURRENT_BINARY_DIR}/cm-emu-prefix/src/cm-emu/common/emu_log.h | ||||
CMAKE_ARGS -DLIBVA_INSTALL_PATH=/usr | ||||
-D__SYCL_EXPLICIT_SIMD_PLUGIN__=true | ||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||||
BUILD_BYPRODUCTS ${LIBCM} ${LIBIGFXCMRT_EMU} | ||||
) | ||||
endif() | ||||
else() | ||||
set(ACTUAL_CM_EMU_PREBUILT_PACKAGE ${DEFAULT_CM_EMU_PREBUILT_PACKAGE}) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to add a message here so that users can see what |
||||
if (DEFINED USE_CM_EMU_PREBUILT_PACKAGE) | ||||
set(ACTUAL_CM_EMU_PREBUILT_PACKAGE ${USE_CM_EMU_PREBUILT_PACKAGE}) | ||||
endif() | ||||
endif () | ||||
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install) | ||||
ExternalProject_Add(cm-emu | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, please add a TODO then too |
||||
URL ${ACTUAL_CM_EMU_PREBUILT_PACKAGE} | ||||
CONFIGURE_COMMAND "" | ||||
BUILD_COMMAND "" | ||||
UPDATE_COMMAND "" | ||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install | ||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/cm-emu-prefix/src/cm-emu/ <INSTALL_DIR> | ||||
BUILD_BYPRODUCTS ${LIBCM} ${LIBIGFXCMRT_EMU} | ||||
) | ||||
endif() | ||||
|
||||
ExternalProject_Add_Step(cm-emu llvminstall | ||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_BINARY_DIR}/pi_esimd_emulator_deps && ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/ ${LLVM_BINARY_DIR}/pi_esimd_emulator_deps | ||||
COMMENT "Installing cm-emu into the LLVM binary directory" | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it documented anywhere? Is it set from anywhere, e.g. buildbot/congigure.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to look up, but @pvchupin confirmed that this is typo. #5799 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding it's initialized at this specific point. Everything configure.py is doing is adding esimd_emulator to SYCL_ENABLE_PLUGINS under the switch.
I'm not sure if we are using SYCL_BUILD_PI_ESIMD_EMULATOR anywhere, but it seems there are a few occurrences in in LIT infra.