You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having some trouble using f2py with the pgi fortran compilers.
cpu_wrapper.f90
subroutinewrap_stuff(Z, ni)
use cudafor
implicit nonereal, dimension(:), intent(out) :: Z
integer, intent(in) :: ni
type(dim3) :: grid, tBlock
real, device, dimension(:), allocatable :: Z_d
allocate(Z_d(ni))
tBlock = dim3(32,1,1)
grid = dim3(1,1,1)
Z_d = Z
call do_stuff<<<grid, tBlock>>>(Z_d, ni)
Z = Z_d
endsubroutine
gpu_code.f90
attributes(global)subroutinedo_stuff(Z, N)
use cudafor
implicit nonereal, dimension(:), device :: Z
integer, intent(in) :: N
integer:: i
do i = threadIdx%x, N, blockDim%x
Z(i) = Z(i) **2.0enddoendsubroutine do_stuff
Uh oh!
There was an error while loading. Please reload this page.
Hey guys,
I'm having some trouble using f2py with the pgi fortran compilers.
cpu_wrapper.f90
gpu_code.f90
command line:
f2py --fcompiler=pg -m test -c cpu_wrapper.f90 gpu_code.f90 --f90flags="-Mcuda -fPIC"
everything compiles fine, however running
ldd -r
ontest.cpython-37m-x86_64-linux-gnu.so
yields the following:clearly, the python3 libraries are missing, so adding this with the following command line:
yields:
I can't keep adding individual libraries, so I was wondering if anyone has any ideas?
This code works fine when used from a program file and an executable is created the "usual" way.
The text was updated successfully, but these errors were encountered: