summaryrefslogtreecommitdiff
path: root/benchmark/gemm.c
diff options
context:
space:
mode:
authorRajalakshmi Srinivasaraghavan <rajis@linux.ibm.com>2020-05-11 09:57:46 -0500
committerRajalakshmi Srinivasaraghavan <rajis@linux.ibm.com>2020-05-11 09:57:46 -0500
commitce90e2bd3f6e6e0bb338472d69fad47633639505 (patch)
treeb4bb941f4f537bcf1f8fbe28bea1b2c0f7d7ddff /benchmark/gemm.c
parent948b6712bab5fa89d10e364eb82ce55aff2e54ac (diff)
downloadopenblas-ce90e2bd3f6e6e0bb338472d69fad47633639505.tar.gz
openblas-ce90e2bd3f6e6e0bb338472d69fad47633639505.tar.bz2
openblas-ce90e2bd3f6e6e0bb338472d69fad47633639505.zip
Include shgemm in benchtest
This patch is to enable benchtest for half precision gemm when BUILD_HALF is set during make.
Diffstat (limited to 'benchmark/gemm.c')
-rw-r--r--benchmark/gemm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/benchmark/gemm.c b/benchmark/gemm.c
index dd016a7c3..d2235330b 100644
--- a/benchmark/gemm.c
+++ b/benchmark/gemm.c
@@ -39,6 +39,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef DOUBLE
#define GEMM BLASFUNC(dgemm)
+#elif defined(HALF)
+#define GEMM BLASFUNC(shgemm)
#else
#define GEMM BLASFUNC(sgemm)
#endif
@@ -120,7 +122,8 @@ static void *huge_malloc(BLASLONG size){
int main(int argc, char *argv[]){
- FLOAT *a, *b, *c;
+ IFLOAT *a, *b;
+ FLOAT *c;
FLOAT alpha[] = {1.0, 0.0};
FLOAT beta [] = {0.0, 0.0};
char transa = 'N';
@@ -184,10 +187,10 @@ int main(int argc, char *argv[]){
k = to;
}
- if (( a = (FLOAT *)malloc(sizeof(FLOAT) * m * k * COMPSIZE)) == NULL) {
+ if (( a = (IFLOAT *)malloc(sizeof(IFLOAT) * m * k * COMPSIZE)) == NULL) {
fprintf(stderr,"Out of Memory!!\n");exit(1);
}
- if (( b = (FLOAT *)malloc(sizeof(FLOAT) * k * n * COMPSIZE)) == NULL) {
+ if (( b = (IFLOAT *)malloc(sizeof(IFLOAT) * k * n * COMPSIZE)) == NULL) {
fprintf(stderr,"Out of Memory!!\n");exit(1);
}
if (( c = (FLOAT *)malloc(sizeof(FLOAT) * m * n * COMPSIZE)) == NULL) {
@@ -199,10 +202,10 @@ int main(int argc, char *argv[]){
#endif
for (i = 0; i < m * k * COMPSIZE; i++) {
- a[i] = ((FLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
+ a[i] = ((IFLOAT) rand() / (IFLOAT) RAND_MAX) - 0.5;
}
for (i = 0; i < k * n * COMPSIZE; i++) {
- b[i] = ((FLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
+ b[i] = ((IFLOAT) rand() / (IFLOAT) RAND_MAX) - 0.5;
}
for (i = 0; i < m * n * COMPSIZE; i++) {
c[i] = ((FLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;