Skip to content

AIESW-31422:Fix use of deprecated kernel apis.#9761

Open
svup-xilinx wants to merge 1 commit intoXilinx:masterfrom
svup-xilinx:AIESW-31422
Open

AIESW-31422:Fix use of deprecated kernel apis.#9761
svup-xilinx wants to merge 1 commit intoXilinx:masterfrom
svup-xilinx:AIESW-31422

Conversation

@svup-xilinx
Copy link
Copy Markdown
Collaborator

Problem solved by the commit

The deprecated constructors kernel (device, uuid, name) and kernel (device, uuid, name, mode) were being called directly from Python bindings, causing compilation failures

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

AIESW-31422

How problem was solved, alternative solutions (if any) and why they were rejected

Added compatibility shim for both kernel constructor overloads using modern hw_context API internally to eliminate C++ deprecation warnings while maintaining Python backward compatibility.

  • kernel(device, uuid, name) → uses hw_context with shared mode
  • kernel(device, uuid, name, mode) → uses hw_context with specified mode
  • Issues Python DeprecationWarning at runtime
  • Fixes the issue properly instead of suppressing warnings on Windows.

Risks (if any) associated the changes in the commit

Python.

What has been tested and how, request additional testing if necessary

Tested on windows with custom made test on Strix machine.

Documentation impact (if any)

None. Runtime warnings guide users to modern API.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/python/pybind11/src/pyxrt.cpp Outdated
Comment thread src/python/pybind11/src/pyxrt.cpp Outdated
Added compatibility shim for both kernel constructor overloads using
modern hw_context API internally to eliminate C++ deprecation warnings
while maintaining Python backward compatibility.

- kernel(device, uuid, name) → uses hw_context with shared mode
- kernel(device, uuid, name, mode) → uses hw_context with specified mode
- Issues Python DeprecationWarning for migration guidance
- Fixes the issue properly instead of suppressing warnings on Windows.

Signed-off-by: Srikanth Vuppala <120363307+svup-xilinx@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Collaborator

@stsoe stsoe left a comment

Choose a reason for hiding this comment

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

I am not able to review Python binding code to the level where I understand what's going on. I assume the changes are okay.

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