Skip to content

Commit

Permalink
Merge pull request #1841 from igchor/l0_v2_readme
Browse files Browse the repository at this point in the history
[L0 v2] Add readme
  • Loading branch information
pbalcer authored Jul 12, 2024
2 parents ee4864f + 4159a38 commit a7920ef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/adapters/level_zero/v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# L0 v2 adapter

This is the home directory for L0 v2 adapter sources. This is a redesigned version of the L0 adapter that focuses on maximizing the performance of each queue mode individually (immediate/batched, in-order/out-of-order).

L0 v2 adapter can be enabled by setting `UR_L0_USE_QUEUE_V2=1` env variable. If the variable is not set, legacy path will be used.

# Code structure

v2 adapter only rewrites certain functions (mostly urEnqueue* functions) while reusing the rest. `ur_queue_handle_t` has become an abstract class and each enqueue function a virtual function.

Legacy enqeue path is implemented in `ur_queue_handle_legacy_t` which inherits from `ur_queue_handle_t`. For new, optimized path, each queue mode will be implemented as a separate queue class (e.g. `v2::ur_queue_immediate_in_order_t`) inheriting from `ur_queue_handle_t`.

`ur_queue_handle_t` is auto-generated by `make generate-code` - for every API function that accepts `ur_queue_handle_t` as a first parameter, new pure virtual method is created. The API function is then
auto-implemented (see ../queue_api.cpp) by dispatching to that virtual method. Developer is only responsbile for implementing that virtual function for every queue base class.

0 comments on commit a7920ef

Please sign in to comment.