Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyHMMER
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Larralde
PyHMMER
Commits
915ac0c5
Commit
915ac0c5
authored
8 months ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Implement detection of SSE flush modes in `setup.py`
parent
04a516b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#61933
passed
8 months ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+32
-1
32 additions, 1 deletion
setup.py
with
32 additions
and
1 deletion
setup.py
+
32
−
1
View file @
915ac0c5
...
...
@@ -459,7 +459,7 @@ class configure(_build_clib):
except
CompileError
:
_eprint
(
"
no
"
)
return
False
except
(
subprocess
.
SubprocessError
,
OSError
)
:
except
Exception
:
_eprint
(
"
yes, but cannot run code
"
)
return
True
# assume we are cross-compiling, and still build
else
:
...
...
@@ -519,6 +519,30 @@ class configure(_build_clib):
"""
)
def
_check_denormals_zero_mode
(
self
):
return
self
.
_check_simd_generic
(
"
denormals-are-zero
"
,
program
=
"""
#include <pmmintrin.h>
int main(int argc, const char** argv) {
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
return 0;
}
"""
)
def
_check_flush_zero_mode
(
self
):
return
self
.
_check_simd_generic
(
"
flush-to-zero
"
,
program
=
"""
#include <xmmintrin.h>
int main(int argc, const char** argv) {
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
return 0;
}
"""
)
# --- Required interface for `setuptools.Command` ---
def
build_libraries
(
self
,
libraries
):
...
...
@@ -598,6 +622,13 @@ class configure(_build_clib):
if
not
supported_feature
:
raise
RuntimeError
(
"
failed to compile platform-specific code, aborting.
"
)
# check zeroing mode for SSE code
if
self
.
hmmer_impl
==
"
SSE
"
:
if
self
.
_check_denormals_zero_mode
():
defines
[
"
HAVE_DENORMALS_ZERO_MODE
"
]
=
1
if
self
.
_check_flush_zero_mode
():
defines
[
"
HAVE_FLUSH_ZERO_MODE
"
]
=
1
# fill the defines if headers are found
headers
=
headers
or
[]
for
header
in
headers
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment