Skip to content

Conversation

@igchor
Copy link
Contributor

@igchor igchor commented Jul 24, 2024

No description provided.

@github-actions github-actions bot added level-zero L0 adapter specific issues command-buffer Command Buffer feature addition/changes/specification labels Jul 24, 2024

namespace v2 {

ur_wait_list_t::ur_wait_list_t(const ur_event_handle_t *phWaitEvents,
Copy link
Contributor

@pbalcer pbalcer Jul 29, 2024

Choose a reason for hiding this comment

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

this seems overcomplicated.

Let's do something like:

class ur_wait_list {
std::pair<ze_event_handle_t *, size_t> getArray(ur_event_handle_t  *urHandles, size_t size, ze_event_handle_t extra) {
  size_t real_size = size + (extra ? 1 : 0);
  handles.reserve(real_size);
  for (size_t i = 0; i < size; ++i) {
     handles[i] = urHandles[i]->zeHandle;
  }
  
  if (extra) 
    handles[size] = extra;

  return (handles.data(), real_size );
}

private:
  std::vector<ze_event_handle_t *> handles; //preallocated, never shrinks
}

This would then be stored in the queue and reused for every enqueue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Done.

@igchor
Copy link
Contributor Author

igchor commented Aug 6, 2024

I will close this and open a new PR rebased on top of #1893 once it's merged

@igchor igchor closed this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command-buffer Command Buffer feature addition/changes/specification level-zero L0 adapter specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants