[clblas] 74/125: Add addBuildOpt helper function for building option string
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Fri May 29 06:57:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository clblas.
commit 23db183cbf6e669da66626996de7c2bdcdee9180
Author: Christian Kellner <christian at kellner.me>
Date: Thu Jun 12 16:55:28 2014 +0200
Add addBuildOpt helper function for building option string
addBuildOpt should be called with the build option which is NOT
surrounded by spaces since it will add spaces to separate options
itself, if necessary.
---
src/library/blas/generic/common.c | 17 +++++++++++++++++
src/library/blas/include/clblas-internal.h | 5 +++++
2 files changed, 22 insertions(+)
diff --git a/src/library/blas/generic/common.c b/src/library/blas/generic/common.c
index de99f72..e77a4ce 100644
--- a/src/library/blas/generic/common.c
+++ b/src/library/blas/generic/common.c
@@ -22,6 +22,7 @@
#include <clkern.h>
#include <cltypes.h>
#include <stdio.h>
+#include <ctype.h>
#include "clblas-internal.h"
@@ -537,6 +538,22 @@ setupBuildOpts(
}
}
+void addBuildOpt(
+ char * opts,
+ size_t len,
+ const char * option)
+{
+ size_t l = strlen(opts);
+
+ if (l > 0 && !isspace(opts[l-1]) && l+1 < len) {
+ opts[l] = ' ';
+ opts[l+1] = '\0';
+ }
+
+ strlcat(opts, option, len);
+}
+
+
char VISIBILITY_HIDDEN
*sprintfGranulation(char *buf, const SubproblemDim *dim, int level)
{
diff --git a/src/library/blas/include/clblas-internal.h b/src/library/blas/include/clblas-internal.h
index 81ab512..7a9afcd 100644
--- a/src/library/blas/include/clblas-internal.h
+++ b/src/library/blas/include/clblas-internal.h
@@ -240,6 +240,11 @@ setupBuildOpts(
cl_device_id devID,
MemoryPattern *mempat);
+void addBuildOpt(
+ char * opts,
+ size_t len,
+ const char * option);
+
// Internal scatter image API
int
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clblas.git
More information about the debian-science-commits
mailing list