Use_device in nvhpc/21.5

Hi,

We use the use_device to call CUDA kernels from the OpenMP data region. It works with old compiler nvhpc v20.x but not v21.5. We got error likes

FATAL ERROR: data in use_device clause was not found on device 1: host:0x3d5ae40

The arguments in use_device are already on devices. Can any other issue cause the problem ?

Thanks. /Jing

Hi Jing,

Is assume you’re meaning OpenACC’s host_data region’s “use_device” clause? OpenMP has a “use_device_ptr|addr” clause but no “use_device”.

Can any other issue cause the problem?

No, it just means that the variable isn’t on the device. Are you calling the routine which contains the host_data region elsewhere outside the scope of the outer data region? Are you passing the variable by value, in which case the variable’s address may have changed?

Can you provide an example code which show the issue?

-Mat

Hi Mat,

It is OpenMP directive !$OMP TARGET DATA USE_DEVICE_PTR

Unfortunately I was not able to reproduce such error using a test code. Is it possible to send you the source code with a small test case ?

Thanks.

Regards, Jing

We didn’t start support OpenMP Target Offload until 20.11… Lot’s of additions since then so this might explain the change in behavior.

Is it possible to send you the source code with a small test case ?

Sure. If it’s not too big, you direct message me and attach it to the message. If it is big, send me a note and we can arrange a way I can download it.