Conversation
There was a problem hiding this comment.
Pull request overview
Updates the shim test suite to better cover AIE4/NPU3 devices and makes BO usage querying resilient to multiple accel nodes by discovering the correct /dev/accel/* node from sysfs.
Changes:
- Add an NPU3 device filter and new multi-context IO test cases for NPU3.
- Rework
get_bo_usage()to find the device’s accel node via sysfs instead of hardcoding/dev/accel/accel0. - Expand/adjust several existing test case device filters to run on all XDNA/AIE devices (including AIE4).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c875844 to
41d5b58
Compare
Signed-off-by: Hayden Laccabue <hlaccabu@amd.com>
41d5b58 to
091ce38
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| closedir(dp); | ||
|
|
||
| if (accel_node.empty()) { | ||
| std::cerr << "Failed to find accel node under "<< accel_path << " for device" << std::endl; |
There was a problem hiding this comment.
Missing space after "under" in the error message. The output will be "Failed to find accel node under/path/to/accel for device" instead of "Failed to find accel node under /path/to/accel for device".
| auto dp = opendir(accel_path.c_str()); | ||
| if (!dp) { | ||
| std::perror(("opendir: " + accel_path).c_str()); | ||
| return {0, 0, 0}; | ||
| } | ||
|
|
||
| std::string accel_node; | ||
| while (auto entry = readdir(dp)) { | ||
| std::string dirname{entry->d_name}; | ||
| if (dirname.find("accel") == 0) { | ||
| accel_node = "/dev/accel/" + dirname; | ||
| break; | ||
| } | ||
| } | ||
| closedir(dp); |
There was a problem hiding this comment.
The directory handle 'dp' could potentially leak if an exception is thrown between opendir (line 265) and closedir (line 279). While unlikely with the current operations, consider using RAII (e.g., a smart pointer with a custom deleter or a wrapper class) to ensure the directory is always closed, even in exceptional circumstances.
No description provided.