views:

89

answers:

0

I've written the following code:

N_Vector_cuda v;

if (N <= 0) return(NULL);

v = (N_Vector_cuda) malloc(sizeof *v);
if (v == NULL) return(NULL);

v->inc = 1;
v->elemsize = sizeof(real);

v->status = cublasAlloc(N, v->elemsize, (void**)&(v->data));

if (v->status != CUBLAS_STATUS_SUCCESS)
{
    free(v);
    return(NULL);
}

v->length = N;

return(v);

Where N_Vector_cuda has the following structure (real can be double or float):

  typedef struct
  {
    integer length;
    real   *data;
    int inc;
    int elemsize;
    cublasStatus status;
  } dummyN_Vector_cuda;

  typedef dummyN_Vector_cuda *N_Vector_cuda ;

when I run Intel Inspector to detect memory error, it detect two types of error, both point to line calling cublasAlloc, they are:

  1. Invalid Partial Memory Access, the call stack is:

cudart.dll!cudaD3D10MapResources - 0x00021a80 cudart.dll!cudaD3D10MapResources - 0x00020e79 cudart.dll!cudaD3D10MapResources - 0x00020f0f cudart.dll!cudaCreateChannelDesc - 0x0001137d cudart.dll!cudaCreateChannelDesc - 0x000113ea cudart.dll!cudaFree - 0x00018fda cublas.dll!cublasInitCtx - 0x000011cd cublas.dll!cublasZtrsm - 0x00027fbf cublas.dll!cublasAlloc - 0x00001392 ....exe!N_VNew_cuda - nvector.cu:94

  1. Uninitialized Memory Access, call stack:

nvcuda.dll!cuD3D10ResourceGetSurfaceDimensions - 0x0015f967 nvcuda.dll!cuD3D10ResourceGetSurfaceDimensions - 0x0015cf59 nvcuda.dll!cuTexRefSetCPUAddress - 0x00022a91 nvcuda.dll!cuTexRefSetCPUAddress - 0x000124a6 nvcuda.dll!cuTexRefSetCPUAddress - 0x00005ce5 nvcuda.dll!cuTexRefSetCPUAddress - 0x0000670c nvcuda.dll!0x000015c7 nvcuda.dll!cuCtxCreate - 0x0003363f cudart.dll!_cudaRegisterFunction - 0x00016b33 cudart.dll!_cudaRegisterFunction - 0x00016c50 cudart.dll!_cudaRegisterFunction - 0x00016d61 cudart.dll!cudaFree - 0x00018feb cublas.dll!cublasInitCtx - 0x000011cd cublas.dll!cublasZtrsm - 0x00027fbf cublas.dll!cublasAlloc - 0x00001392 ....exe!N_VNew_cuda - nvector.cu:94

Just Want to know if I can safely ignore these errors...