summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ca7c32e)
raw | patch | inline | side by side (parent: ca7c32e)
author | Jianzhong Xu <a0869574@ti.com> | |
Mon, 2 Mar 2015 14:49:41 +0000 (09:49 -0500) | ||
committer | Jianzhong Xu <a0869574@ti.com> | |
Mon, 2 Mar 2015 14:49:41 +0000 (09:49 -0500) |
examples/matmpy/Makefile | patch | blob | history | |
examples/matmpy/main.c | patch | blob | history |
index 46f74fb7ece5c34cf88e09aaf5413ddefab08c99..e766082a217c4adc7da224810e044a0b934c3757 100644 (file)
--- a/examples/matmpy/Makefile
+++ b/examples/matmpy/Makefile
$(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)
+
diff --git a/examples/matmpy/main.c b/examples/matmpy/main.c
index 4298c087976e713464695722292471cd873989be..a97ed7d02687aa2b2b75166a1daba32cc531c340 100644 (file)
--- a/examples/matmpy/main.c
+++ b/examples/matmpy/main.c
int main()
{
int t;
- double checksum;
- int numtests = 10;
+ double checksum;
+ char *ti_cblas_offload_env;
+ int numtests = 10;
/* configuration */
m = k = n = 1000;
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");