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
080691d3
"platforms/hip/src/HipParallelKernels.cpp" did not exist on "dd352ee536a429bfccd4aeda5258adafba8e0d84"
Commit
080691d3
authored
Jul 24, 2014
by
peastman
Browse files
Consolidated logic for determining if vector instructions are supported
parent
35041ae1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
30 deletions
+25
-30
openmmapi/include/openmm/internal/vectorize_neon.h
openmmapi/include/openmm/internal/vectorize_neon.h
+8
-0
openmmapi/include/openmm/internal/vectorize_sse.h
openmmapi/include/openmm/internal/vectorize_sse.h
+14
-1
platforms/cpu/src/CpuPlatform.cpp
platforms/cpu/src/CpuPlatform.cpp
+2
-15
plugins/cpupme/src/CpuPmeKernels.cpp
plugins/cpupme/src/CpuPmeKernels.cpp
+1
-14
No files found.
openmmapi/include/openmm/internal/vectorize_neon.h
View file @
080691d3
...
@@ -40,6 +40,14 @@ typedef int int32_t;
...
@@ -40,6 +40,14 @@ typedef int int32_t;
// This file defines classes and functions to simplify vectorizing code with NEON.
// This file defines classes and functions to simplify vectorizing code with NEON.
/**
* Determine whether ivec4 and fvec4 are supported on this processor.
*/
static
bool
isVec4Supported
()
{
uint64_t
features
=
android_getCpuFeatures
();
return
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
}
class
ivec4
;
class
ivec4
;
/**
/**
...
...
openmmapi/include/openmm/internal/vectorize_sse.h
View file @
080691d3
...
@@ -33,10 +33,23 @@
...
@@ -33,10 +33,23 @@
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include <smmintrin.h>
#include <smmintrin.h>
#include "hardware.h"
// This file defines classes and functions to simplify vectorizing code with SSE.
// This file defines classes and functions to simplify vectorizing code with SSE.
/**
* Determine whether ivec4 and fvec4 are supported on this processor.
*/
static
bool
isVec4Supported
()
{
int
cpuInfo
[
4
];
cpuid
(
cpuInfo
,
0
);
if
(
cpuInfo
[
0
]
>=
1
)
{
cpuid
(
cpuInfo
,
1
);
return
((
cpuInfo
[
2
]
&
((
int
)
1
<<
19
))
!=
0
);
}
return
false
;
}
class
ivec4
;
class
ivec4
;
/**
/**
...
...
platforms/cpu/src/CpuPlatform.cpp
View file @
080691d3
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include "CpuKernels.h"
#include "CpuKernels.h"
#include "CpuSETTLE.h"
#include "CpuSETTLE.h"
#include "ReferenceConstraints.h"
#include "ReferenceConstraints.h"
#include "openmm/internal/
hardwar
e.h"
#include "openmm/internal/
vectoriz
e.h"
#include <sstream>
#include <sstream>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -94,20 +94,7 @@ bool CpuPlatform::supportsDoublePrecision() const {
...
@@ -94,20 +94,7 @@ bool CpuPlatform::supportsDoublePrecision() const {
}
}
bool
CpuPlatform
::
isProcessorSupported
()
{
bool
CpuPlatform
::
isProcessorSupported
()
{
// Make sure the CPU supports SSE 4.1 or NEON.
return
isVec4Supported
();
#ifdef __ANDROID__
uint64_t
features
=
android_getCpuFeatures
();
return
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
#else
int
cpuInfo
[
4
];
cpuid
(
cpuInfo
,
0
);
if
(
cpuInfo
[
0
]
>=
1
)
{
cpuid
(
cpuInfo
,
1
);
return
((
cpuInfo
[
2
]
&
((
int
)
1
<<
19
))
!=
0
);
}
return
false
;
#endif
}
}
void
CpuPlatform
::
contextCreated
(
ContextImpl
&
context
,
const
map
<
string
,
string
>&
properties
)
const
{
void
CpuPlatform
::
contextCreated
(
ContextImpl
&
context
,
const
map
<
string
,
string
>&
properties
)
const
{
...
...
plugins/cpupme/src/CpuPmeKernels.cpp
View file @
080691d3
...
@@ -569,20 +569,7 @@ double CpuCalcPmeReciprocalForceKernel::finishComputation(IO& io) {
...
@@ -569,20 +569,7 @@ double CpuCalcPmeReciprocalForceKernel::finishComputation(IO& io) {
}
}
bool
CpuCalcPmeReciprocalForceKernel
::
isProcessorSupported
()
{
bool
CpuCalcPmeReciprocalForceKernel
::
isProcessorSupported
()
{
// Make sure the CPU supports SSE 4.1 or NEON.
return
isVec4Supported
();
#ifdef __ANDROID__
uint64_t
features
=
android_getCpuFeatures
();
return
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
#else
int
cpuInfo
[
4
];
cpuid
(
cpuInfo
,
0
);
if
(
cpuInfo
[
0
]
>=
1
)
{
cpuid
(
cpuInfo
,
1
);
return
((
cpuInfo
[
2
]
&
((
int
)
1
<<
19
))
!=
0
);
}
return
false
;
#endif
}
}
int
CpuCalcPmeReciprocalForceKernel
::
findFFTDimension
(
int
minimum
)
{
int
CpuCalcPmeReciprocalForceKernel
::
findFFTDimension
(
int
minimum
)
{
...
...
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