Skip to content

Commit 083d66c

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into root_group_query
2 parents 43ba84b + 6347914 commit 083d66c

17 files changed

+59
-21
lines changed

libclc/utils/libclc-remangler/LibclcRemangler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ class BumpPointerAllocator {
105105
public:
106106
BumpPointerAllocator()
107107
: BlockList(new(InitialBuffer) BlockMeta{nullptr, 0}) {}
108+
BumpPointerAllocator(const BumpPointerAllocator &) = delete;
109+
BumpPointerAllocator &operator=(const BumpPointerAllocator &) = delete;
108110

109111
void *allocate(size_t N) {
110112
N = (N + 15u) & ~15u;

llvm/include/llvm/Support/PropertySetIO.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ class PropertySetRegistry {
212212
static constexpr char SYCL_VIRTUAL_FUNCTIONS[] = "SYCL/virtual functions";
213213
static constexpr char SYCL_IMPLICIT_LOCAL_ARG[] = "SYCL/implicit local arg";
214214

215+
static constexpr char PROPERTY_REQD_WORK_GROUP_SIZE[] =
216+
"reqd_work_group_size_uint64_t";
217+
215218
/// Function for bulk addition of an entire property set in the given
216219
/// \p Category .
217220
template <typename MapTy> void add(StringRef Category, const MapTy &Props) {
@@ -231,6 +234,17 @@ class PropertySetRegistry {
231234
PropSet.insert({PropName, PropertyValue(PropVal)});
232235
}
233236

237+
void remove(StringRef Category, StringRef PropName) {
238+
auto PropertySetIt = PropSetMap.find(Category);
239+
if (PropertySetIt == PropSetMap.end())
240+
return;
241+
auto &PropertySet = PropertySetIt->second;
242+
auto PropIt = PropertySet.find(PropName);
243+
if (PropIt == PropertySet.end())
244+
return;
245+
PropertySet.erase(PropIt);
246+
}
247+
234248
/// Parses from the given \p Buf a property set registry.
235249
static Expected<std::unique_ptr<PropertySetRegistry>>
236250
read(const MemoryBuffer *Buf);

llvm/lib/SYCLLowerIR/SYCLDeviceRequirements.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ SYCLDeviceRequirements
4040
llvm::computeDeviceRequirements(const Module &M,
4141
const SetVector<Function *> &EntryPoints) {
4242
SYCLDeviceRequirements Reqs;
43-
bool MultipleReqdWGSize = false;
4443
// Process all functions in the module
4544
for (const Function &F : M) {
4645
if (auto *MDN = F.getMetadata("sycl_used_aspects")) {
@@ -81,8 +80,6 @@ llvm::computeDeviceRequirements(const Module &M,
8180
ExtractUnsignedIntegerFromMDNodeOperand(MDN, I));
8281
if (!Reqs.ReqdWorkGroupSize.has_value())
8382
Reqs.ReqdWorkGroupSize = NewReqdWorkGroupSize;
84-
if (Reqs.ReqdWorkGroupSize != NewReqdWorkGroupSize)
85-
MultipleReqdWGSize = true;
8683
}
8784

8885
if (auto *MDN = F.getMetadata("sycl_joint_matrix")) {
@@ -119,13 +116,6 @@ llvm::computeDeviceRequirements(const Module &M,
119116
}
120117
}
121118

122-
// Usually, we would only expect one ReqdWGSize, as the module passed to
123-
// this function would be split according to that. However, when splitting
124-
// is disabled, this cannot be guaranteed. In this case, we reset the value,
125-
// which makes so that no value is reqd_work_group_size data is attached in
126-
// in the device image.
127-
if (MultipleReqdWGSize)
128-
Reqs.ReqdWorkGroupSize.reset();
129119
return Reqs;
130120
}
131121

@@ -152,7 +142,8 @@ std::map<StringRef, util::PropertyValue> SYCLDeviceRequirements::asMap() const {
152142
// reqd_work_group_size_uint64_t attribute. At the next ABI-breaking
153143
// window, this can be changed back to reqd_work_group_size.
154144
if (ReqdWorkGroupSize.has_value())
155-
Requirements["reqd_work_group_size_uint64_t"] = *ReqdWorkGroupSize;
145+
Requirements[util::PropertySetRegistry::PROPERTY_REQD_WORK_GROUP_SIZE] =
146+
*ReqdWorkGroupSize;
156147

157148
if (JointMatrix.has_value())
158149
Requirements["joint_matrix"] = *JointMatrix;

llvm/tools/sycl-post-link/sycl-post-link.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,15 @@ std::string saveModuleProperties(module_split::ModuleDesc &MD,
310310
auto PropSet =
311311
computeModuleProperties(MD.getModule(), MD.entries(), GlobProps);
312312

313+
// When the split mode is none, the required work group size will be added
314+
// to the whole module, which will make the runtime unable to
315+
// launch the other kernels in the module that have different
316+
// required work group sizes or no required work group sizes. So we need to
317+
// remove the required work group size metadata in this case.
318+
if (SplitMode == module_split::SPLIT_NONE)
319+
PropSet.remove(PropSetRegTy::SYCL_DEVICE_REQUIREMENTS,
320+
PropSetRegTy::PROPERTY_REQD_WORK_GROUP_SIZE);
321+
313322
std::string NewSuff = Suff.str();
314323
if (!Target.empty()) {
315324
PropSet.add(PropSetRegTy::SYCL_DEVICE_REQUIREMENTS, "compile_target",
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# commit a172cde4bc2857dcf74b0b2907a5b0f90566e808 (HEAD, origin/main, origin/HEAD)
2-
# Merge: 1851eff47b0a cde0d4c820b0
1+
# commit 27398080349f1d8d21d6a8680e234d29dcd14734 (HEAD, origin/main, origin/HEAD)
2+
# Merge: 572355db942d dc971af72a31
33
# Author: Martin Grant <[email protected]>
4-
# Date: Thu Dec 5 12:29:44 2024 +0000
5-
# Merge pull request #2249 from zhaomaosu/use-device-usm-for-rtl-data
6-
# [DeviceASAN] Use device usm to sync asan runtime data instead of shared usm
7-
set(UNIFIED_RUNTIME_TAG 9c7e56cc765b402add515e233e9aef4753cc8395)
4+
# Date: Thu Dec 5 14:57:07 2024 +0000
5+
# Merge pull request #2293 from yingcong-wu/yc-PR/241107-misc-minor-fix
6+
# [DeviceAsan] Serval bug fixes
7+
set(UNIFIED_RUNTIME_TAG 27398080349f1d8d21d6a8680e234d29dcd14734)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This test checks that with -fsycl-device-code-split=off, kernels
2+
// with different reqd_work_group_size dimensions can be launched.
3+
4+
// RUN: %{build} -fsycl-device-code-split=off -o %t.out
5+
// RUN: %{run} %t.out
6+
7+
// UNSUPPORTED: hip
8+
9+
#include <sycl/detail/core.hpp>
10+
11+
using namespace sycl;
12+
13+
int main(int argc, char **argv) {
14+
queue q;
15+
q.single_task([] {});
16+
q.parallel_for(range<2>(24, 1),
17+
[=](auto) [[sycl::reqd_work_group_size(24, 1)]] {});
18+
return 0;
19+
}

sycl/test-e2e/Regression/no-split-reqd-wg-size.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks that with -fsycl-device-code-split=off, kernels
22
// with different reqd_work_group_size dimensions can be launched.
33

4-
// RUN: %{build} -fsycl -fsycl-device-code-split=off -o %t.out
4+
// RUN: %{build} -fsycl-device-code-split=off -o %t.out
55
// RUN: %{run} %t.out
66

77
// UNSUPPORTED: hip

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_alloc_local_accessor.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_alloc_local_accessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
//
44

5-
// UNSUPPORTED: gpu-intel-gen12
5+
// UNSUPPORTED: gpu-intel-gen12, cpu
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16072
77

88
// Test work_group_dynamic extension with allocation size specified at runtime

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_alloc_ptr_alias.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_alloc_ptr_alias.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
//
44

5-
// UNSUPPORTED: gpu-intel-gen12
5+
// UNSUPPORTED: gpu-intel-gen12, cpu
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16072
77

88
// Test work_group_dynamic extension with allocation size specified at runtime

sycl/test-e2e/WorkGroupMemory/Dynamic/dynamic_allocation.cpp renamed to sycl/test-e2e/WorkGroupScratchMemory/dynamic_allocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
//
44

5-
// UNSUPPORTED: gpu-intel-gen12
5+
// UNSUPPORTED: gpu-intel-gen12, cpu
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16072
77

88
// Test work_group_dynamic extension with allocation size specified at runtime.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# https://github.com/intel/llvm/issues/16072
3+
config.unsupported_features += ['hip']

0 commit comments

Comments
 (0)