HAVE_CUBLAS issue in magma-1.4.1

Open discussion for MAGMA

HAVE_CUBLAS issue in magma-1.4.1

Postby rigarash » Thu Jan 30, 2014 12:33 am

Hi,

Today I encountered the possible bug in magma-1.4.1 release code.
I wrote some code using MAGMA but failed to compiled code with -DHAVE_CUBLAS option.

Finally I found the root cause of this issue. magma_types.h contains a switch but
actually this does not check the #define properly.

The following patch fixes this issue.

Code: Select all
--- magma_types.h.old   2014-01-30 13:26:23.650750056 +0900
+++ magma_types.h       2014-01-30 13:26:56.816516221 +0900
@@ -44,7 +44,7 @@
 // ========================================
 // define types specific to implementation (CUDA, OpenCL, MIC)
 // define macros to deal with complex numbers
-#if HAVE_CUBLAS
+#if defined(HAVE_CUBLAS)
     #ifndef CUBLAS_V2_H_
     #include <cublas.h>
     #endif
rigarash
 
Posts: 1
Joined: Thu Jan 30, 2014 12:22 am

Re: HAVE_CUBLAS issue in magma-1.4.1

Postby mgates3 » Sun Feb 02, 2014 3:07 pm

What compiler are you using?

For gcc and icc, -DHAVE_CUBLAS defines HAVE_CUBLAS with value 1, so either #if or #ifdef works. But we can change it for future releases. Alternately, defining it using -DHAVE_CUBLAS=1 should work.

From the gcc man page:
-D name
Predefine name as a macro, with definition 1.

From the icc man page:
-Dname[=value]
If a value is not specified, name is defined as "1".

-mark
mgates3
 
Posts: 409
Joined: Fri Jan 06, 2012 2:13 pm


Return to User discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron