_hpf_bcopysl access violation

Hello.

I’m using cusparseDcsrmv, one of the CUSPARSE library function, and I’m getting access violation from _hpf_bcopysl.

What is _hpf_bcopysl and what is its role?

It’s the Fortran runtime’s routine to perform a bcopy with strides. Though, this is only called on the host. Are you using a device array on the host?

I’m just passing the device array pointers to cusparseDcsrmv and this function does the rest.

I don’t know what is happening inside this function.

This is a PGI runtime call so wouldn’t be called from a cuSparse routine. It’s occurring somewhere else in your code.

The problem is solved.

Segmentation fault was occuring due to invalid input argument.

But now I found another problem.

The following is one of the preprocessing routine that allocates device arrays.

SUBROUTINE AllocCMFDVar(Core, cuCMFD, cuDevice)
USE PARAM
USE TYPEDEF,		ONLY : CoreInfo_Type
USE CUDATypeDef,	ONLY : cuCMFD_Type,			cuDevice_Type
USE CNTL,			ONLY : nTracerCntl
USE GEOM,			ONLY : ng
IMPLICIT NONE

TYPE(CoreInfo_Type) :: Core
TYPE(cuCMFD_Type) :: cuCMFD
TYPE(cuDevice_Type) :: cuDevice

INTEGER :: nxy, nz

nxy = Core%nxy
nz = cuDevice%myze - cuDevice%myzb + 1

ALLOCATE(cuCMFD%Cell_phis(ng * nxy * nz))
ALLOCATE(cuCMFD%Cell_src(ng * nxy * nz))
ALLOCATE(cuCMFD%Cell_psi(nxy * nz))
ALLOCATE(cuCMFD%Cell_psid(nxy * nz))

END SUBROUTINE

But on the calling side, I wrote like this

CALL AllocCMFDVar(Core, RayInfo, cuCMFD(tid), cuDevice(tid))

RayInfo should not be passed but the code ran without any error.

This is why cusparse routines failed; the preprocessing routine was behaving abnormally.

RayInfo should not be passed but the code ran without any error.

Unless you have an F90 interface (either explicit or implicitly created when used in a module), F77 calling conventions apply. With F77, no argument checking is done and it’s up to the programmer to ensure the call is correct.

-Mat