[clblas] 90/125: enable the tune tool to test all the workgroup sizes that are multiples of wavefront but no bigger than the max workgroup size, instead of only testing the workgroup size = wavefront size

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri May 29 06:57:25 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 56370c0c56204c5789ae6ac26f66c902c406af40
Author: unknown <timmy.liu at amd.com>
Date:   Thu Aug 7 09:32:08 2014 -0500

    enable the tune tool to test all the workgroup sizes that are multiples of wavefront but no bigger than the max workgroup size, instead of only testing the workgroup size = wavefront size
---
 src/include/granulation.h       | 2 ++
 src/library/blas/gens/gemm.c    | 9 ++++++++-
 src/library/tools/tune/subdim.c | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/include/granulation.h b/src/include/granulation.h
index 215ec90..94f8a71 100644
--- a/src/include/granulation.h
+++ b/src/include/granulation.h
@@ -46,6 +46,8 @@ typedef struct PGranularity {
     unsigned int wfSize;
     /** Record number of work-groups spawned */
     unsigned int numWGSpawned[2];
+	/** max number of work group size */
+	unsigned int maxWorkGroupSize;
 } PGranularity;
 
 /**
diff --git a/src/library/blas/gens/gemm.c b/src/library/blas/gens/gemm.c
index 25cf499..a5b8377 100644
--- a/src/library/blas/gens/gemm.c
+++ b/src/library/blas/gens/gemm.c
@@ -1104,6 +1104,8 @@ blockCheckCalcDecomp(
     int check)
 {
     bool ret = true;
+	bool ret_multiple = false;
+	int i;
 
     DUMMY_ARG_USAGE(subdimsNum);
 
@@ -1114,7 +1116,12 @@ blockCheckCalcDecomp(
         minSize = (dtype == TYPE_COMPLEX_DOUBLE) ? 1 : 2;
         ret = decompSanityCheck(subdims, minSize, maxSize, 24, dtype, true);
         ret = ret && (subdims[0].bwidth == subdims[1].bwidth);
-        ret = ret && (pgran->wgSize[0] * pgran->wgSize[1] == 64);
+		for(i = 0; i < ( (pgran->maxWorkGroupSize) / (pgran->wfSize) ); i++)
+		{
+			// returns true if wgSize[0] * wgSize[1] is multiples of the 64 but not bigger than maxWorkGroupSize
+			ret_multiple = ret_multiple || ( pgran->wgSize[0] * pgran->wgSize[1] == pgran->wfSize * (i + 1) );
+		}
+		ret = ret && ret_multiple;
     }
     else {
         calcPgranDedicated(pgran, subdims, 1, 3);
diff --git a/src/library/tools/tune/subdim.c b/src/library/tools/tune/subdim.c
index 6eed76f..12b3f84 100644
--- a/src/library/tools/tune/subdim.c
+++ b/src/library/tools/tune/subdim.c
@@ -258,7 +258,7 @@ calcPGranularity (SubDimInfo* sd)
 
     pgran->wgDim = 2;
     pgran->wfSize = 64;
-
+	pgran->maxWorkGroupSize = sd->workGroupSizes;
 
     // if pattern provides granularity calculation
     // call the pattern function

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