-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[OFFLOAD] Add plugin with support for Intel oneAPI Level Zero #158900
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
Open
adurang
wants to merge
45
commits into
llvm:main
Choose a base branch
from
adurang:l0_plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 33 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
0c42764
[OFFLOAD] Add plugin with support for Intel Level Zero
adurang e8c471e
Merge branch 'main' into l0_plugin
adurang f8956cd
Update offload/CMakeLists.txt
adurang d3fc4d7
Update offload/plugins-nextgen/level_zero/CMakeLists.txt
adurang 4b38386
Update offload/plugins-nextgen/level_zero/include/L0Plugin.h
adurang 6c1c820
Replace pragma once
adurang fd91c47
Address review comments
adurang 84665dc
Fix makefile format
adurang a2217db
change to StringRef in multiple places
adurang 08880a6
remove tokenize
adurang 9a3088c
remove unused code
adurang 24d0645
fix format
adurang 0eb5712
Remove environment variable
adurang f491f3d
fix getAsInteger conditions
adurang 9bbdae3
Merge branch 'main' into l0_plugin
adurang fe633f4
Don't use __tgt_device_image
adurang e36a8fc
fix image checking
adurang 53bce7e
changes from review comments
adurang 69df388
remove more CMake messages
adurang 91fa069
format
adurang 561e4ca
remove unnecessary check
adurang ad07ee8
Merge branch 'main' into l0_plugin
adurang 5b90ccb
Add level_zero to liboffload platforms
adurang 6b8280d
fix different issues
adurang f983135
Fix ELF bits from #159623
adurang b6c393a
format & add more Deviceinfo tags
adurang b226c70
tidy up Makefile
adurang af1945f
format & renaming
adurang 3dba3c3
Remove ompt_device_t reference
adurang ac62231
address reviews
adurang 17c8e31
remove unused argument
adurang e550bf1
Merge branch 'main' into l0_plugin
adurang b859179
cleanup
adurang c141f9d
address review
adurang dd774b6
fix & remove dead code
adurang 7fa9dda
remove support for target ICVs
adurang 96411ce
typo & format
adurang a4cd814
Merge branch 'main' into l0_plugin
adurang 6c5278f
Adjust interfaces after merge
adurang 44b2f48
push some error checking down
adurang b4e238f
Update offload/plugins-nextgen/level_zero/include/L0Device.h
adurang 166028d
address review comments
adurang 6629159
format
adurang c00c288
more format :/
adurang 93d3948
add missed wrapper; remove unused macro
adurang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Create the library and add the default arguments. | ||
add_target_library(omptarget.rtl.level_zero LEVEL_ZERO) | ||
|
||
set(LEVEL_ZERO_SRC_FILES | ||
src/L0Context.cpp | ||
src/L0Device.cpp | ||
src/L0Kernel.cpp | ||
src/L0Memory.cpp | ||
src/L0Program.cpp | ||
src/L0Plugin.cpp | ||
src/L0Program.cpp | ||
src/L0Options.cpp | ||
) | ||
list(APPEND LEVEL_ZERO_SRC_FILES | ||
src/OmpWrapper.cpp | ||
) | ||
|
||
target_sources(omptarget.rtl.level_zero PRIVATE | ||
${LEVEL_ZERO_SRC_FILES} | ||
) | ||
|
||
target_include_directories(omptarget.rtl.level_zero PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
) | ||
|
||
target_include_directories(omptarget.rtl.level_zero PRIVATE | ||
${LIBOMPTARGET_INCLUDE_DIR} | ||
${LIBOMPTARGET_DEP_LEVEL_ZERO_INCLUDE_DIR} | ||
${LIBOMPTARGET_LLVM_INCLUDE_DIRS} | ||
${LIBOMPTARGET_OMP_HEADER_DIR} | ||
) | ||
|
||
cmake_path(GET LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY FILENAME LEVEL_ZERO_LIBRARY_NAME) | ||
if (EXISTS ${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY} AND NOT "level_zero" IN_LIST LIBOMPTARGET_DLOPEN_PLUGINS) | ||
message(STATUS "Building Level Zero NG plugin linked against level_zero library") | ||
if(UNIX) | ||
target_link_libraries(omptarget.rtl.level_zero PRIVATE | ||
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY}) | ||
elseif(WIN32) | ||
# Full path to the Level Zero library is recognized as a linker option, so we | ||
# separate directory and file name | ||
cmake_path(GET LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY PARENT_PATH LEVEL_ZERO_LIBRARY_PATH) | ||
target_link_libraries(omptarget.rtl.level_zero PRIVATE ${LEVEL_ZERO_LIBRARY_NAME} | ||
${LIBOMP_LIB_FILE}) | ||
target_link_directories(omptarget.rtl.level_zero PRIVATE ${LEVEL_ZERO_LIBRARY_PATH}) | ||
else() | ||
message(FATAL_ERROR "Missing platform support") | ||
endif() | ||
else() | ||
message(STATUS "Building Level Zero NG plugin for dlopened level_zero") | ||
if(WIN32) | ||
cmake_path(REPLACE_EXTENSION LEVEL_ZERO_LIBRARY_NAME dll) | ||
endif() | ||
target_compile_definitions(omptarget.rtl.level_zero PRIVATE | ||
LEVEL_ZERO_LIBRARY="${LEVEL_ZERO_LIBRARY_NAME}") | ||
target_sources(omptarget.rtl.level_zero PRIVATE src/L0DynWrapper.cpp) | ||
endif() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wouldn't it be better to do this check when we create the list rather than removing it later?
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.
All the other plugins are treated in the same way right now (e.g., 3 lines above). They are in the "candidate" list and if some condition is not met they're removed.
I don't disagree with your statement about do it earlier but we should be consistent, so maybe something to do subsequently?