Skip to content

Commit 50ccce9

Browse files
[ESIMD] Enable esimd emulator build by default (#5058)
* Enabled ESIMD_EMU support build by default * Replaced ESIMD_EMU with ESIMDCPU for legacy CM_EMU * Updated PI Device info * Removed command line option for esimd_cpu_emulation * Reduced overhead on command creation for ESIMD_EMULATOR BE * ESIMD_EMULATOR plug-in update for bringing-up intel/llvm-test-suite * CM-EMU Device version info composition * Changes to suppress warning messages * Single-point-of-return for EnqueueKernel * Added command line option for disabling ESIMD_EMULATOR build
1 parent b0c145a commit 50ccce9

File tree

7 files changed

+335
-116
lines changed

7 files changed

+335
-116
lines changed

buildbot/configure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def do_configure(args):
3232
libclc_targets_to_build = ''
3333
libclc_gen_remangled_variants = 'OFF'
3434
sycl_build_pi_cuda = 'OFF'
35-
sycl_build_pi_esimd_emulator = 'OFF'
35+
sycl_build_pi_esimd_emulator = 'ON'
3636
sycl_build_pi_hip = 'OFF'
3737
sycl_build_pi_hip_platform = 'AMD'
3838
sycl_clang_extra_flags = ''
@@ -50,8 +50,8 @@ def do_configure(args):
5050
if args.arm:
5151
llvm_targets_to_build = 'ARM;AArch64'
5252

53-
if args.enable_esimd_cpu_emulation:
54-
sycl_build_pi_esimd_emulator = 'ON'
53+
if args.disable_esimd_emulator:
54+
sycl_build_pi_esimd_emulator = 'OFF'
5555

5656
if args.cuda or args.hip:
5757
llvm_enable_projects += ';libclc'
@@ -213,7 +213,7 @@ def main():
213213
parser.add_argument("--hip-platform", type=str, choices=['AMD', 'NVIDIA'], default='AMD', help="choose hardware platform for HIP backend")
214214
parser.add_argument("--hip-amd-arch", type=str, help="Sets AMD gpu architecture for llvm lit tests, this is only needed for the HIP backend and AMD platform")
215215
parser.add_argument("--arm", action='store_true', help="build ARM support rather than x86")
216-
parser.add_argument("--enable-esimd-cpu-emulation", action='store_true', help="build with ESIMD_CPU emulation support")
216+
parser.add_argument("--disable-esimd-emulator", action='store_true', help="exclude ESIMD_EMULATOR support")
217217
parser.add_argument("--no-assertions", action='store_true', help="build without assertions")
218218
parser.add_argument("--docs", action='store_true', help="build Doxygen documentation")
219219
parser.add_argument("--no-werror", action='store_true', help="Don't treat warnings as errors")

sycl/CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,11 @@ if(SYCL_BUILD_PI_HIP)
336336
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins pi_hip)
337337
endif()
338338

339-
if (SYCL_BUILD_PI_ESIMD_EMULATOR)
340-
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS pi_esimd_emulator libcmrt-headers)
341-
if (MSVC)
342-
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libcmrt-libs libcmrt-dlls)
343-
else()
344-
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libcmrt-sos)
345-
endif()
339+
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS pi_esimd_emulator libcmrt-headers)
340+
if (MSVC)
341+
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libcmrt-libs libcmrt-dlls)
346342
else()
347-
# TODO/FIXME : Removing empty header file (cm_rt.h) generation when
348-
# the ESIMD_EMULATOR support is enabled by default
349-
file (TOUCH ${SYCL_INCLUDE_BUILD_DIR}/sycl/CL/cm_rt.h)
343+
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libcmrt-sos)
350344
endif()
351345

352346
# Use it as fake dependency in order to force another command(s) to execute.

sycl/plugins/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ endif()
1515
add_subdirectory(opencl)
1616
add_subdirectory(level_zero)
1717

18-
# TODO : Remove 'if (NOT MSVC)' when CM_EMU supports Windows
19-
# environment
20-
if (NOT MSVC)
21-
if (SYCL_BUILD_PI_ESIMD_EMULATOR)
18+
if(SYCL_BUILD_PI_ESIMD_EMULATOR)
19+
# TODO : Remove 'if (NOT MSVC)' when CM_EMU supports Windows
20+
# environment
21+
if (NOT MSVC)
2222
add_subdirectory(esimd_emulator)
2323
endif()
2424
endif()

sycl/plugins/esimd_emulator/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ else ()
6363
if (MSVC)
6464
message(FATAL_ERROR "Online-building of CM_EMU library is not supported under Windows environment")
6565
else()
66+
# Arguments for online patching to suppress log message from CM_EMU
67+
# Replacing CM_EMU's log print-out macro controlled by 'GFX_EMU_WITH_FLAGS_'
68+
# with blank space from $CM_EMU_SRC/common/emu_log.h
69+
set (replacing_pattern s/{\ ?GFX_EMU_WITH_FLAGS_.*//g)
6670
ExternalProject_Add(cm-emu
6771
GIT_REPOSITORY https://github.com/intel/cm-cpu-emulation.git
72+
GIT_TAG c19234cea13bdfc32b5ed9
6873
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_build
6974
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install
75+
PATCH_COMMAND perl -pi.back -e ${replacing_pattern} ${CMAKE_CURRENT_BINARY_DIR}/cm-emu-prefix/src/cm-emu/common/emu_log.h
7076
CMAKE_ARGS -DLIBVA_INSTALL_PATH=/usr
7177
-D__SYCL_EXPLICIT_SIMD_PLUGIN__=true
7278
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
@@ -139,7 +145,7 @@ install(TARGETS pi_esimd_emulator
139145

140146
# Copy CM Header files to $(INSTALL)/include/sycl/CL/
141147
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cm-emu_install/include/libcm/cm/
142-
DESTINATION ${SYCL_INCLUDE_DIR}/CL
148+
DESTINATION ${SYCL_INCLUDE_DIR}/sycl/CL
143149
COMPONENT libcmrt-headers
144150
FILES_MATCHING PATTERN "*.h"
145151
)

0 commit comments

Comments
 (0)