MCPcopy Create free account
hub / github.com/numpy/numpy / test_implies

Method test_implies

numpy/distutils/tests/test_ccompiler_opt.py:339–378  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

337 )
338
339 def test_implies(self):
340 # baseline combining implied features, so we count
341 # on it instead of testing 'feature_implies()'' directly
342 self.expect_baseline(
343 "fma3 avx2 asimd vsx3",
344 # .* between two spaces can validate features in between
345 x86 = "sse .* sse41 .* fma3.*avx2",
346 ppc64 = "vsx vsx2 vsx3",
347 armhf = "neon neon_fp16 neon_vfpv4 asimd"
348 )
349 """
350 special cases
351 """
352 # in icc and msvc, FMA3 and AVX2 can't be separated
353 # both need to implies each other, same for avx512f & cd
354 for f0, f1 in (
355 ("fma3", "avx2"),
356 ("avx512f", "avx512cd"),
357 ):
358 diff = ".* sse42 .* %s .*%s$" % (f0, f1)
359 self.expect_baseline(f0,
360 x86_gcc=".* sse42 .* %s$" % f0,
361 x86_icc=diff, x86_iccw=diff
362 )
363 self.expect_baseline(f1,
364 x86_gcc=".* avx .* %s$" % f1,
365 x86_icc=diff, x86_iccw=diff
366 )
367 # in msvc, following features can't be separated too
368 for f in (("fma3", "avx2"), ("avx512f", "avx512cd", "avx512_skx")):
369 for ff in f:
370 self.expect_baseline(ff,
371 x86_msvc=".*%s" % ' '.join(f)
372 )
373
374 # in ppc64le VSX and VSX2 can't be separated
375 self.expect_baseline("vsx", ppc64le="vsx vsx2")
376 # in aarch64 following features can't be separated
377 for f in ("neon", "neon_fp16", "neon_vfpv4", "asimd"):
378 self.expect_baseline(f, aarch64="neon neon_fp16 neon_vfpv4 asimd")
379
380 def test_args_options(self):
381 # max & native

Callers

nothing calls this directly

Calls 2

expect_baselineMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected