On 11/23/2010 06:54 AM, Andreas Kloeckner wrote:
Hi Andreas,
On Tue, 23 Nov 2010 02:20:49 +0100, Andreas<[email protected]> wrote:
I'm trying to profile some PyOpenCL scripts using NVIDIA's Compute
Visual Profiler. However, I always receive an error suggesting I might
not have released some resources properly.
[ 3 more citation lines. Click/Enter to toggle visibility. ]
Some people at NVIDIA's OpenCL forum have run into the same error and
reported that including clReleaseEvent(event-name) at the end of their
code solved the problem.
I can't find a binding for this function in the PyOpenCL documentation,
and I'm curious if this feature is implemented or if anyone could send
me a script that currently works for their profiler.
Events (and most other things) are cleaned up automatically by the
garbage collector--there shouldn't be any left behind. There is (by
design!) no way to release events while they're still being referenced.
If you want to check whether PyOpenCL did all the cleanup properly, just
enable CL_TRACE=1 in siteconf.py, do 'rm -Rf build' and then reinstall.
I have included a condensed version of my code plus a file that can be
used to run the script through the profiler (the script was made to
investigate how strided access of global memory affects memory bandwidth).
I can't reproduce this at this point, in a large part because I'm
currently using Nvidia's CL 1.1 conformance candidate. In addition, the
command line profiler (used by setting {CL_,COMPUTE_}PROFILE=1) works
like a charm on your code.
Hope this helps at least a bit,
Andreas
Hi Andreas,
thanks for the clarification. The command line profiler works neatly,
and I managed to get the Visual Profiler to work as well by explicitly
telling the bash file to export the environment variables
{CL_,COMPUTE}PROFILE=1.
The final bash file:
#!/bin/bash
export {CL_,COMPUTE_}PROFILE=1
python global_access_strided.py
Regards
Andreas
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl