-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update numbawithopenmp to 296fb858b0a6800323e9b46b027c32636ecc80c7 - Support slicing for target mappings - Support code caching for CPU, GPU regions - Fix OpenMP CUDA RTL bug #10 - Fix README Closes #10 [run gitlab ci]
- Loading branch information
1 parent
0207140
commit 4604002
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...scripts/conda-recipes/llvm-openmp-dev/patches/0001-BACKPORT-Fix-for-CUDA-OpenMP-RTL.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
From 4e2d04de758d0ae37a1fd663c3c139293bfb3dc4 Mon Sep 17 00:00:00 2001 | ||
From: Giorgis Georgakoudis <[email protected]> | ||
Date: Tue, 28 Nov 2023 01:16:15 -0800 | ||
Subject: [PATCH] [BACKPORT] Fix for CUDA OpenMP RTL | ||
# Based on LLVM commit 545fcc3d842c0912db61591520bd4f760686c5a3 | ||
|
||
--- | ||
openmp-14.0.6.src/libomptarget/plugins/cuda/src/rtl.cpp | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/openmp-14.0.6.src/libomptarget/plugins/cuda/src/rtl.cpp b/openmp-14.0.6.src/libomptarget/plugins/cuda/src/rtl.cpp | ||
index 0ca05f0ec3a0..16da3f434bba 100644 | ||
--- a/openmp-14.0.6.src/libomptarget/plugins/cuda/src/rtl.cpp | ||
+++ b/openmp-14.0.6.src/libomptarget/plugins/cuda/src/rtl.cpp | ||
@@ -234,6 +234,7 @@ template <typename T> class ResourcePoolTy { | ||
std::mutex Mutex; | ||
/// Pool of resources. | ||
std::vector<T> Resources; | ||
+ std::vector<T> Pool; | ||
/// A reference to the corresponding allocator. | ||
AllocatorTy<T> Allocator; | ||
|
||
@@ -243,11 +244,13 @@ template <typename T> class ResourcePoolTy { | ||
auto CurSize = Resources.size(); | ||
assert(Size > CurSize && "Unexpected smaller size"); | ||
Resources.reserve(Size); | ||
+ Pool.reserve(Size); | ||
for (auto I = CurSize; I < Size; ++I) { | ||
T NewItem; | ||
int Ret = Allocator.create(NewItem); | ||
if (Ret != OFFLOAD_SUCCESS) | ||
return false; | ||
+ Pool.push_back(NewItem); | ||
Resources.push_back(NewItem); | ||
} | ||
return true; | ||
@@ -308,8 +311,9 @@ public: | ||
/// Released all stored resources and clear the pool. | ||
/// Note: This function is not thread safe. Be sure to guard it if necessary. | ||
void clear() noexcept { | ||
- for (auto &R : Resources) | ||
+ for (auto &R : Pool) | ||
(void)Allocator.destroy(R); | ||
+ Pool.clear(); | ||
Resources.clear(); | ||
} | ||
}; | ||
-- | ||
2.29.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters