Amazing what these MAGMA guys have done by producing this heterogeneous code, and porting it to OpenCL.
I succeeded in building clMAGMA v0.3 using VS2008, Windows SDK v6.0A, gfortran (GNU 4.4) and MKL 11, on WinXPHE 32bit using an AMD HD5850 GPU. The unix makefile commands were revised to suit DOS syntax. In magmawinthreads.h I added the lines "#define __midl 600", "#define __int3264 int", and "typedef unsigned char byte". In common_magma.h, '#include <limits.h>' changed to '#include "limits.h"'. In operators.h and magma_types.h the ".x" were all changed to ".s[0]", and ".y" changed to ".s[1]". In Makefile.internal: 1) ifeq / else ifeq / else ifeq / else / endif changed to ifeq / else ifeq / else ifeq / else / endif / endif / endif, and 2) PTRSIZE = $(shell $(CC) -nologo $(PTRFILE) > nul && $(PTREXEC) && del $(PTREXEC) > nul ), and 3) #commenting out the section regarding Plasma. In magma_types.h: "#if HAVE_CUBLAS" changed to "#ifdef HAVE_CUBLAS", and "#elif HAVE_clAmdBlas" to "#elif defined(HAVE_clAmdBlas)". In interface.cpp "__func__" changed to "__FUNCTION__". At the top of every .cpp testing code the line "[module(name="magma_<>")];" was added, where <> = sfortran, dfortran, cfortran, zfortran, or param. One instance of pseudo-code "or" in each testing code replaced with the c logical operator "||". To overcome a linker error (zdotc and cdotc both being defined in libmagma.a and mkl_intel_c.lib) I simply deleted the zdotc and cdotc module entry from the top of the zhet21.f and chet21.f files in the lin dir. In magma_lapack.h, lines 59-60, "*small" replaced with "*smal". Before building I installed AMD StreamSDK v2.3 and clAmdBlas v1.8, and got Stream and Blas to compile and run their respective samples. Building clMAGMA was done in a VS2008 command prompt window, which automatically sets most of the required path entries.
To get the "d" and "z" precision .cl codes to build I had to add the #pragma line (#pragma OPENCL EXTENSION cl_amd_fp64 : enable) as cited in the June 13, '12 posting at
viewtopic.php?f=2&t=501&p=1613&hilit=clmagma#p1613 to the top of each "d" and "z" .cl source file in the interface_opencl dir. Some of the testing codes, in each precision type except "s" (e.g., dgesv, cgesv and zgesv), have to be edited to define the appropriate type of PRECISION in the #if defined(PRECISION_x) line that encases all the test code, or they won't run. The xgemm test codes -- Ifound them all to work with the argument line -M 1024 -N 1024 -K 1024.
I've posted more detail concerning my build here:
viewtopic.php?f=2&t=727If anyone would like a copy of my clMAGMA v1.0 build on WinXP (make cleanall), send me an email at
adensmore@ucla.edu with subject line "Requesting clMAGMA source".