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
d72de0c7
"wrappers/python/simtk/vscode:/vscode.git/clone" did not exist on "c3c84a28ef384ec3d7ef8fb37d870e81771ebc96"
Unverified
Commit
d72de0c7
authored
Apr 01, 2020
by
peastman
Committed by
GitHub
Apr 01, 2020
Browse files
Merge pull request #2619 from mark-mb/master
ARM64 support
parents
6fcb3b29
29290598
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
13 deletions
+51
-13
CMakeLists.txt
CMakeLists.txt
+5
-1
cmake_modules/TargetArch.cmake
cmake_modules/TargetArch.cmake
+28
-8
libraries/vecmath/src/vecmath.cpp
libraries/vecmath/src/vecmath.cpp
+1
-1
openmmapi/include/openmm/internal/hardware.h
openmmapi/include/openmm/internal/hardware.h
+2
-1
openmmapi/include/openmm/internal/vectorize.h
openmmapi/include/openmm/internal/vectorize.h
+2
-2
openmmapi/include/openmm/internal/vectorize_neon.h
openmmapi/include/openmm/internal/vectorize_neon.h
+13
-0
No files found.
CMakeLists.txt
View file @
d72de0c7
...
@@ -41,7 +41,11 @@ if ("${TARGET_ARCH}" MATCHES "x86_64|i386")
...
@@ -41,7 +41,11 @@ if ("${TARGET_ARCH}" MATCHES "x86_64|i386")
endif
()
endif
()
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"arm"
)
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"arm"
)
set
(
ARM ON
)
set
(
ARM ON
)
add_compile_definitions
(
__ARM__=1
)
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"armv8"
)
add_compile_definitions
(
__ARM64__=1
)
else
()
add_compile_definitions
(
__ARM__=1
)
endif
()
endif
()
endif
()
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"ppc"
)
if
(
"
${
TARGET_ARCH
}
"
MATCHES
"ppc"
)
set
(
PPC ON
)
set
(
PPC ON
)
...
...
cmake_modules/TargetArch.cmake
View file @
d72de0c7
...
@@ -24,19 +24,40 @@
...
@@ -24,19 +24,40 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# OF THE POSSIBILITY OF SUCH DAMAGE.
# Based on the Qt 5 processor detection code, so should be very accurate
# Based on the Qt 5 processor detection code, so should be very accurate
# https://
qt.gitorious.org
/qt/qtbase/blob
s/master
/src/corelib/global/qprocessordetection.h
# https://
github.com
/qt/qtbase/blob
/9a6a847
/src/corelib/global/qprocessordetection.h
# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64)
# Currently handles arm
/ aarch64
(v5, v6, v7
, v8
), x86 (32/64), ia64, and ppc (32/64)
# Regarding POWER/PowerPC, just as is noted in the Qt source,
# Regarding POWER/PowerPC, just as is noted in the Qt source,
# "There are many more known variants/revisions that we do not handle/detect."
# "There are many more known variants/revisions that we do not handle/detect."
set
(
archdetect_c_code
"
set
(
archdetect_c_code
"
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#define _STR(x) #x
#if defined(__ARM_ARCH_7__)
\\
#define STR(x) _STR(x)
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) ||
\\
defined(_M_ARM64) || defined(__aarch64__) || defined(__ARM64__)
#if defined(__ARM_ARCH) && __ARM_ARCH > 1
#pragma message
\"
cmake_ARCH armv
\"
STR(__ARM_ARCH)
#error
#elif defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM > 1
#pragma message
\"
cmake_ARCH armv
\"
STR(__TARGET_ARCH_ARM)
#error
#elif defined(_M_ARM) && _M_ARM > 1
#error cmake_ARCH arm ## __M_ARM
#elif defined(__ARM64_ARCH_8__)
\\
|| defined(__aarch64__)
\\
|| defined(__ARMv8__)
\\
|| defined(__ARMv8_A__)
\\
|| defined(_M_ARM64)
#error cmake_ARCH armv8
#elif defined(__ARM_ARCH_7__)
\\
|| defined(__ARM_ARCH_7A__)
\\
|| defined(__ARM_ARCH_7A__)
\\
|| defined(__ARM_ARCH_7R__)
\\
|| defined(__ARM_ARCH_7R__)
\\
|| defined(__ARM_ARCH_7M__)
\\
|| defined(__ARM_ARCH_7M__)
\\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
|| defined(__ARM_ARCH_7S__)
\\
|| defined(_ARM_ARCH_7)
\\
|| defined(__CORE_CORTEXA__)
#error cmake_ARCH armv7
#error cmake_ARCH armv7
#elif defined(__ARM_ARCH_6__)
\\
#elif defined(__ARM_ARCH_6__)
\\
|| defined(__ARM_ARCH_6J__)
\\
|| defined(__ARM_ARCH_6J__)
\\
...
@@ -44,11 +65,10 @@ set(archdetect_c_code "
...
@@ -44,11 +65,10 @@ set(archdetect_c_code "
|| defined(__ARM_ARCH_6Z__)
\\
|| defined(__ARM_ARCH_6Z__)
\\
|| defined(__ARM_ARCH_6K__)
\\
|| defined(__ARM_ARCH_6K__)
\\
|| defined(__ARM_ARCH_6ZK__)
\\
|| defined(__ARM_ARCH_6ZK__)
\\
|| defined(__ARM_ARCH_6M__)
\\
|| defined(__ARM_ARCH_6M__)
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
#error cmake_ARCH armv6
#error cmake_ARCH armv6
#elif defined(__ARM_ARCH_5TEJ__)
\\
#elif defined(__ARM_ARCH_5TEJ__)
\\
||
(
defined(__
T
AR
GET
_ARCH_
ARM) && __TARGET_ARCH_ARM-0 >= 5
)
|| defined(__AR
M
_ARCH_
5TE__
)
#error cmake_ARCH armv5
#error cmake_ARCH armv5
#else
#else
#error cmake_ARCH arm
#error cmake_ARCH arm
...
...
libraries/vecmath/src/vecmath.cpp
View file @
d72de0c7
#if defined(__A
NDROID
__)
#if defined(__A
RM__) || defined(__ARM64
__)
#include "neon_mathfun.h"
#include "neon_mathfun.h"
#else
#else
#if !defined(__PNACL__)
#if !defined(__PNACL__)
...
...
openmmapi/include/openmm/internal/hardware.h
View file @
d72de0c7
...
@@ -93,7 +93,8 @@ static int getNumProcessors() {
...
@@ -93,7 +93,8 @@ static int getNumProcessors() {
#ifdef WIN32
#ifdef WIN32
#define cpuid __cpuid
#define cpuid __cpuid
#else
#else
#if !defined(__ANDROID__) && !defined(__PNACL__) && !defined(__PPC__)
#if !defined(__ANDROID__) && !defined(__PNACL__) && !defined(__PPC__) \
&& !defined(__ARM__) && !defined(__ARM64__)
static
void
cpuid
(
int
cpuInfo
[
4
],
int
infoType
){
static
void
cpuid
(
int
cpuInfo
[
4
],
int
infoType
){
#ifdef __LP64__
#ifdef __LP64__
__asm__
__volatile__
(
__asm__
__volatile__
(
...
...
openmmapi/include/openmm/internal/vectorize.h
View file @
d72de0c7
...
@@ -31,8 +31,8 @@
...
@@ -31,8 +31,8 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#if defined(__ARM__)
#if defined(__ARM__)
|| defined(__ARM64__)
#include "vectorize_neon.h"
#include "vectorize_neon.h"
#elif defined(__PPC__)
#elif defined(__PPC__)
#include "vectorize_ppc.h"
#include "vectorize_ppc.h"
...
...
openmmapi/include/openmm/internal/vectorize_neon.h
View file @
d72de0c7
...
@@ -32,7 +32,12 @@
...
@@ -32,7 +32,12 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#ifdef __ANDROID__
#include <cpu-features.h>
#include <cpu-features.h>
#else
#include <sys/auxv.h>
#include <asm/hwcap.h>
#endif
#include <arm_neon.h>
#include <arm_neon.h>
#include <cmath>
#include <cmath>
...
@@ -48,8 +53,16 @@ float32x4_t log_ps(float32x4_t);
...
@@ -48,8 +53,16 @@ float32x4_t log_ps(float32x4_t);
* Determine whether ivec4 and fvec4 are supported on this processor.
* Determine whether ivec4 and fvec4 are supported on this processor.
*/
*/
static
bool
isVec4Supported
()
{
static
bool
isVec4Supported
()
{
#ifdef __ANDROID__
uint64_t
features
=
android_getCpuFeatures
();
uint64_t
features
=
android_getCpuFeatures
();
return
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
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
;
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