public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/113216] New: [OpenMP] Improve omp_target_is_accessible Date: Wed, 03 Jan 2024 12:00:18 +0000 [thread overview] Message-ID: <bug-113216-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113216 Bug ID: 113216 Summary: [OpenMP] Improve omp_target_is_accessible Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- For omp_target_is_accessible + unified address: * it is not 100% correct to assume that any address is accessible on the host, it might be a device-only address (For handling NULL, see also PR 113213) Likewise for the nonhost device: * memory might be accessible even if only unified address * * * The host case is a bit trickier as no generic documentation seems to be available albeit some ranges like 0x7F...... seem to denote device addresses + a superset has to be formed. * * * For the device side, an API function might be available to check for it. * * In case of nvptx / CUDA, the following function seems to be suitable: CUresult cuMemGetAccess ( unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr ) checking for flags == CU_MEM_ACCESS_FLAGS_PROT_READWRITE, if I understand it correctly. typedef enum CUmemAccess_flags_enum { CU_MEM_ACCESS_FLAGS_PROT_NONE = 0x0, /**< Default, make the address range not accessible */ CU_MEM_ACCESS_FLAGS_PROT_READ = 0x1, /**< Make the address range read accessible */ CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 0x3, /**< Make the address range read-write accessible */ CU_MEM_ACCESS_FLAGS_PROT_MAX = 0x7FFFFFFF } CUmemAccess_flags; * * In case of HSA/ROCm, I bet there is also some function. For instance, hipPointerGetAttribute{,s} + hipDrvPointerGetAttributes permit to query some pointer data.
reply other threads:[~2024-01-03 12:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-113216-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).