Fix avx_support; only run check_intrinsics for conda build test
This commit is contained in:
parent
43095609c3
commit
4ed8f80774
3 changed files with 15 additions and 5 deletions
|
|
@ -4,6 +4,8 @@ import llvm
|
|||
|
||||
from llvm.core import Module
|
||||
from llvm.ee import EngineBuilder
|
||||
from llvm.utils import check_intrinsics
|
||||
|
||||
m = Module.new('fjoidajfa')
|
||||
eb = EngineBuilder.new(m)
|
||||
target = eb.select_target()
|
||||
|
|
@ -14,6 +16,7 @@ if sys.platform == 'darwin':
|
|||
assert target.triple.startswith(s + '-apple-darwin')
|
||||
|
||||
assert llvm.test(verbosity=2) == 0
|
||||
assert check_intrinsics.main()
|
||||
|
||||
print('llvm.__version__: %s' % llvm.__version__)
|
||||
#assert llvm.__version__ == '0.12.0'
|
||||
|
|
|
|||
|
|
@ -44,8 +44,4 @@ def test(verbosity=3):
|
|||
result = run(verbosity=verbosity)
|
||||
errct = len(result.failures) + len(result.errors)
|
||||
|
||||
# Dump some intrinsic usage result with MCJIT.
|
||||
from llvm.utils import check_intrinsics
|
||||
check_intrinsics.main()
|
||||
|
||||
return errct
|
||||
|
|
|
|||
|
|
@ -49,6 +49,17 @@ def detect_unix_like():
|
|||
return True
|
||||
return False
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _close_popen(popen):
|
||||
if sys.version_info[0] >= 3:
|
||||
with popen:
|
||||
yield
|
||||
else:
|
||||
yield
|
||||
popen.stdout.close()
|
||||
|
||||
|
||||
def detect_osx_like():
|
||||
try:
|
||||
info = subprocess.Popen(['sysctl', '-n', 'machdep.cpu.features'],
|
||||
|
|
@ -56,7 +67,7 @@ def detect_osx_like():
|
|||
except OSError:
|
||||
return False
|
||||
|
||||
with info:
|
||||
with _close_popen(info):
|
||||
features = info.stdout.read().decode('UTF8')
|
||||
features = features.split()
|
||||
return 'AVX1.0' in features and 'OSXSAVE' in features and 'XSAVE' in features
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue