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 authored and kbenzie committed Aug 20, 2024
1 parent 9535f74 commit 7355564
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 *allocate();
void free(ur_event *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 *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 *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 *> 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 *> events;
for (int i = 0; i < 128; ++i) {
events.push_back(pool->allocate());
Expand Down

0 comments on commit 7355564

Please sign in to comment.