Skip to content

Commit 2bc3c92

Browse files
authored
[SYCL][HIP] Fix platform query in USM alloc info (#5140)
This fixes the `USM/pointer_query.cpp` test from `llvm-test-suite`. Using `0` when trying to query platforms is invalid, so this would cause segmentation faults.
1 parent b5e8efb commit 2bc3c92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/plugins/hip/pi_hip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4756,7 +4756,7 @@ pi_result hip_piextUSMGetMemAllocInfo(pi_context context, const void *ptr,
47564756
static_cast<int *>(hipPointerAttributeType.devicePointer);
47574757
value = *devicePointer;
47584758
pi_platform platform;
4759-
result = hip_piPlatformsGet(0, &platform, nullptr);
4759+
result = hip_piPlatformsGet(1, &platform, nullptr);
47604760
pi_device device = platform->devices_[value].get();
47614761
return getInfo(param_value_size, param_value, param_value_size_ret,
47624762
device);

0 commit comments

Comments
 (0)