[clfft] 10/23: minor fixes to event handling from previous checkin

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Aug 18 16:08:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository clfft.

commit cf1640316ae5afdde81d48af71e985ad08239ec6
Author: bnataraj <bragadeesh.natarajan at amd.com>
Date:   Thu Aug 6 15:04:04 2015 -0500

    minor fixes to event handling from previous checkin
---
 src/client/client.cpp                  | 6 +++++-
 src/statTimer/statisticalTimer.GPU.cpp | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/client/client.cpp b/src/client/client.cpp
index 1dfb5ed..1680822 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -521,6 +521,7 @@ int transform( size_t* lengths, const size_t *inStrides, const size_t *outStride
 
 	for( cl_uint i = 0; i < profile_count; ++i )
 	{
+		outEvent[i] = 0;
 		if( timer ) timer->Start( clFFTID );
 
 		OPENCL_V_THROW( clfftEnqueueTransform( plan_handle, dir, 1, &queue, 0, NULL, &outEvent[i],
@@ -555,7 +556,10 @@ int transform( size_t* lengths, const size_t *inStrides, const size_t *outStride
 	FreeSharedLibrary( timerLibHandle );
 
 	for( cl_uint i = 0; i < profile_count; ++i )
-		clReleaseEvent(outEvent[i]);
+	{
+		if(outEvent[i])
+			clReleaseEvent(outEvent[i]);
+	}
 
 	delete[] outEvent;
 
diff --git a/src/statTimer/statisticalTimer.GPU.cpp b/src/statTimer/statisticalTimer.GPU.cpp
index bdd3bd4..31fe146 100644
--- a/src/statTimer/statisticalTimer.GPU.cpp
+++ b/src/statTimer/statisticalTimer.GPU.cpp
@@ -204,7 +204,7 @@ void
 GpuStatTimer::AddSample( clfftPlanHandle plHandle, FFTPlan* plan, cl_kernel kern, cl_uint numEvents, cl_event* ev,
 	const std::vector< size_t >& gWorkSize )
 {
-	if(ev == NULL)
+	if( (numEvents != 0) && (ev == NULL) )
 		return;
 
 	if( timerData.empty( ) )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clfft.git



More information about the debian-science-commits mailing list