[flang][cuda] Do not consider SHARED array as host array (#120306)

Update the current `FindHostArray` to not return shared array as host
array.
This commit is contained in:
Valentin Clement (バレンタイン クレメン) 2024-12-17 13:42:14 -08:00 committed by GitHub
parent 97b7bace67
commit 15c61a208f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -115,6 +115,7 @@ struct FindHostArray
(details->cudaDataAttr() &&
*details->cudaDataAttr() != common::CUDADataAttr::Device &&
*details->cudaDataAttr() != common::CUDADataAttr::Managed &&
*details->cudaDataAttr() != common::CUDADataAttr::Shared &&
*details->cudaDataAttr() != common::CUDADataAttr::Unified))) {
return &symbol;
}

View File

@ -35,6 +35,13 @@ module m
i = threadIdx%x
a(i) = i
end subroutine
attributes(global) subroutine sharedarray(a)
integer, device :: a(10)
integer, shared :: s(10)
i = threadIdx%x
a(i) = s(10) ! ok, a is device and s is shared
end subroutine
end
program main