Skip to content

Commit 4858edf

Browse files
committed
Address feedback
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent c9e55b3 commit 4858edf

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,12 @@ attributeToExecModeMetadata(const Attribute &Attr, Function &F) {
279279
assert((PropVal == 0 || PropVal == 128 || PropVal == 256) &&
280280
"Unsupported GRF Size");
281281
// Map sycl-grf-size values to RegisterAllocMode values used in SPIR-V.
282+
static constexpr int SMALL_GRF_REGALLOCMODE_VAL = 1;
283+
static constexpr int LARGE_GRF_REGALLOCMODE_VAL = 2;
282284
if (PropVal == 128)
283-
PropVal = 1;
285+
PropVal = SMALL_GRF_REGALLOCMODE_VAL;
284286
else if (PropVal == 256)
285-
PropVal = 2;
287+
PropVal = LARGE_GRF_REGALLOCMODE_VAL;
286288
}
287289
Metadata *AttrMDArgs[] = {ConstantAsMetadata::get(
288290
Constant::getIntegerValue(Type::getInt32Ty(Ctx), APInt(32, PropVal)))};

llvm/test/tools/sycl-post-link/grf-size-conflict.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
; RUN: not sycl-post-link -split=source -symbols -split-esimd -lower-esimd -S < %s 2>&1 | FileCheck %s
44

5-
; CHECK: Unsupported use of both sycl-register-alloc-mode and sycl-grf-size
5+
; CHECK: Unsupported use of both register_alloc_mode and grf_size
66

77
source_filename = "llvm-link"
88
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"

llvm/test/tools/sycl-post-link/sycl-grf-size.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
; RUN: sycl-post-link -split=source -symbols -split-esimd -lower-esimd -S < %s -o %t.table
44
; RUN: FileCheck %s -input-file=%t.table
5-
; RUN: FileCheck %s -input-file=%t_esimd_0.ll --check-prefixes CHECK-ESIMD-LargeGRF-IR
5+
; RUN: FileCheck %s -input-file=%t_esimd_0.ll --check-prefixes CHECK-ESIMD-LargeGRF-IR --implicit-check-not='__ESIMD_kernel()'
66
; RUN: FileCheck %s -input-file=%t_esimd_0.prop --check-prefixes CHECK-ESIMD-LargeGRF-PROP
77
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-SYCL-LargeGRF-IR
88
; RUN: FileCheck %s -input-file=%t_0.prop --check-prefixes CHECK-SYCL-LargeGRF-PROP
@@ -55,7 +55,6 @@ entry:
5555
}
5656

5757
define weak_odr dso_local spir_kernel void @__ESIMD_kernel() #0 !sycl_explicit_simd !0 !intel_reqd_sub_group_size !1 {
58-
5958
entry:
6059
ret void
6160
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ std::string saveModuleProperties(module_split::ModuleDesc &MD,
485485
});
486486
if (HasGRFSize) {
487487
if (HasRegAllocMode)
488-
error("Unsupported use of both sycl-register-alloc-mode and "
489-
"sycl-grf-size");
488+
error("Unsupported use of both register_alloc_mode and "
489+
"grf_size");
490490
PropSet[PropSetRegTy::SYCL_MISC_PROP].insert({GRFSizeAttr, GRFSizeVal});
491491
}
492492
}

sycl/include/sycl/detail/kernel_properties.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ struct register_alloc_mode_key {
2929
};
3030

3131
template <register_alloc_mode_enum Mode>
32-
inline constexpr register_alloc_mode_key::value_t<Mode>
33-
register_alloc_mode __SYCL_DEPRECATED("register_alloc_mode is deprecated, "
34-
"use grf_size or grf_size_automatic");
32+
inline constexpr register_alloc_mode_key::value_t<Mode> register_alloc_mode
33+
__SYCL_DEPRECATED("register_alloc_mode is deprecated, "
34+
"use sycl::ext::intel::experimental::grf_size or "
35+
"sycl::ext::intel::experimental::grf_size_automatic");
3536
} // namespace detail
3637

3738
namespace ext::oneapi::experimental {

sycl/test-e2e/DeviceCodeSplit/grf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
// RUN: env SYCL_PROGRAM_COMPILE_OPTIONS="-g" SYCL_PI_TRACE=-1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-AUTO-WITH-VAR
3333
#include "../helpers.hpp"
3434
#include <iostream>
35-
#include <sycl/detail/kernel_properties.hpp>
3635
#include <sycl/sycl.hpp>
3736
#ifdef USE_NEW_API
3837
#include <sycl/ext/intel/experimental/grf_size_properties.hpp>
38+
#else
39+
#include <sycl/detail/kernel_properties.hpp>
3940
#endif
4041

4142
using namespace sycl;

sycl/test-e2e/ESIMD/large-grf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
#include "esimd_test_utils.hpp"
2727

2828
#include <iostream>
29-
#include <sycl/detail/kernel_properties.hpp>
3029
#include <sycl/ext/intel/esimd.hpp>
3130
#include <sycl/sycl.hpp>
3231
#ifdef USE_NEW_API
3332
#include <sycl/ext/intel/experimental/grf_size_properties.hpp>
33+
#else
34+
#include <sycl/detail/kernel_properties.hpp>
3435
#endif
3536

3637
using namespace sycl;

0 commit comments

Comments
 (0)