]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/commitdiff
Updated matmpy example.
authorJianzhong Xu <a0869574@ti.com>
Mon, 2 Mar 2015 14:49:41 +0000 (09:49 -0500)
committerJianzhong Xu <a0869574@ti.com>
Mon, 2 Mar 2015 14:49:41 +0000 (09:49 -0500)
examples/matmpy/Makefile
examples/matmpy/main.c

index 46f74fb7ece5c34cf88e09aaf5413ddefab08c99..e766082a217c4adc7da224810e044a0b934c3757 100644 (file)
@@ -6,3 +6,14 @@ include ../make.inc
 $(EXE): main.o
        $(CC) $(CFLAGS) main.o $(BLASLIB) -o $@
 
+fulltest: $(EXE)
+       @export TI_CBLAS_OFFLOAD=000; \
+       echo "Forcing execution on ARM."; \
+       ./$(EXE); \
+       @export TI_CBLAS_OFFLOAD=011; \
+       echo "Forcing execution on DSP."; \
+       ./$(EXE) \
+       @export TI_CBLAS_OFFLOAD=022; \
+       echo "Optimal execution on ARM or DSP."; \
+       ./$(EXE)
+
index 4298c087976e713464695722292471cd873989be..a97ed7d02687aa2b2b75166a1daba32cc531c340 100644 (file)
@@ -55,8 +55,9 @@ double matrix_mult(void) {
 int main()
 {
     int t;
-       double checksum;
-       int numtests = 10;
+    double checksum;
+    char *ti_cblas_offload_env;
+    int numtests = 10;
 
     /* configuration */
     m = k = n = 1000;
@@ -77,6 +78,19 @@ int main()
        
     srand(123456789);
 
+    /* Force BLAS execution on ARM due to insufficient MSMC memory. 
+       This will be removed later.   */
+    putenv("TI_CBLAS_OFFLOAD=000");
+
+    /* Check the environment variable that controls offloading */
+    ti_cblas_offload_env = getenv("TI_CBLAS_OFFLOAD");
+    if(ti_cblas_offload_env == NULL) {
+      printf("TI_CBLAS_OFFLOAD is not defined.\n");
+    }
+    else {
+      printf("TI_CBLAS_OFFLOAD is defined as %s\n", ti_cblas_offload_env);
+    }
+
     printf ("A(%ix%i) X B(%ix%i) => C(%ix%i)\n", m, k, k, n, m, n);
 
     printf("Warming caches (by doing a single matrix-multiply)..\n");