8000 opencl: handle clCreateSubDevicesEXT in the interval plugin by TApplencourt · Pull Request #571 · argonne-lcf/THAPI · GitHub
[go: up one dir, main page]

Skip to content

opencl: handle clCreateSubDevicesEXT in the interval plugin - #571

Merged
TApplencourt merged 2 commits into
develfrom
fix-cl-sub-devices-ext
Nov 9, 2026
Merged

TApplencourt merged 2 commits into
develfrom
fix-cl-sub-devices-ext

Conversation

@TApplencourt
Copy link
Copy Markdown
Collaborator

Fixes #568.

Bug

In tally mode, two clCreateSubDevicesEXT calls abort babeltrace_thapi to_aggreg with push was not empty, and no tally is produced.

In btx_clmatching_model.yaml, create_sub_devices_entry matches clCreateSubDevicesEXT_entry too (unanchored name), but create_sub_devices_exit needs num_devices_ret_val, which clCreateSubDevicesEXT_exit calls num_devices_val. So the EXT entry pushed its device and nothing popped it. The next EXT entry threw in EntryState::set_data_impl, and EXT sub-devices were never mapped to their root device.

Fix

  • Add a create_sub_devices_ext_exit set (num_devices_val). Both exit callbacks share the mapping code.
  • Tests: thapi_log_to_bt_source_component.rb now handles non-empty array fields (devices_vals: [ 10 ]). It used to pass the first value cast to a pointer, and its field split cut a list at its commas. It now emits a compound literal of the element type. No existing test uses a non-empty array.
  • New test create_sub_devices_ext: clGetDeviceIDs returns device 10, a failing then a successful clCreateSubDevicesEXT returns sub-device 11, and a read on a queue of 11 runs.

Checked

🤖 Generated with Claude Code

TApplencourt and others added 2 commits November 9, 2026 22:40
thapi_log_to_bt_source_component.rb only handled an empty array field
("x_vals: [ ]"). For a non-empty one it passed the first value cast to
a pointer, and the field split cut a list at its commas. Emit a
compound literal of the element type instead, and split fields on
commas outside brackets.

No existing test uses a non-empty array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The set create_sub_devices_entry matches clCreateSubDevicesEXT_entry
too (unanchored name), but create_sub_devices_exit needs
num_devices_ret_val, which clCreateSubDevicesEXT_exit calls
num_devices_val. So the EXT entry pushed its device and nothing popped
it: the next EXT entry aborted to_aggreg with "push was not empty"
(#568), and EXT sub-devices were never mapped to their root device.

Add a create_sub_devices_ext_exit set and have both exits share the
mapping code.

New test create_sub_devices_ext: a failing then a successful
clCreateSubDevicesEXT, and a command on the sub-device. Without the fix
it aborts with "push was not empty"; with it the command runs on
did = 10 (root), sdid = 11 (sub-device).

Fixes #568

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TApplencourt
TApplencourt merged commit 93e49b0 into devel Nov 9, 2026
28 checks passed
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.

OpenCL tally: two clCreateSubDevicesEXT calls abort to_aggreg ("push was not empty")

1 participant

0