Skip to content

Commit b226c70

Browse files
committed
tidy up Makefile
1 parent b6c393a commit b226c70

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed

offload/plugins-nextgen/level_zero/CMakeLists.txt

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,25 @@ target_include_directories(omptarget.rtl.level_zero PRIVATE
3232

3333
if (EXISTS ${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARIES} AND NOT "level_zero" IN_LIST LIBOMPTARGET_DLOPEN_PLUGINS)
3434
message(STATUS "Building Level Zero NG plugin linked against level_zero library")
35-
36-
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
35+
if(UNIX)
3736
target_link_libraries(omptarget.rtl.level_zero PRIVATE
38-
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARIES})
39-
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
40-
# Full path to the L0 library is recognized as a linker option, so we
37+
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY})
38+
elseif(WIN32)
39+
# Full path to the Level Zero library is recognized as a linker option, so we
4140
# separate directory and file name
42-
get_filename_component(LEVEL_ZERO_LIBRARY_PATH
43-
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARIES} DIRECTORY)
44-
get_filename_component(LEVEL_ZERO_LIBRARY_NAME
45-
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARIES} NAME)
46-
target_link_libraries(omptarget.rtl.level_zero PRIVATE
47-
${LEVEL_ZERO_LIBRARY_NAME} ${LIBOMP_LIB_FILE})
48-
target_link_directories(omptarget.rtl.level_zero PRIVATE
49-
${LEVEL_ZERO_LIBRARY_PATH})
50-
target_link_options(omptarget.rtl.level_zero PRIVATE
51-
"LINKER:-def:${CMAKE_CURRENT_SOURCE_DIR}/src/rtl.def")
52-
libomptarget_add_resource_file(omptarget.rtl.level_zero)
41+
cmake_path(GET LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY PARENT_PATH LEVEL_ZERO_LIBRARY_PATH)
42+
target_link_libraries(omptarget.rtl.level_zero PRIVATE ${LEVEL_ZERO_LIBRARY_NAME}
43+
${LIBOMP_LIB_FILE})
44+
target_link_directories(omptarget.rtl.level_zero PRIVATE ${LEVEL_ZERO_LIBRARY_PATH})
5345
else()
5446
message(FATAL_ERROR "Missing platform support")
5547
endif()
5648
else()
5749
message(STATUS "Building Level Zero NG plugin for dlopened level_zero")
58-
get_filename_component(LEVEL_ZERO_LIBRARY_NAME
59-
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARIES} NAME)
60-
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
61-
# Windows uses dll instead of lib files at runtime
62-
string(REGEX REPLACE "lib$" "dll" LEVEL_ZERO_LIBRARY_NAME
63-
${LEVEL_ZERO_LIBRARY_NAME})
50+
if(WIN32)
51+
cmake_path(REPLACE_EXTENSION LEVEL_ZERO_LIBRARY_NAME dll)
6452
endif()
65-
target_compile_options(omptarget.rtl.level_zero PRIVATE
66-
"-DLEVEL_ZERO_LIBRARY=\"${LEVEL_ZERO_LIBRARY_NAME}\"")
53+
target_compile_definitions(omptarget.rtl.level_zero PRIVATE
54+
LEVEL_ZERO_LIBRARY="${LEVEL_ZERO_LIBRARY_NAME}")
6755
target_sources(omptarget.rtl.level_zero PRIVATE src/L0DynWrapper.cpp)
6856
endif()

offload/plugins-nextgen/level_zero/src/L0Device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,14 @@ Expected<InfoTreeNode> L0DeviceTy::obtainInfoImpl() {
574574
Info.add("Driver Version", "Unknown", "", DeviceInfo::DRIVER_VERSION);
575575
Info.add("Device PCI ID", getPCIId());
576576
Info.add("Device UUID", getUuid().data());
577-
Info.add("Number of total EUs", getNumEUs(), "", DeviceInfo::MAX_COMPUTE_UNITS);
577+
Info.add("Number of total EUs", getNumEUs(), "", DeviceInfo::NUM_COMPUTE_UNITS);
578578
Info.add("Number of threads per EU", getNumThreadsPerEU());
579579
Info.add("EU SIMD width", getSIMDWidth());
580580
Info.add("Number of EUs per subslice", getNumEUsPerSubslice());
581581
Info.add("Number of subslices per slice", getNumSubslicesPerSlice());
582582
Info.add("Number of slices", getNumSlices());
583583
Info.add("Max Group size", getMaxGroupSize(), "",
584-
DeviceInfo::MAX_GROUP_WORK_SIZE);
584+
DeviceInfo::MAX_WORK_GROUP_SIZE);
585585
Info.add("Local memory size (bytes)", getMaxSharedLocalMemory());
586586
Info.add("Global memory size (bytes)", getGlobalMemorySize(), "",
587587
DeviceInfo::GLOBAL_MEM_SIZE);

0 commit comments

Comments
 (0)