Skip to content

Commit f2376d4

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 8989412 + e62b5aa commit f2376d4

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

opencl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set(OCL_LOADER_REPO
2121
# Repo tags/hashes
2222

2323
set(OCL_HEADERS_TAG dcd5bede6859d26833cd85f0d6bbcee7382dc9b3)
24-
set(OCL_LOADER_TAG 5f8249691ec8c25775789498951f8e9eb62c201d)
24+
set(OCL_LOADER_TAG 5d9177ee79bfbcc75ee9a8cff6415eab2c3113f6)
2525

2626
# OpenCL Headers
2727
if(NOT OpenCL_HEADERS)

sycl/include/CL/sycl/kernel_handler.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class kernel_handler {
2323
public:
2424
#if __cplusplus >= 201703L
2525
template <auto &S>
26-
typename std::remove_reference_t<decltype(S)>::value_type
26+
__SYCL_ALWAYS_INLINE typename std::remove_reference_t<decltype(S)>::value_type
2727
get_specialization_constant() {
2828
#ifdef __SYCL_DEVICE_ONLY__
2929
return getSpecializationConstantOnDevice<S>();
@@ -49,7 +49,7 @@ class kernel_handler {
4949
auto &S,
5050
typename T = typename std::remove_reference_t<decltype(S)>::value_type,
5151
std::enable_if_t<std::is_fundamental_v<T>> * = nullptr>
52-
T getSpecializationConstantOnDevice() {
52+
__SYCL_ALWAYS_INLINE T getSpecializationConstantOnDevice() {
5353
const char *SymbolicID = __builtin_sycl_unique_stable_id(S);
5454
return __sycl_getScalar2020SpecConstantValue<T>(
5555
SymbolicID, &S, MSpecializationConstantsBuffer);
@@ -58,7 +58,7 @@ class kernel_handler {
5858
auto &S,
5959
typename T = typename std::remove_reference_t<decltype(S)>::value_type,
6060
std::enable_if_t<std::is_compound_v<T>> * = nullptr>
61-
T getSpecializationConstantOnDevice() {
61+
__SYCL_ALWAYS_INLINE T getSpecializationConstantOnDevice() {
6262
const char *SymbolicID = __builtin_sycl_unique_stable_id(S);
6363
return __sycl_getComposite2020SpecConstantValue<T>(
6464
SymbolicID, &S, MSpecializationConstantsBuffer);

sycl/source/detail/queue_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void *queue_impl::instrumentationProlog(const detail::code_location &CodeLoc,
201201
xpti::utils::StringHelper NG;
202202
Name = NG.nameWithAddress<queue_impl *>("queue.wait", this);
203203

204-
if (!CodeLoc.fileName()) {
204+
if (CodeLoc.fileName()) {
205205
// We have source code location information
206206
Payload =
207207
xpti::payload_t(Name.c_str(), CodeLoc.fileName(), CodeLoc.lineNumber(),
@@ -236,7 +236,9 @@ void *queue_impl::instrumentationProlog(const detail::code_location &CodeLoc,
236236
xpti::addMetadata(WaitEvent, "sym_function_name", CodeLoc.functionName());
237237
xpti::addMetadata(WaitEvent, "sym_source_file_name", CodeLoc.fileName());
238238
xpti::addMetadata(WaitEvent, "sym_line_no",
239-
std::to_string(CodeLoc.lineNumber()));
239+
static_cast<int32_t>((CodeLoc.lineNumber())));
240+
xpti::addMetadata(WaitEvent, "sym_column_no",
241+
static_cast<int32_t>((CodeLoc.columnNumber())));
240242
}
241243
xptiNotifySubscribers(StreamID, xpti::trace_wait_begin, nullptr, WaitEvent,
242244
QWaitInstanceNo,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %clangxx -O0 -fsycl -fsycl-device-only -Xclang -emit-llvm %s -o - | FileCheck %s
2+
// This test checks that even under -O0 the entire call chain starting from
3+
// kh.get_specialization_constant and ending with
4+
// __sycl_getScalar2020SpecConstantValue gets inlined.
5+
#include <CL/sycl.hpp>
6+
7+
using namespace cl::sycl;
8+
9+
constexpr specialization_id<unsigned int> SPEC_CONST(1024);
10+
11+
SYCL_EXTERNAL unsigned int foo(kernel_handler &kh) {
12+
return kh.get_specialization_constant<SPEC_CONST>();
13+
}
14+
15+
// CHECK-LABEL: define dso_local spir_func noundef i32 @_Z3foo{{.*}} {
16+
// CHECK-NOT: {{.*}}spir_func
17+
// CHECK: %{{.*}} = {{.*}}call spir_func {{.*}}i32 @_Z37__sycl_getScalar2020SpecConstantValue
18+
// CHECK-NOT: {{.*}}spir_func
19+
// CHECK-LABEL: }

0 commit comments

Comments
 (0)