[clfft] 111/128: adding env variable to control in-place FFTs
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Oct 22 14:54:46 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 436988c70284044b15d6976703f775543692abf8
Author: bragadeesh <bragadeesh.natarajan at amd.com>
Date: Tue Oct 13 17:27:46 2015 -0700
adding env variable to control in-place FFTs
---
src/library/fft_binary_lookup.cpp | 14 ++++++++++++++
src/library/lifetime.cpp | 1 +
src/library/plan.cpp | 3 ++-
src/library/private.h | 3 +++
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/library/fft_binary_lookup.cpp b/src/library/fft_binary_lookup.cpp
index 0ca0431..7a26b6c 100644
--- a/src/library/fft_binary_lookup.cpp
+++ b/src/library/fft_binary_lookup.cpp
@@ -60,6 +60,20 @@ static char * sep()
static std::string cache_path;
static bool cache_enabled(false);
+static bool request_nomemalloc(false);
+
+void clfftInitRequestLibNoMemAlloc()
+{
+ const char * val = getenv("CLFFT_REQUEST_LIB_NOMEMALLOC");
+
+ if (val)
+ request_nomemalloc = true;
+}
+
+bool clfftGetRequestLibNoMemAlloc()
+{
+ return request_nomemalloc;
+}
void clfftInitBinaryCache()
{
diff --git a/src/library/lifetime.cpp b/src/library/lifetime.cpp
index f53f670..2a6adbd 100644
--- a/src/library/lifetime.cpp
+++ b/src/library/lifetime.cpp
@@ -34,6 +34,7 @@ clfftStatus clfftSetup( const clfftSetupData* sData )
// First invocation of this function will allocate the FFTRepo singleton; thereafter the object always exists
FFTRepo& fftRepo = FFTRepo::getInstance( );
+ clfftInitRequestLibNoMemAlloc();
clfftInitBinaryCache();
// Discover and load the timer module if present
diff --git a/src/library/plan.cpp b/src/library/plan.cpp
index 6139137..b3800b9 100644
--- a/src/library/plan.cpp
+++ b/src/library/plan.cpp
@@ -630,7 +630,8 @@ clfftStatus clfftBakePlan( clfftPlanHandle plHandle, cl_uint numQueues, cl_comma
clfftGenerators transGen = Transpose_GCN;
- if( (clLengths[0] == clLengths[1]) &&
+ if( clfftGetRequestLibNoMemAlloc() &&
+ (clLengths[0] == clLengths[1]) &&
(fftPlan->iDist == fftPlan->length[0]) &&
(fftPlan->oDist == fftPlan->length[0]) &&
fftPlan->placeness == CLFFT_INPLACE )
diff --git a/src/library/private.h b/src/library/private.h
index 2729973..ccca9db 100644
--- a/src/library/private.h
+++ b/src/library/private.h
@@ -90,6 +90,9 @@
}
#endif
+void clfftInitRequestLibNoMemAlloc();
+bool clfftGetRequestLibNoMemAlloc();
+
void clfftInitBinaryCache();
// This header file is not visible to clients, and contains internal structures and functions for use
--
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