[clfft] 85/107: fixing logic to allocate C2R temp buffer once

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 30 18:06:39 UTC 2015


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

ghisvail-guest pushed a commit to branch master
in repository clfft.

commit e69f8ee3366d62dc548ad149066d4eb35d631637
Author: bragadeesh <bragadeesh.natarajan at amd>
Date:   Sun Apr 19 21:42:43 2015 -0500

    fixing logic to allocate C2R temp buffer once
---
 src/library/plan.cpp      | 14 +++++++++++---
 src/library/transform.cpp | 15 ++++++++++++---
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/src/library/plan.cpp b/src/library/plan.cpp
index e1da880..c82aab7 100644
--- a/src/library/plan.cpp
+++ b/src/library/plan.cpp
@@ -2126,7 +2126,7 @@ clfftStatus	clfftBakePlan( clfftPlanHandle plHandle, cl_uint numQueues, cl_comma
 						fftPlan->tmpBufSize *= fftPlan->length[index];
 				}
 
-				if ((fftPlan->tmpBufSizeC2R==0) && (fftPlan->placeness == CLFFT_OUTOFPLACE))
+				if ((fftPlan->tmpBufSizeC2R==0) && (fftPlan->placeness == CLFFT_OUTOFPLACE) && (fftPlan->length.size() == 2))
 				{
 					fftPlan->tmpBufSizeC2R = fftPlan->tmpBufSize;
 				}
@@ -2170,7 +2170,17 @@ clfftStatus	clfftBakePlan( clfftPlanHandle plHandle, cl_uint numQueues, cl_comma
 				if (fftPlan->placeness == CLFFT_INPLACE)
 				{
 					colPlan->placeness = CLFFT_INPLACE;
+				}
+				else
+				{
+					if(fftPlan->length.size() > 2)
+						colPlan->placeness = CLFFT_INPLACE;
+					else
+						colPlan->placeness = CLFFT_OUTOFPLACE;
+				}
 
+				if(colPlan->placeness == CLFFT_INPLACE)
+				{
 					colPlan->outStride[0]  = colPlan->inStride[0];
 					colPlan->outStride.push_back(colPlan->inStride[1]);
 					colPlan->oDist         = colPlan->iDist;
@@ -2184,8 +2194,6 @@ clfftStatus	clfftBakePlan( clfftPlanHandle plHandle, cl_uint numQueues, cl_comma
 				}
 				else
 				{
-					colPlan->placeness = CLFFT_OUTOFPLACE;
-
 					colPlan->outStride[0]  = Nt;
 					colPlan->outStride.push_back(1);
 					colPlan->oDist         = Nt*length1;
diff --git a/src/library/transform.cpp b/src/library/transform.cpp
index a2be264..d8d09db 100644
--- a/src/library/transform.cpp
+++ b/src/library/transform.cpp
@@ -750,9 +750,18 @@ clfftStatus clfftEnqueueTransform(
 						}
 						else
 						{
-							out_local = clOutputBuffers;
-							int_local = &(fftPlan->intBufferC2R);
-							out_y = int_local;
+							if(fftPlan->length.size() > 2)
+							{
+								out_local = clOutputBuffers;
+								int_local = NULL;
+								out_y = clInputBuffers;
+							}
+							else
+							{
+								out_local = clOutputBuffers;
+								int_local = &(fftPlan->intBufferC2R);
+								out_y = int_local;
+							}
 						}
 
 

-- 
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