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/111707] New: omp_target_alloc and omp_target_is_present - corner case handling & spec conformance Date: Thu, 05 Oct 2023 17:28:05 +0000 [thread overview] Message-ID: <bug-111707-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111707 Bug ID: 111707 Summary: omp_target_alloc and omp_target_is_present - corner case handling & spec conformance Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: documentation, wrong-code 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: --- To be checked / updated. Besides fixing the code, also libgomp.texi needs to be updated. omp_target_alloc: For size == 0, the spec meanwhile requires that NULL is returned. However, we call 'malloc' on the host which might return a a non-NULL pointer that can be passed to 'free'. And on the device side, an GOMP_error diagnostic is printed to stderr for nvptx and gcn if the allocation fails. Both the HSA and CUDA documentation imply that size==0 is an error. omp_target_is_present OpenMP states that this functions checks whether the pointer is mapped. In GCC, we also return 'true' for shared memory systems and for the device_num being the host. The question is whether that's OK or not. Does a SELF MAP qualify or not? (self map - A mapping operation that, when corresponding storage is not already present, results in corresponding storage that is the same as its original storage.) [The current behavior is about to be documented, but we can change it.]
reply other threads:[~2023-10-05 17:28 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-111707-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).