From 7dbf31e57f7fc3cd952f65c0fd985a2d8f40488b Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Tue, 30 Jan 2024 09:21:38 -0800 Subject: [PATCH] fix the reported platform information for math brute force (#1884) When the math brute force test printed the platform version it always printed information for the first platform in the system, which could be different than the platform for the passed-in device. Fixed by querying the platform from the passed-in device instead. --- test_conformance/math_brute_force/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test_conformance/math_brute_force/main.cpp b/test_conformance/math_brute_force/main.cpp index 74dd5c47..947b9450 100644 --- a/test_conformance/math_brute_force/main.cpp +++ b/test_conformance/math_brute_force/main.cpp @@ -769,10 +769,11 @@ test_status InitCL(cl_device_id device) IsTininessDetectedBeforeRounding(); cl_platform_id platform; - int err = clGetPlatformIDs(1, &platform, NULL); + int err = clGetDeviceInfo(gDevice, CL_DEVICE_PLATFORM, sizeof(platform), + &platform, NULL); if (err) { - print_error(err, "clGetPlatformIDs failed"); + print_error(err, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed"); return TEST_FAIL; }