Skip to content

Commit 29a12d3

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents ee9ee55 + 65da01b commit 29a12d3

File tree

13 files changed

+503
-334
lines changed

13 files changed

+503
-334
lines changed

.github/workflows/clang-format.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55
branches:
66
- sycl
7-
types: [open, edit, reopen, synchronize]
87

98
jobs:
109
build:
@@ -22,7 +21,7 @@ jobs:
2221

2322
- name: Run clang-format for the patch
2423
run: |
25-
git diff -U0 --no-color origin/${{github.base_ref}}..HEAD | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
24+
git diff -U0 --no-color origin/${{github.base_ref}}...HEAD | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
2625
2726
# Add patch with formatting fixes to CI job artifacts
2827
- uses: actions/upload-artifact@v1

buildbot/dependency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def do_dependency(args):
7171
install_dir = os.path.join(args.obj_dir, "install")
7272
cmake_cmd = ["cmake", "-G", "Ninja",
7373
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
74+
"-DOPENCL_ICD_LOADER_HEADERS_DIR={}".format(ocl_header_dir),
7475
".." ]
7576
subprocess.check_call(cmake_cmd, cwd=icd_build_dir)
7677

clang/lib/Sema/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (MSVC)
99
set_source_files_properties(SemaExprCXX.cpp PROPERTIES COMPILE_FLAGS /bigobj)
1010
set_source_files_properties(SemaSYCL.cpp PROPERTIES COMPILE_FLAGS /bigobj)
1111
set_source_files_properties(SemaTemplate.cpp PROPERTIES COMPILE_FLAGS /bigobj)
12+
set_source_files_properties(SemaTemplateDeduction.cpp PROPERTIES COMPILE_FLAGS /bigobj)
1213
endif()
1314

