Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

How can I link CUDA FORTRAN code (.cuf ) with Fortran code(. F90)

Hello! I tried to link a CUDA FORTRAN code with the Fortran code in  CESM.I eidt the Makefile as follows:bgpu.o:bgpu.cuf
    pgf90 -Mcuda -c bgpu.cuf
OBJS += bgpu.o
CUDALIBS = -L/opt/pgi/linux86-64/15.10/lib -lcudafor -lcudacemu -lcudadevice -lcudafor75 -lcudaforblas -lcudaforemu -lcudapgi
CUDAFLIBS = -L/opt/pgi/linux86-64/2015/cuda/7.5/lib64 -lcublas -lcusparse -lcurand -lcudart -lcufft -lcupti

$(EXEC_SE): $(OBJS) $(ULIBDEP)
    $(LD) -o $(EXEC_SE) $(OBJS) $(CLIBS) $(ULIBS) $(SLIBS) $(MLIBS) $(CUDALIBS) $(CUDAFLIBS) $(LDFLAGS) As you can see, I compiled the bgpu.cuf to bgpu.o, and then I link the bgpu.o object with other object files.The compilation process was all right. But when  I run the EXEC_SE ( that is cesm.exe), I got the error message "libcublas.7.5 no such file or directory" .So I add the  libcublas.7.5 into the LD_LIBRARY_PATH, then I got another message, which is "No CUDA device code available".It seems that the program treats the code bgpu.cuf as the F90 file, just because I directly linked the bgpu.o(which was compiled using pgf90) with other .o files(which were compiled from .F90 files using pgf90).Is there any proper strategy to solve the problem?  Thinks
 
Top