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
e69b1cca
Commit
e69b1cca
authored
Aug 26, 2011
by
Peter Eastman
Browse files
Added callback function to print out internal OpenCL errors
parent
f6aef43a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+5
-1
No files found.
platforms/opencl/src/OpenCLContext.cpp
View file @
e69b1cca
...
...
@@ -55,6 +55,10 @@ using namespace std;
const
int
OpenCLContext
::
ThreadBlockSize
=
64
;
const
int
OpenCLContext
::
TileSize
=
32
;
static
void
errorCallback
(
const
char
*
errinfo
,
const
void
*
private_info
,
size_t
cb
,
void
*
user_data
)
{
std
::
cerr
<<
"OpenCL internal error: "
<<
errinfo
<<
std
::
endl
;
}
OpenCLContext
::
OpenCLContext
(
int
numParticles
,
int
deviceIndex
,
OpenCLPlatform
::
PlatformData
&
platformData
)
:
time
(
0.0
),
platformData
(
platformData
),
stepCount
(
0
),
computeForceCount
(
0
),
posq
(
NULL
),
velm
(
NULL
),
forceBuffers
(
NULL
),
energyBuffer
(
NULL
),
atomIndex
(
NULL
),
integration
(
NULL
),
nonbonded
(
NULL
),
thread
(
NULL
)
{
...
...
@@ -63,7 +67,7 @@ OpenCLContext::OpenCLContext(int numParticles, int deviceIndex, OpenCLPlatform::
std
::
vector
<
cl
::
Platform
>
platforms
;
cl
::
Platform
::
get
(
&
platforms
);
cl_context_properties
cprops
[]
=
{
CL_CONTEXT_PLATFORM
,
(
cl_context_properties
)
platforms
[
0
](),
0
};
context
=
cl
::
Context
(
CL_DEVICE_TYPE_ALL
,
cprops
);
context
=
cl
::
Context
(
CL_DEVICE_TYPE_ALL
,
cprops
,
errorCallback
);
vector
<
cl
::
Device
>
devices
=
context
.
getInfo
<
CL_CONTEXT_DEVICES
>
();
const
int
minThreadBlockSize
=
32
;
if
(
deviceIndex
<
0
||
deviceIndex
>=
(
int
)
devices
.
size
())
{
...
...
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