Skip to content

UR Offload: align enqueue calls with updated OffloadAPI signatures#22125

Draft
Copilot wants to merge 7 commits into
syclfrom
copilot/fix-failing-github-actions-job
Draft

UR Offload: align enqueue calls with updated OffloadAPI signatures#22125
Copilot wants to merge 7 commits into
syclfrom
copilot/fix-failing-github-actions-job

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

The Offload job in UR precommit regressed due to API drift between the offload adapter and the current OffloadAPI.h function signatures. The adapter still used old call forms for event creation and kernel launch, causing compile-time argument mismatch errors.

  • What changed

    • olCreateEvent call sites updated: pass explicit event flags at all enqueue/event creation paths in enqueue.cpp.
    • olLaunchKernel call updated: pass the new launch-properties argument (nullptr for current behavior) to match the extended signature.
    • Default event flags centralized: introduced a local constant to avoid repeated literals and keep call sites consistent.
  • Why this resolves the CI failure

    • Build break source removed: all offload enqueue paths now match current Offload API prototypes, eliminating the type/arity mismatches reported by the failing job.
constexpr ol_event_flags_t OL_DEFAULT_EVENT_FLAGS = 0;

olCreateEvent(Queue, OL_DEFAULT_EVENT_FLAGS, &Event->OffloadEvent);

olLaunchKernel(Queue, hQueue->OffloadDevice, hKernel->OffloadKernel,
               hKernel->Args.getStorage(), hKernel->Args.getStorageSize(),
               &LaunchArgs, nullptr);

@ldorau
Copy link
Copy Markdown
Contributor

ldorau commented May 27, 2026

Copilot AI changed the title [WIP] Fix failing GitHub Actions job Adapters (Offload) / Build (Release, gcc, g++) Fix offload adapter link path resolution for multiarch LLVMOffload installs May 27, 2026
Copilot finished work on behalf of ldorau May 27, 2026 09:10
Copilot AI requested a review from ldorau May 27, 2026 09:10
@ldorau ldorau requested a review from wlemkows May 27, 2026 09:15
@ldorau ldorau requested a review from Copilot May 27, 2026 09:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes ur_adapter_offload link-time failures when consuming a prebuilt LLVM Offload install whose libraries are placed under multiarch lib directories (e.g., lib/x86_64-unknown-linux-gnu) instead of a flat ${prefix}/lib layout.

Changes:

  • Replaces a hardcoded ${UR_OFFLOAD_INSTALL_DIR}/lib/libLLVMOffload.so link with a resolved UR_OFFLOAD_LLVMOFFLOAD_LIBRARY path.
  • Adds CMake logic to locate libLLVMOffload via find_library() with common libdir suffixes, plus a glob fallback for nested multiarch layouts.
  • Emits a fatal configure error if libLLVMOffload cannot be found.

Comment on lines +137 to +149
if(UR_OFFLOAD_BUILD_FROM_SOURCE)
set(UR_OFFLOAD_LLVMOFFLOAD_LIBRARY
"${UR_OFFLOAD_INSTALL_DIR}/lib/libLLVMOffload${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
find_library(UR_OFFLOAD_LLVMOFFLOAD_LIBRARY
NAMES LLVMOffload
HINTS "${UR_OFFLOAD_INSTALL_DIR}"
PATH_SUFFIXES
"${CMAKE_INSTALL_LIBDIR}"
lib
lib64
NO_DEFAULT_PATH
)
Comment on lines +155 to +158
if(UR_OFFLOAD_LLVMOFFLOAD_LIBRARY_CANDIDATES)
list(SORT UR_OFFLOAD_LLVMOFFLOAD_LIBRARY_CANDIDATES)
list(GET UR_OFFLOAD_LLVMOFFLOAD_LIBRARY_CANDIDATES 0 UR_OFFLOAD_LLVMOFFLOAD_LIBRARY)
endif()
Copilot AI changed the title Fix offload adapter link path resolution for multiarch LLVMOffload installs UR Offload: align enqueue calls with updated OffloadAPI signatures May 27, 2026
Copilot finished work on behalf of ldorau May 27, 2026 10:17
Copilot finished work on behalf of ldorau May 27, 2026 10:52
@ldorau
Copy link
Copy Markdown
Contributor

ldorau commented May 29, 2026

@lplewa please review if this fix makes sense (or if we can close this PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants