Fortran PGI with CULA on Mac OS

Support for issues specific to the Mac OS operating systems.

Fortran PGI with CULA on Mac OS

Postby enrrr » Fri Sep 17, 2010 9:53 am

Hi,
I need to use CULA libraries in a FORTRAN program but i have some problems.
As an example, i post a simple program that presents many problems:

Code: Select all
program cula

            integer status
            ! initialize cula

            status = cula_initialize()
         
            write(*,*) "status    = ",status

            call check_status(status)

            contains

            ! gpu error reporting routine

            subroutine check_status(status)

           

                integer status

                integer info

                integer cula_geterrorinfo

                info = cula_geterrorinfo()

                if (status .ne. 0) then

                    if (status .eq. 7) then

                        write(*,*) 'invalid value for parameter ', info

                    else if (status .eq. 8) then

                        write(*,*) 'data error (', info ,')'

                    else if (status .eq. 9) then

                        write(*,*) 'blas error (', info ,')'

                    else if (status .eq. 10) then

                        write(*,*) 'runtime error (', info ,')'

                    else

                        call cula_getstatusstring(status)

                    endif

                    stop 1

                end if
            end subroutine     

end program cula


the line command is :

Code: Select all
pgfortran  cula.cuf -lcula_pgfortran -L/usr/local/cula/lib -ta=nvidia -tp nehalem-32


The compilers works and links the libraries, but the shell send me these results:

status = -2147483648
Invalid culaStatus
1

I can't understand where i am doing wrong, but i can't even initialize the CULA.

The OS system is Mac OS X 10.6.4
CPU: 2 x 2.26 GHz Quad - Core Intel Xeon
RAM: 16 GB 1066 MHz DDR3
CUDA Version 3.1

If it's necessary, ask me and i will send more informations about the context.

Thanks to all for the help
EI
enrrr
 
Posts: 2
Joined: Fri Sep 17, 2010 12:27 am

Re: Fortran PGI with CULA on Mac OS

Postby enrrr » Tue Sep 21, 2010 2:50 am

I solved the problem.
It was necessary to declare external the functions cula and to define the type of the function.

Code: Select all
       external cula_initialize
       external cula_Shutdown
       ...             

       integer :: cula_initialize


Bye to all

EI
enrrr
 
Posts: 2
Joined: Fri Sep 17, 2010 12:27 am

Re: Fortran PGI with CULA on Mac OS

Postby kyle » Fri Sep 24, 2010 8:26 am

Glad that this fixed your error! We've been busy at NVIDIA's GPU Technology Conference and didn't get a chance to test this out on our machines.
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm


Return to Mac OS X Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron