From 1a0c478217462331385c9d35071e4ada580f0860 Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Tue, 14 Dec 2021 16:25:39 +0000 Subject: [PATCH] [SYCL][HIP] Fix platform query in USM alloc info 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. --- sycl/plugins/hip/pi_hip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/plugins/hip/pi_hip.cpp b/sycl/plugins/hip/pi_hip.cpp index 97dd5baab67c6..0fe1d00365c67 100644 --- a/sycl/plugins/hip/pi_hip.cpp +++ b/sycl/plugins/hip/pi_hip.cpp @@ -4755,7 +4755,7 @@ pi_result hip_piextUSMGetMemAllocInfo(pi_context context, const void *ptr, static_cast(hipPointerAttributeType.devicePointer); value = *devicePointer; pi_platform platform; - result = hip_piPlatformsGet(0, &platform, nullptr); + result = hip_piPlatformsGet(1, &platform, nullptr); pi_device device = platform->devices_[value].get(); return getInfo(param_value_size, param_value, param_value_size_ret, device);