From d938f978a8ce46b66dfc0dc39e6115adcd3f548b Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 14 Jan 2025 08:30:15 +0100 Subject: [PATCH] [primitives] fix benchmark if no primitives benchmark is run use optimized implementation instead of generic if one is available. --- libfreerdp/primitives/primitives.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libfreerdp/primitives/primitives.c b/libfreerdp/primitives/primitives.c index f968bf9d8..484e06300 100644 --- a/libfreerdp/primitives/primitives.c +++ b/libfreerdp/primitives/primitives.c @@ -165,6 +165,7 @@ fail: return ret; } +#if defined(HAVE_CPU_OPTIMIZED_PRIMITIVES) && defined(WITH_OPENCL) static BOOL primitives_YUV_benchmark_run(primitives_YUV_benchmark* bench, primitives_t* prims, UINT64 runTime, UINT32* computations) { @@ -196,6 +197,7 @@ static BOOL primitives_YUV_benchmark_run(primitives_YUV_benchmark* bench, primit } return TRUE; } +#endif static BOOL primitives_autodetect_best(primitives_t* prims) { @@ -222,7 +224,11 @@ static BOOL primitives_autodetect_best(primitives_t* prims) #if !defined(HAVE_CPU_OPTIMIZED_PRIMITIVES) || !defined(WITH_OPENCL) { +#if defined(HAVE_CPU_OPTIMIZED_PRIMITIVES) || defined(WITH_OPENCL) + struct prim_benchmark* cur = &testcases[1]; +#else struct prim_benchmark* cur = &testcases[0]; +#endif cur->prims = primitives_get_by_type(cur->flags); if (!cur->prims) {