History

Add checks for cpu features in tests

This allows running the tests on devices that don't have all the SIMD instruction sets.

Martin Storsjö committed 11 years ago

Commit acafbb41 parent 7f967f63 files · +97 −73Browse files

Showing the changes to test/processing/ProcessUT_AdaptiveQuantization.cpp (1 of 3 files). Show all

Unified · Split

test/processing/ProcessUT_AdaptiveQuantization.cpp+8−5
@@ -42,8 +42,11 @@ void SampleVariance16x16_ref (uint8_t* pRefY, int32_t iRefStride, uint8_t* pSrcY · 41 unmodified lines
4242 pMotionTexture->uiTextureIndex = (uiCurSquare >> 8) - (uiCurSum * uiCurSum);
4343 }
4444
45−#define GENERATE_AQTEST(method) \
45+#define GENERATE_AQTEST(method, flag) \
4646 TEST (AdaptiveQuantization, method) {\
47+ uint32_t uiCPUFlags = WelsCPUFeatureDetect(NULL); \
48+ if ((uiCPUFlags & flag) == 0 && flag != 0) \
49+ return; \
4750 ENFORCE_STACK_ALIGN_1D (uint8_t, pRefY,32*16,16)\
4851 ENFORCE_STACK_ALIGN_1D (uint8_t, pSrcY,48*16,16)\
4952 SMotionTextureUnit pMotionTexture[2];\
@@ -61,16 +64,16 @@ TEST (AdaptiveQuantization, method) {\ · 11 unmodified lines
6164 ASSERT_EQ(pMotionTexture[0].uiMotionIndex,pMotionTexture[1].uiMotionIndex);\
6265 }
6366
64−GENERATE_AQTEST (SampleVariance16x16_c)
67+GENERATE_AQTEST (SampleVariance16x16_c, 0)
6568 #if defined(X86_ASM)
66−GENERATE_AQTEST (SampleVariance16x16_sse2)
69+GENERATE_AQTEST (SampleVariance16x16_sse2, WELS_CPU_SSE2)
6770 #endif
6871
6972 #if defined(HAVE_NEON)
70−GENERATE_AQTEST (SampleVariance16x16_neon)
73+GENERATE_AQTEST (SampleVariance16x16_neon, WELS_CPU_NEON)
7174 #endif
7275
7376 #if defined(HAVE_NEON_AARCH64)
74−GENERATE_AQTEST (SampleVariance16x16_AArch64_neon)
77+GENERATE_AQTEST (SampleVariance16x16_AArch64_neon, WELS_CPU_NEON)
7578 #endif
7679

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t