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
803fe433
Commit
803fe433
authored
Apr 08, 2015
by
peastman
Browse files
Very minor optimization to FFT
parent
777f732b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
platforms/opencl/src/kernels/fftR2C.cl
platforms/opencl/src/kernels/fftR2C.cl
+9
-9
No files found.
platforms/opencl/src/kernels/fftR2C.cl
View file @
803fe433
...
@@ -45,9 +45,9 @@ __kernel void unpackForwardData(__global const real2* restrict in, __global real
...
@@ -45,9 +45,9 @@ __kernel void unpackForwardData(__global const real2* restrict in, __global real
int
remainder
=
index-x*
(
PACKED_YSIZE*PACKED_ZSIZE
)
;
int
remainder
=
index-x*
(
PACKED_YSIZE*PACKED_ZSIZE
)
;
int
y
=
remainder/PACKED_ZSIZE
;
int
y
=
remainder/PACKED_ZSIZE
;
int
z
=
remainder-y*PACKED_ZSIZE
;
int
z
=
remainder-y*PACKED_ZSIZE
;
int
xp
=
(
x
==
0
?
x
:
PACKED_XSIZE-x
)
;
int
xp
=
(
x
==
0
?
0
:
PACKED_XSIZE-x
)
;
int
yp
=
(
y
==
0
?
y
:
PACKED_YSIZE-y
)
;
int
yp
=
(
y
==
0
?
0
:
PACKED_YSIZE-y
)
;
int
zp
=
(
z
==
0
?
z
:
PACKED_ZSIZE-z
)
;
int
zp
=
(
z
==
0
?
0
:
PACKED_ZSIZE-z
)
;
real2
z1
=
in[x*PACKED_YSIZE*PACKED_ZSIZE+y*PACKED_ZSIZE+z]
;
real2
z1
=
in[x*PACKED_YSIZE*PACKED_ZSIZE+y*PACKED_ZSIZE+z]
;
real2
z2
=
in[xp*PACKED_YSIZE*PACKED_ZSIZE+yp*PACKED_ZSIZE+zp]
;
real2
z2
=
in[xp*PACKED_YSIZE*PACKED_ZSIZE+yp*PACKED_ZSIZE+zp]
;
#
if
PACKED_AXIS
==
0
#
if
PACKED_AXIS
==
0
...
@@ -59,9 +59,9 @@ __kernel void unpackForwardData(__global const real2* restrict in, __global real
...
@@ -59,9 +59,9 @@ __kernel void unpackForwardData(__global const real2* restrict in, __global real
#
endif
#
endif
real2
output
=
(
real2
)
((
z1.x+z2.x
-
wfac.x*
(
z1.x-z2.x
)
+
wfac.y*
(
z1.y+z2.y
))
/2,
(
z1.y-z2.y
-
wfac.y*
(
z1.x-z2.x
)
-
wfac.x*
(
z1.y+z2.y
))
/2
)
;
real2
output
=
(
real2
)
((
z1.x+z2.x
-
wfac.x*
(
z1.x-z2.x
)
+
wfac.y*
(
z1.y+z2.y
))
/2,
(
z1.y-z2.y
-
wfac.y*
(
z1.x-z2.x
)
-
wfac.x*
(
z1.y+z2.y
))
/2
)
;
out[x*YSIZE*ZSIZE+y*ZSIZE+z]
=
output
;
out[x*YSIZE*ZSIZE+y*ZSIZE+z]
=
output
;
xp
=
(
x
==
0
?
x
:
XSIZE-x
)
;
xp
=
(
x
==
0
?
0
:
XSIZE-x
)
;
yp
=
(
y
==
0
?
y
:
YSIZE-y
)
;
yp
=
(
y
==
0
?
0
:
YSIZE-y
)
;
zp
=
(
z
==
0
?
z
:
ZSIZE-z
)
;
zp
=
(
z
==
0
?
0
:
ZSIZE-z
)
;
#
if
PACKED_AXIS
==
0
#
if
PACKED_AXIS
==
0
if
(
x
==
0
)
if
(
x
==
0
)
out[PACKED_XSIZE*YSIZE*ZSIZE+yp*ZSIZE+zp]
=
(
real2
)
((
z1.x-z1.y+z2.x-z2.y
)
/2,
(
-z1.x-z1.y+z2.x+z2.y
)
/2
)
;
out[PACKED_XSIZE*YSIZE*ZSIZE+yp*ZSIZE+zp]
=
(
real2
)
((
z1.x-z1.y+z2.x-z2.y
)
/2,
(
-z1.x-z1.y+z2.x+z2.y
)
/2
)
;
...
@@ -103,9 +103,9 @@ __kernel void packBackwardData(__global const real2* restrict in, __global real2
...
@@ -103,9 +103,9 @@ __kernel void packBackwardData(__global const real2* restrict in, __global real2
int
remainder
=
index-x*
(
PACKED_YSIZE*PACKED_ZSIZE
)
;
int
remainder
=
index-x*
(
PACKED_YSIZE*PACKED_ZSIZE
)
;
int
y
=
remainder/PACKED_ZSIZE
;
int
y
=
remainder/PACKED_ZSIZE
;
int
z
=
remainder-y*PACKED_ZSIZE
;
int
z
=
remainder-y*PACKED_ZSIZE
;
int
xp
=
(
x
==
0
?
x
:
PACKED_XSIZE-x
)
;
int
xp
=
(
x
==
0
?
0
:
PACKED_XSIZE-x
)
;
int
yp
=
(
y
==
0
?
y
:
PACKED_YSIZE-y
)
;
int
yp
=
(
y
==
0
?
0
:
PACKED_YSIZE-y
)
;
int
zp
=
(
z
==
0
?
z
:
PACKED_ZSIZE-z
)
;
int
zp
=
(
z
==
0
?
0
:
PACKED_ZSIZE-z
)
;
real2
z1
=
in[x*YSIZE*ZSIZE+y*ZSIZE+z]
;
real2
z1
=
in[x*YSIZE*ZSIZE+y*ZSIZE+z]
;
#
if
PACKED_AXIS
==
0
#
if
PACKED_AXIS
==
0
real2
wfac
=
w[x]
;
real2
wfac
=
w[x]
;
...
...
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