- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am in the process of integrating GPU offloads into a simulation program, and the examples on how to use this in Fortran are hard to find.
I am aware that there are allocators, in particular for GPU
omp_target_device_mem_space
omp_target_shared_mem_space
omp_target_host_mem_space
potential example
allocate(omp_target_shared_mem_space:Array(n)) ! outside of !$omp region
However it is unclear as to if the ALLOCATE statement must be preceded by !$OMP ALLOCATE...
IOW are both the following appropriate?
...code...
allocate(omp_target_shared_mem_space:Array(n))
...code
and
...code...
!$omp allocate omp_target_shared_mem_space
allocate(Array(n))
...code
Additionally,
If one has multiple GPUs, how do you direct the allocation to a specific GPU?
(note, allocate statement performed on host).
and
if the chosen allocate is
allocate(omp_target_shared_mem_space:Array(n))
and there is no GPU present, does the allocation fail?
Jim
Link Copied
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page