1415
clang_tablegen(OpenCLBuiltins.inc -gen-clang-opencl-builtins

sycl/include/CL/sycl/builtins.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -851,10 +851,6 @@ detail::enable_if_t<detail::is_ugeninteger<T>::value, T> sub_sat(T x,
851851
return __sycl_std::__invoke_u_sub_sat<T>(x, y);
852852
}
853853

854-
// TODO delete when Intel CPU OpenCL runtime will be fixed
855-
// OpExtInst ... s_upsample -> _Z8upsampleij (now _Z8upsampleii)
856-
#define __invoke_s_upsample __invoke_u_upsample
857-
858854
// ugeninteger16bit upsample (ugeninteger8bit hi, ugeninteger8bit lo)
859855
template <typename T>
860856
detail::enable_if_t<detail::is_ugeninteger8bit<T>::value,
@@ -909,8 +905,6 @@ upsample(T hi, T2 lo) __NOEXC {
909905
return __sycl_std::__invoke_s_upsample<detail::make_larger_t<T>>(hi, lo);
910906
}
911907

912-
#undef __invoke_s_upsample
913-
914908
// geninteger popcount (geninteger x)
915909
template <typename T>
916910
detail::enable_if_t<detail::is_geninteger<T>::value, T> popcount(T x) __NOEXC {

sycl/include/CL/sycl/half_type.hpp

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
#include <iostream>
1919
#include <limits>
2020

21+
#ifdef __SYCL_DEVICE_ONLY__
22+
// `constexpr` could work because the implicit conversion from `float` to
23+
// `_Float16` can be `constexpr`.
24+
#define __SYCL_CONSTEXPR_ON_DEVICE constexpr
25+
#else
26+
#define __SYCL_CONSTEXPR_ON_DEVICE
27+
#endif
28+
2129
__SYCL_INLINE_NAMESPACE(cl) {
2230
namespace sycl {
2331
namespace detail {
@@ -130,7 +138,7 @@ class half {
130138
half(const half &) = default;
131139
half(half &&) = default;
132140

133-
half(const float &rhs) : Data(rhs) {}
141+
__SYCL_CONSTEXPR_ON_DEVICE half(const float &rhs) : Data(rhs) {}
134142

135143
half &operator=(const half &rhs) = default;
136144

@@ -216,15 +224,6 @@ using half = cl::sycl::detail::half_impl::half;
216224
// Partial specialization of some functions in namespace `std`
217225
namespace std {
218226

219-
#ifdef __SYCL_DEVICE_ONLY__
220-
// `constexpr` could work because the implicit conversion from `float` to
221-
// `_Float16` can be `constexpr`.
222-
#define CONSTEXPR_QUALIFIER constexpr
223-
#else
224-
// The qualifier is `const` instead of `constexpr` that is original to be
225-
// because the constructor is not `constexpr` function.
226-
#define CONSTEXPR_QUALIFIER const
227-
#endif
228227

229228
// Partial specialization of `std::hash<cl::sycl::half>`
230229
template <> struct hash<half> {
@@ -307,35 +306,43 @@ template <> struct numeric_limits<half> {
307306

308307
static constexpr const float_round_style round_style = round_to_nearest;
309308

310-
static CONSTEXPR_QUALIFIER half min() noexcept { return SYCL_HLF_MIN; }
309+
static __SYCL_CONSTEXPR_ON_DEVICE const half min() noexcept {
310+
return SYCL_HLF_MIN;
311+
}
311312

312-
static CONSTEXPR_QUALIFIER half max() noexcept { return SYCL_HLF_MAX; }
313+
static __SYCL_CONSTEXPR_ON_DEVICE const half max() noexcept {
314+
return SYCL_HLF_MAX;
315+
}
313316

314-
static CONSTEXPR_QUALIFIER half lowest() noexcept { return -SYCL_HLF_MAX; }
317+
static __SYCL_CONSTEXPR_ON_DEVICE const half lowest() noexcept {
318+
return -SYCL_HLF_MAX;
319+
}
315320

316-
static CONSTEXPR_QUALIFIER half epsilon() noexcept {
321+
static __SYCL_CONSTEXPR_ON_DEVICE const half epsilon() noexcept {
317322
return SYCL_HLF_EPSILON;
318323
}
319324

320-
static CONSTEXPR_QUALIFIER half round_error() noexcept { return 0.5F; }
325+
static __SYCL_CONSTEXPR_ON_DEVICE const half round_error() noexcept {
326+
return 0.5F;
327+
}
321328

322-
static CONSTEXPR_QUALIFIER half infinity() noexcept {
329+
static __SYCL_CONSTEXPR_ON_DEVICE const half infinity() noexcept {
323330
return __builtin_huge_valf();
324331
}
325332

326-
static CONSTEXPR_QUALIFIER half quiet_NaN() noexcept {
333+
static __SYCL_CONSTEXPR_ON_DEVICE const half quiet_NaN() noexcept {
327334
return __builtin_nanf("");
328335
}
329336

330-
static CONSTEXPR_QUALIFIER half signaling_NaN() noexcept {
337+
static __SYCL_CONSTEXPR_ON_DEVICE const half signaling_NaN() noexcept {
331338
return __builtin_nansf("");
332339
}
333340

334-
static CONSTEXPR_QUALIFIER half denorm_min() noexcept { return 5.96046e-08F; }
341+
static __SYCL_CONSTEXPR_ON_DEVICE const half denorm_min() noexcept {
342+
return 5.96046e-08F;
343+
}
335344
};
336345

337-
#undef CONSTEXPR_QUALIFIER
338-
339346
} // namespace std
340347

341348
inline std::ostream &operator<<(std::ostream &O, half const &rhs) {
@@ -349,3 +356,5 @@ inline std::istream &operator>>(std::istream &I, half &rhs) {
349356
rhs = ValFloat;
350357
return I;
351358
}
359+
360+
#undef __SYCL_CONSTEXPR_ON_DEVICE

0 commit comments

Comments
 (0)