Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
29290598
Commit
29290598
authored
Mar 28, 2020
by
Marc Marí
Browse files
Add check for Neon support
parent
d816abea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
openmmapi/include/openmm/internal/vectorize_neon.h
openmmapi/include/openmm/internal/vectorize_neon.h
+13
-0
No files found.
openmmapi/include/openmm/internal/vectorize_neon.h
View file @
29290598
...
...
@@ -32,7 +32,12 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#ifdef __ANDROID__
#include <cpu-features.h>
#else
#include <sys/auxv.h>
#include <asm/hwcap.h>
#endif
#include <arm_neon.h>
#include <cmath>
...
...
@@ -48,8 +53,16 @@ float32x4_t log_ps(float32x4_t);
* Determine whether ivec4 and fvec4 are supported on this processor.
*/
static
bool
isVec4Supported
()
{
#ifdef __ANDROID__
uint64_t
features
=
android_getCpuFeatures
();
return
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
#elif defined(__ARM__)
unsigned
long
features
=
getauxval
(
AT_HWCAP
);
return
(
features
&
HWCAP_NEON
)
!=
0
;
#else
unsigned
long
features
=
getauxval
(
AT_HWCAP
);
return
(
features
&
HWCAP_ASIMD
)
!=
0
;
#endif
}
class
ivec4
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment