Skip to content

Commit d9b53d7

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents ef85fcc + 3bf7d5c commit d9b53d7

File tree

12 files changed

+2226
-516
lines changed

12 files changed

+2226
-516
lines changed

devops/dependencies.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
},
4343
"linux_staging": {
4444
"compute_runtime": {
45-
"github_tag": "22.26.23599",
46-
"version": "22.26.23599",
47-
"url": "https://github.com/intel/compute-runtime/releases/tag/22.26.23599",
45+
"github_tag": "22.29.23750",
46+
"version": "22.29.23750",
47+
"url": "https://github.com/intel/compute-runtime/releases/tag/22.29.23750",
4848
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
4949
},
5050
"igc": {

libdevice/cmake/modules/ImfSrcConcate.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set(imf_fp32_fallback_src_list imf_utils/integer_misc.cpp
22
imf_utils/half_convert.cpp
33
imf_utils/float_convert.cpp
4+
imf_utils/simd_emulate.cpp
45
imf/imf_inline_fp32.cpp)
56

67
set(imf_fp64_fallback_src_list imf_utils/double_convert.cpp

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ set(imf_fallback_fp32_deps device.h device_imf.hpp imf_half.hpp
123123
imf_utils/integer_misc.cpp
124124
imf_utils/float_convert.cpp
125125
imf_utils/half_convert.cpp
126+
imf_utils/simd_emulate.cpp
126127
imf/imf_inline_fp32.cpp)
127128
set(imf_fallback_fp64_deps device.h device_imf.hpp imf_half.hpp
128129
imf_utils/double_convert.cpp

libdevice/device_imf.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include "device.h"
1313
#include "imf_half.hpp"
1414
#include <cstddef>
15+
#include <limits>
1516
#include <type_traits>
16-
1717
#ifdef __LIBDEVICE_IMF_ENABLED__
1818

1919
#if !defined(__SPIR__) && !defined(__LIBDEVICE_HOST_IMPL__)
@@ -458,12 +458,21 @@ static inline int __popcll(unsigned long long int x) {
458458
#endif
459459
}
460460

461-
static inline unsigned int __abs(int x) { return x < 0 ? -x : x; }
462-
463-
static inline unsigned long long int __abs(long long int x) {
461+
template <typename T>
462+
static inline typename std::make_unsigned<T>::type __abs(T x) {
463+
static_assert((std::is_signed<T>::value && std::is_integral<T>::value),
464+
"__abs can only accept signed integral type.");
464465
return x < 0 ? -x : x;
465466
}
466467

468+
template <typename T> static inline void __swap(T &x, T &y) {
469+
static_assert(std::is_integral<T>::value,
470+
"__swap can only accept integral type.");
471+
T tmp = x;
472+
x = y;
473+
y = tmp;
474+
}
475+
467476
template <typename Ty1, typename Ty2>
468477
static inline Ty2 __get_bytes_by_index(Ty1 x, size_t idx) {
469478
static_assert(!std::is_signed<Ty1>::value && !std::is_signed<Ty2>::value,

0 commit comments

Comments
 (0)