On 28/05/2024 23:33, Tobias Burnus wrote:
While most of the nvptx systems I have access to don't have the support for CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, one has:

Tesla V100-SXM2-16GB (as installed, e.g., on ORNL's Summit) does support this feature. And with that feature, unified-shared memory support does work, presumably by handling automatic page migration when a page fault occurs.

Hence: Enable USM support for those. When doing so, all 'requires unified_shared_memory' tests of sollve_vv pass :-)

I am not quite sure whether there are unintended side effects, hence, I have not enabled support for it in general. In particular, 'declare target enter(global_var)' seems to be mishandled (I think it should be link + pointer updated to point to the host; cf. description for 'self_maps'). Thus, it is not enabled by default but only when USM has been requested.

OK for mainline?
Comments? Remarks? Suggestions?

Tobias

PS: I guess some more USM tests should be added…



+               /* If USM has been requested and is supported by all devices
+                  of this type, set the capability accordingly.  */
+               if (omp_requires_mask & GOMP_REQUIRES_UNIFIED_SHARED_MEMORY)
+                 current_device.capabilities |= GOMP_OFFLOAD_CAP_SHARED_MEM;
+

This breaks my USM patches that add the omp_alloc support (because it now short-circuits all of those code-paths), and it's just not true for devices where all host memory isn't magically addressable on the device.

Is there another way to detect truly shared memory?

Andrew

Reply via email to