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
70ba177d
Commit
70ba177d
authored
Jun 15, 2012
by
Peter Eastman
Browse files
Fixed compilation errors on Windows
parent
86aacbd8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
182 deletions
+186
-182
libraries/hilbert/include/hilbert.h
libraries/hilbert/include/hilbert.h
+173
-169
libraries/hilbert/src/hilbert.cpp
libraries/hilbert/src/hilbert.cpp
+11
-11
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
+1
-1
platforms/reference/tests/TestReferenceCheckpoints.cpp
platforms/reference/tests/TestReferenceCheckpoints.cpp
+1
-1
No files found.
libraries/hilbert/include/hilbert.h
View file @
70ba177d
...
...
@@ -11,12 +11,16 @@ extern "C" {
typedef
unsigned
long
long
bitmask_t
;
/* define the halfmask_t type as an integer of 1/2 the size of bitmask_t */
typedef
unsigned
int
halfmask_t
;
#if defined(OPENMM_BUILDING_SHARED_LIBRARY)
#define WINDOWS_EXPORT __declspec(dllexport)
#endif
#else
#include <stdint.h>
/* define the bitmask_t type as an integer of sufficient size */
typedef
uint64_t
bitmask_t
;
/* define the halfmask_t type as an integer of 1/2 the size of bitmask_t */
typedef
uint32_t
halfmask_t
;
#define WINDOWS_EXPORT
#endif
/*****************************************************************
...
...
@@ -33,7 +37,7 @@ typedef uint32_t halfmask_t;
* nDims*nBits <= (sizeof index) * (bits_per_byte)
*/
void
hilbert_i2c
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
index
,
bitmask_t
coord
[]);
void
WINDOWS_EXPORT
hilbert_i2c
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
index
,
bitmask_t
coord
[]);
/*****************************************************************
* hilbert_c2i
...
...
@@ -49,7 +53,7 @@ void hilbert_i2c(unsigned nDims, unsigned nBits, bitmask_t index, bitmask_t coor
* nDims*nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
bitmask_t
hilbert_c2i
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
const
coord
[]);
bitmask_t
WINDOWS_EXPORT
hilbert_c2i
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
const
coord
[]);
/*****************************************************************
* hilbert_cmp, hilbert_ieee_cmp
...
...
@@ -68,8 +72,8 @@ bitmask_t hilbert_c2i(unsigned nDims, unsigned nBits, bitmask_t const coord[]);
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
int
hilbert_cmp
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
void
const
*
coord1
,
void
const
*
coord2
);
int
hilbert_ieee_cmp
(
unsigned
nDims
,
double
const
*
coord1
,
double
const
*
coord2
);
int
WINDOWS_EXPORT
hilbert_cmp
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
void
const
*
coord1
,
void
const
*
coord2
);
int
WINDOWS_EXPORT
hilbert_ieee_cmp
(
unsigned
nDims
,
double
const
*
coord1
,
double
const
*
coord2
);
/*****************************************************************
* hilbert_box_vtx
...
...
@@ -89,10 +93,10 @@ int hilbert_ieee_cmp(unsigned nDims, double const* coord1, double const* coord2)
* Assumptions:
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
unsigned
unsigned
WINDOWS_EXPORT
hilbert_box_vtx
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findMin
,
void
*
c1
,
void
*
c2
);
unsigned
unsigned
WINDOWS_EXPORT
hilbert_ieee_box_vtx
(
unsigned
nDims
,
int
findMin
,
double
*
c1
,
double
*
c2
);
...
...
@@ -112,10 +116,10 @@ hilbert_ieee_box_vtx(unsigned nDims,
* Assumptions:
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
unsigned
unsigned
WINDOWS_EXPORT
hilbert_box_pt
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findMin
,
void
*
coord1
,
void
*
coord2
);
unsigned
unsigned
WINDOWS_EXPORT
hilbert_ieee_box_pt
(
unsigned
nDims
,
int
findMin
,
double
*
c1
,
double
*
c2
);
...
...
@@ -140,7 +144,7 @@ hilbert_ieee_box_pt(unsigned nDims,
* Assumptions:
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
int
int
WINDOWS_EXPORT
hilbert_nextinbox
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findPrev
,
void
*
coord1
,
void
*
coord2
,
void
const
*
point
);
...
...
@@ -159,7 +163,7 @@ hilbert_nextinbox(unsigned nDims, unsigned nBytes, unsigned nBits,
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
void
void
WINDOWS_EXPORT
hilbert_incr
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
coord
[]);
#ifdef __cplusplus
...
...
libraries/hilbert/src/hilbert.cpp
View file @
70ba177d
...
...
@@ -135,7 +135,7 @@ bitTranspose(unsigned nDims, unsigned nBits, bitmask_t inCoords)
* Assumptions:
* nDims*nBits <= (sizeof index) * (bits_per_byte)
*/
void
void
WINDOWS_EXPORT
hilbert_i2c
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
index
,
bitmask_t
coord
[])
{
if
(
nDims
>
1
)
...
...
@@ -193,7 +193,7 @@ hilbert_i2c(unsigned nDims, unsigned nBits, bitmask_t index, bitmask_t coord[])
* Assumptions:
* nDims*nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
bitmask_t
bitmask_t
WINDOWS_EXPORT
hilbert_c2i
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
const
coord
[])
{
if
(
nDims
>
1
)
...
...
@@ -562,7 +562,7 @@ hilbert_cmp_work(unsigned nDims, unsigned nBytes, unsigned nBits,
return
0
;
}
int
int
WINDOWS_EXPORT
hilbert_cmp
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
void
const
*
c1
,
void
const
*
c2
)
{
...
...
@@ -573,7 +573,7 @@ hilbert_cmp(unsigned nDims, unsigned nBytes, unsigned nBits,
0
,
bits
,
bits
,
getIntBits
);
}
int
int
WINDOWS_EXPORT
hilbert_ieee_cmp
(
unsigned
nDims
,
double
const
*
c1
,
double
const
*
c2
)
{
unsigned
rotation
,
max
;
...
...
@@ -673,7 +673,7 @@ hilbert_box_vtx_work(unsigned nDims, unsigned nBytes, unsigned nBits,
return
y
;
}
unsigned
unsigned
WINDOWS_EXPORT
hilbert_box_vtx
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findMin
,
void
*
c1
,
void
*
c2
)
{
...
...
@@ -684,7 +684,7 @@ hilbert_box_vtx(unsigned nDims, unsigned nBytes, unsigned nBits,
0
,
bits
,
bits
,
getIntBits
);
}
unsigned
unsigned
WINDOWS_EXPORT
hilbert_ieee_box_vtx
(
unsigned
nDims
,
int
findMin
,
double
*
c1
,
double
*
c2
)
{
...
...
@@ -722,7 +722,7 @@ hilbert_ieee_box_vtx(unsigned nDims,
* Assumptions:
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
unsigned
unsigned
WINDOWS_EXPORT
hilbert_box_pt_work
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findMin
,
unsigned
max
,
unsigned
y
,
...
...
@@ -783,7 +783,7 @@ hilbert_box_pt_work(unsigned nDims, unsigned nBytes, unsigned nBits,
return
smearSum
;
}
unsigned
unsigned
WINDOWS_EXPORT
hilbert_box_pt
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findMin
,
void
*
c1
,
void
*
c2
)
{
...
...
@@ -795,7 +795,7 @@ hilbert_box_pt(unsigned nDims, unsigned nBytes, unsigned nBits,
getIntBits
,
propogateIntBits
);
}
unsigned
unsigned
WINDOWS_EXPORT
hilbert_ieee_box_pt
(
unsigned
nDims
,
int
findMin
,
double
*
c1
,
double
*
c2
)
{
...
...
@@ -851,7 +851,7 @@ hilbert_ieee_box_pt(unsigned nDims,
* Assumptions:
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
int
int
WINDOWS_EXPORT
hilbert_nextinbox
(
unsigned
nDims
,
unsigned
nBytes
,
unsigned
nBits
,
int
findPrev
,
void
*
c1V
,
void
*
c2V
,
void
const
*
ptV
)
{
...
...
@@ -1045,7 +1045,7 @@ hilbert_nextinbox(unsigned nDims, unsigned nBytes, unsigned nBits,
* nBits <= (sizeof bitmask_t) * (bits_per_byte)
*/
void
void
WINDOWS_EXPORT
hilbert_incr
(
unsigned
nDims
,
unsigned
nBits
,
bitmask_t
coord
[])
{
bitmask_t
const
one
=
1
;
...
...
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
View file @
70ba177d
...
...
@@ -63,7 +63,7 @@ void compareStates(State& s1, State& s2) {
ASSERT_EQUAL_VEC
(
b1
,
b2
,
TOL
);
ASSERT_EQUAL_VEC
(
c1
,
c2
,
TOL
);
for
(
map
<
string
,
double
>::
const_iterator
iter
=
s1
.
getParameters
().
begin
();
iter
!=
s1
.
getParameters
().
end
();
++
iter
)
ASSERT_EQUAL
(
iter
->
second
,
s2
.
getParameters
().
at
(
iter
->
first
));
ASSERT_EQUAL
(
iter
->
second
,
(
*
s2
.
getParameters
().
find
(
iter
->
first
))
.
second
)
;
}
}
...
...
platforms/reference/tests/TestReferenceCheckpoints.cpp
View file @
70ba177d
...
...
@@ -63,7 +63,7 @@ void compareStates(State& s1, State& s2) {
ASSERT_EQUAL_VEC
(
b1
,
b2
,
TOL
);
ASSERT_EQUAL_VEC
(
c1
,
c2
,
TOL
);
for
(
map
<
string
,
double
>::
const_iterator
iter
=
s1
.
getParameters
().
begin
();
iter
!=
s1
.
getParameters
().
end
();
++
iter
)
ASSERT_EQUAL
(
iter
->
second
,
s2
.
getParameters
().
at
(
iter
->
first
));
ASSERT_EQUAL
(
iter
->
second
,
(
*
s2
.
getParameters
().
find
(
iter
->
first
))
.
second
)
;
}
}
...
...
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