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
1f17e08c
Commit
1f17e08c
authored
Mar 15, 2012
by
Peter Eastman
Browse files
Attempting to fix an error caused by the workaround for a Mac AMD bug
parent
94fe05c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
platforms/opencl/src/OpenCLSort.h
platforms/opencl/src/OpenCLSort.h
+1
-0
platforms/opencl/src/kernels/sort.cl
platforms/opencl/src/kernels/sort.cl
+1
-1
No files found.
platforms/opencl/src/OpenCLSort.h
View file @
1f17e08c
...
...
@@ -94,6 +94,7 @@ public:
replacements
[
"MIN_KEY"
]
=
TRAIT
::
clMinKey
();
replacements
[
"MAX_KEY"
]
=
TRAIT
::
clMaxKey
();
replacements
[
"MAX_VALUE"
]
=
TRAIT
::
clMaxValue
();
replacements
[
"VALUE_IS_INT2"
]
=
(
TRAIT
::
clDataType
()
==
"int2"
?
"1"
:
"0"
);
cl
::
Program
program
=
context
.
createProgram
(
context
.
replaceStrings
(
OpenCLKernelSources
::
sort
,
replacements
));
computeRangeKernel
=
cl
::
Kernel
(
program
,
"computeRange"
);
assignElementsKernel
=
cl
::
Kernel
(
program
,
"assignElementsToBuckets"
);
...
...
platforms/opencl/src/kernels/sort.cl
View file @
1f17e08c
...
...
@@ -61,7 +61,7 @@ __kernel void assignElementsToBuckets(__global const DATA_TYPE* restrict data, u
float
maxValue
=
(
float
)
(
range[1]
)
;
float
bucketWidth
=
(
maxValue-minValue
)
/numBuckets
;
for
(
uint
index
=
get_global_id
(
0
)
; index < length; index += get_global_size(0)) {
#
ifdef
MAC_AMD_WORKAROUND
#
if
def
ined
(
MAC_AMD_WORKAROUND
)
&&
VALUE_IS_INT2
__global
int*
d
=
(
__global
int*
)
data
;
int2
element
=
(
int2
)
(
d[2*index],
d[2*index+1]
)
;
float
key
=
(
float
)
getValue
(
element
)
;
...
...
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