Skip to content

Commit

Permalink
Merge pull request #1988 from igchor/event_optional_v2
Browse files Browse the repository at this point in the history
[L0 v2] fix use of device->Id
  • Loading branch information
omarahmed1111 committed Aug 19, 2024
2 parents 9239506 + c619b31 commit bd3094c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/adapters/level_zero/v2/event_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class event_pool {
event_pool(const event_pool &) = delete;
event_pool &operator=(const event_pool &) = delete;

DeviceId Id() { return provider->device()->Id; };
DeviceId Id() { return provider->device()->Id.value(); };

ur_event_handle_t_ *allocate();
void free(ur_event_handle_t_ *event);
Expand Down
8 changes: 4 additions & 4 deletions test/adapters/level_zero/v2/event_pool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TEST_P(EventPoolTest, Basic) {
ur_event_handle_t first;
ze_event_handle_t zeFirst;
{
auto pool = cache->borrow(device->Id);
auto pool = cache->borrow(device->Id.value());

first = pool->allocate();
zeFirst = first->getZeEvent();
Expand All @@ -148,7 +148,7 @@ TEST_P(EventPoolTest, Basic) {
ur_event_handle_t second;
ze_event_handle_t zeSecond;
{
auto pool = cache->borrow(device->Id);
auto pool = cache->borrow(device->Id.value());

second = pool->allocate();
zeSecond = second->getZeEvent();
Expand All @@ -165,7 +165,7 @@ TEST_P(EventPoolTest, Threaded) {
for (int iters = 0; iters < 3; ++iters) {
for (int th = 0; th < 10; ++th) {
threads.emplace_back([&] {
auto pool = cache->borrow(device->Id);
auto pool = cache->borrow(device->Id.value());
std::vector<ur_event_handle_t> events;
for (int i = 0; i < 100; ++i) {
events.push_back(pool->allocate());
Expand All @@ -183,7 +183,7 @@ TEST_P(EventPoolTest, Threaded) {
}

TEST_P(EventPoolTest, ProviderNormalUseMostFreePool) {
auto pool = cache->borrow(device->Id);
auto pool = cache->borrow(device->Id.value());
std::list<ur_event_handle_t> events;
for (int i = 0; i < 128; ++i) {
events.push_back(pool->allocate());
Expand Down

0 comments on commit bd3094c

Please sign in to comment.