OpenACC unified memory: Please write cudiareallocmanged

Hello,

I am trying to use unified memory feature with PGI compiler
using -ta=tesla:managed flag and I see following error at runtime:

Error: realloc does not exist. Please write cudaReallocManaged()
exec: nrnoc_aux.c:91: erealloc

It seems like realloc is not supported and we have to provide explicit definition of cudaReallocManaged.

Could someone provide small example / pointers to achieve this?

Hi PramodK,

Correct. There isn’t support for realloc when using CUDA Unified Memory.

What you’ll need to do is write you’re own realloc using “malloc” which the PGI compiler will translate into the call to managed memory.

  • Mat