Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenMP52][LIBOMPTARGET] Do not throw error in omp_get_mapped_ptr for the host #80038

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

saiislam
Copy link
Contributor

OpenMP spec 5.2 specifies return value to be the host ptr
in case of device_num being same as omp_get_initial_device().

… the host

OpenMP spec 5.2 specifies return value to be the host ptr in case of device_num being same as omp_get_initial_device().
@llvmbot llvmbot added the openmp:libomptarget OpenMP offload runtime label Jan 30, 2024
Copy link
Member

@carlobertolli carlobertolli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the correct interpretation of the OpenMP spec text. LGTM, waiting for @shiltian to review

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff b40d5b1b08564d23d5e0769892ebbc32447b2987 6d2a24b15f5ac9c4eaf551f07ee581d18345f42c -- openmp/libomptarget/src/OpenMP/API.cpp
View the diff from clang-format here.
diff --git a/openmp/libomptarget/src/OpenMP/API.cpp b/openmp/libomptarget/src/OpenMP/API.cpp
index 1ab1877774..cddcd42fd6 100644
--- a/openmp/libomptarget/src/OpenMP/API.cpp
+++ b/openmp/libomptarget/src/OpenMP/API.cpp
@@ -598,8 +598,8 @@ EXTERN void *omp_get_mapped_ptr(const void *Ptr, int DeviceNum) {
 
   size_t NumDevices = omp_get_initial_device();
   if (DeviceNum == NumDevices) {
-    DP("Device %d is initial device, returning Ptr " DPxMOD ".\n",
-           DeviceNum, DPxPTR(Ptr));
+    DP("Device %d is initial device, returning Ptr " DPxMOD ".\n", DeviceNum,
+       DPxPTR(Ptr));
     return const_cast<void *>(Ptr);
   }
 

Copy link
Contributor

@shiltian shiltian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@saiislam saiislam merged commit 5f6640e into llvm:main Jan 30, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants