Skip to content

Commit 34b66fd

Browse files
committed
Set the right HIP device before creating base event counter
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.
1 parent a9c7aef commit 34b66fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source/adapters/hip/platform.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries,
7777
for (auto i = 0u; i < static_cast<uint32_t>(NumDevices); ++i) {
7878
hipDevice_t Device;
7979
UR_CHECK_ERROR(hipDeviceGet(&Device, i));
80+
UR_CHECK_ERROR(hipSetDevice(i));
8081
hipEvent_t EvBase;
8182
UR_CHECK_ERROR(hipEventCreate(&EvBase));
8283

0 commit comments

Comments
 (0)