Open lucaparisi91 opened 2 months ago
You can get the device address of a host variable mapped to the device. An example is
double * x = ..... // allocate x on host
#pragma omp target data map(to:x[0:count])
{
#pragma omp target data use_device_addr(x[:,0])
{
// launch hip/cuda kernel here
launch_my_hip_kernel(x)
}
}
double * x_device;
allocate_and_copy_from_host_to_device() // cuda/hip code
#pragma omp target is_device_ptr(x_device)
{
// code using x_device here
}