Skip to content

Commit

Permalink
Set the right HIP device before creating base event counter
Browse files Browse the repository at this point in the history
Without any default device in the current thread, all base events
were associated with device 0, causing failures when used on other
devices. Fix this by calling hipSetDevice before recording the event.
  • Loading branch information
rafbiels committed Nov 1, 2024
1 parent a9c7aef commit 34b66fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/adapters/hip/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries,
for (auto i = 0u; i < static_cast<uint32_t>(NumDevices); ++i) {
hipDevice_t Device;
UR_CHECK_ERROR(hipDeviceGet(&Device, i));
UR_CHECK_ERROR(hipSetDevice(i));
hipEvent_t EvBase;
UR_CHECK_ERROR(hipEventCreate(&EvBase));

Expand Down

0 comments on commit 34b66fd

Please sign in to comment.