Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize zetracer #203

Open
TApplencourt opened this issue Apr 17, 2024 · 1 comment
Open

modernize zetracer #203

TApplencourt opened this issue Apr 17, 2024 · 1 comment

Comments

@TApplencourt
Copy link
Collaborator

TApplencourt commented Apr 17, 2024

  • zeCommandListIsImmediate and zeEventPoolGetFlags can be used to replace flags
  • zeCommandListGetContextHandle, zeEventPoolGetContextHandle and zeEventGetEventPool can be used to remove some member function
@TApplencourt
Copy link
Collaborator Author

TApplencourt commented Apr 17, 2024

OOM

The clean-up code in case of allocation failure seems to "greedy". For example, in _get_profiling_event

  ze_event_desc_t e_desc = {ZE_STRUCTURE_TYPE_EVENT_DESC, NULL, 0, ZE_EVENT_SCOPE_FLAG_HOST, ZE_EVENT_SCOPE_FLAG_HOST};
  res = ZE_EVENT_CREATE_PTR(e_w->event_pool, &e_desc, &e_w->event);
  if (res != ZE_RESULT_SUCCESS) {
    THAPI_DBGLOG("zeEventCreate failed with %d, for event pool: %p, command list: %p, context: %p", res, e_w->event_pool, command_list, context);
    goto cleanup_ep;
  }
  goto cleanup;
cleanup_ep:
  ZE_EVENT_POOL_DESTROY_PTR(e_w->event_pool);

Maybe we create the pool to profile other event, it seem a little hard to remove the full pools.

Cleanup

On _on_destroy_context not clear too me why we have a loop on _ze_events and then on _ze_event_pools. My understanding is that _ze_event_pools keep a link of ze_events.

The code seem to imply that we can destroy some event who are on _ze_events but not on _ze_event_pools

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

No branches or pull requests

1 participant