Skip to content

Commit 37f0b87

Browse files
committed
Merge branch 'sycl' into llvmspirv_pulldown51
2 parents 3bac4c0 + 74af442 commit 37f0b87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1956
-1022
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ approved by an Intel representative.
8181
- A new approval is needed if the PR was updated (e.g. during code review).
8282
- Once the PR is approved and all checks have passed, the pull request is
8383
ready for merge.
84+
- Sometimes unrelated fails can be observed in the PR. It's author
85+
responsibility to find/guess the reason of these fails and post a comment in
86+
the PR with:
87+
- possible reason of fails, ideally with a link to the PR, which caused fails
88+
- link to other PR(s), which expected to fix fails
89+
- person who is currently looking into fails
90+
- link to existing open issue
91+
- if author cannot identify any of these, the minimal action expected is to
92+
open a new [issue](/../../issues)
8493
8594
### Merge
8695
@@ -89,7 +98,8 @@ and merge] and using PR description as the commit message, replacing all
8998
individual comments made per commit. Authors of the change must ensure PR
9099
description is up to date at the merge stage, as sometimes comments addressed
91100
during code reviews can invalidate original PR description. Feel free to ping
92-
@intel/llvm-gatekeepers if your PR is green and can be merged.
101+
@intel/llvm-gatekeepers if your PR is green and can be merged. Note that
102+
gatekeepers will require explanation for any failures observed.
93103
94104
Pulldown from LLVM upstream is done through merge commits to preserve hashes of
95105
the original commits pulled from the LLVM community repository.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Intel LLVM-based projects:
66
- [oneAPI DPC++ compiler](#oneapi-dpc-compiler)
77
- [Late-outline OpenMP and OpenMP Offload](#late-outline-openmp-and-openmp-offload)
88

9+
For general contribution process see [CONTRIBUTING.md](./CONTRIBUTING.md)
10+
911
## oneAPI DPC++ compiler
1012

1113
[![](https://spec.oneapi.io/oneapi-logo-white-scaled.jpg)](https://www.oneapi.io/)

libclc/cmake/modules/AddLibclc.cmake

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ macro(add_libclc_builtin_set arch_suffix)
105105
install(
106106
FILES ${LIBCLC_LIBRARY_OUTPUT_INTDIR}/${obj_suffix}
107107
DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
108-
108+
109109
# Generate remangled variants if requested
110110
if( LIBCLC_GENERATE_REMANGLED_VARIANTS )
111111
set(dummy_in "${CMAKE_BINARY_DIR}/lib/clc/libclc_dummy_in.cc")
@@ -149,6 +149,29 @@ macro(add_libclc_builtin_set arch_suffix)
149149
DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
150150
endforeach()
151151
endforeach()
152+
153+
# For remangler tests we do not care about long_width, or signedness, as it
154+
# performs no substitutions.
155+
# Collect all remangler tests in libclc-remangler-tests to later add
156+
# dependency against check-libclc.
157+
set(libclc-remangler-tests)
158+
set(libclc-remangler-test-no 0)
159+
set(libclc-remangler-target-ir
160+
"$<TARGET_PROPERTY:opt.${obj_suffix},TARGET_FILE>"
161+
"${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.link.${obj_suffix}"
162+
"$<TARGET_PROPERTY:prepare-${obj_suffix},TARGET_FILE>")
163+
foreach(target-ir ${libclc-remangler-target-ir})
164+
math(EXPR libclc-remangler-test-no "${libclc-remangler-test-no}+1")
165+
set(current-test "libclc-remangler-test-${obj_suffix}-${libclc-remangler-test-no}")
166+
add_custom_target(${current-test}
167+
COMMAND libclc-remangler
168+
--long-width=l32
169+
--char-signedness=signed
170+
--input-ir=${target-ir}
171+
${dummy_in} -t -o -
172+
DEPENDS "${builtins_obj_path}" "prepare-${obj_suffix}" "${dummy_in}" libclc-remangler)
173+
list(APPEND libclc-remangler-tests ${current-test})
174+
endforeach()
152175
endif()
153176

154177
# nvptx-- targets don't include workitem builtins

libclc/test/CMakeLists.txt

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,9 @@ foreach( t ${LIBCLC_TARGET_TO_TEST} )
4545
endforeach( t )
4646

4747
if(LIBCLC_GENERATE_REMANGLED_VARIANTS)
48-
# Run remangler in test mode if generating remangled variants and make sure
49-
# it depends on check-libclc target.
50-
# Both `long_widths` and `char_signedness` are set in AddLibclc.cmake and can
51-
# be used here.
52-
foreach(long_width ${long_widths})
53-
foreach(signedness ${char_signedness})
54-
# In `-t` (TestRun) the remangler does not perform any substitutions, it
55-
# needs to make sure that the remangled name matches the original mangled
56-
# one.
57-
set (test_target_name "test-remangled-${long_width}-${signedness}_char")
58-
add_custom_target(${test_target_name}
59-
COMMAND libclc-remangler
60-
--long-width=${long_width}
61-
--char-signedness=${signedness}
62-
--input-ir="$<TARGET_PROPERTY:prepare-${obj_suffix},TARGET_FILE>"
63-
${dummy_in} -t -o -
64-
DEPENDS "${builtins_obj_path}" "prepare-${obj_suffix}" "${dummy_in}" libclc-remangler)
65-
66-
add_dependencies(check-libclc ${test_target_name})
67-
endforeach()
48+
#Now that check-libclc is defined make sure that all remangler targets depend
49+
# on it.
50+
foreach(remangler-test ${libclc-remangler-tests})
51+
add_dependencies(check-libclc ${remangler-test})
6852
endforeach()
6953
endif()

sycl/doc/developer/ContributeToDPCPP.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Contributing to DPC++
22

3+
## General guidelines
4+
5+
Read [CONTRIBUTING.md](/CONTRIBUTING.md) first.
6+
37
## Maintaining stable ABI/API
48

59
All changes made to the DPC++ compiler and runtime library should generally

sycl/include/CL/__spirv/spirv_types.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,22 @@ enum class GroupOperation : uint32_t {
108108
ExclusiveScan = 2
109109
};
110110

111+
#if (SYCL_EXT_ONEAPI_MATRIX_VERSION > 1)
112+
enum class MatrixLayout : uint32_t {
113+
RowMajor = 0,
114+
ColumnMajor = 1,
115+
Packed = 2,
116+
Dynamic = 3
117+
};
118+
#else
111119
enum class MatrixLayout : uint32_t {
112120
RowMajor = 0,
113121
ColumnMajor = 1,
114122
PackedA = 2,
115123
PackedB = 3,
116124
Unused = 4
117125
};
126+
#endif
118127

119128
enum class MatrixUse : uint32_t { MatrixA = 0, MatrixB = 1, Accumulator = 2 };
120129

sycl/include/sycl/detail/defines.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#endif
2222
#endif
2323

24-
#if __has_attribute(sycl_special_class)
24+
#if __has_attribute(sycl_special_class) && (defined __SYCL_DEVICE_ONLY__)
2525
#define __SYCL_SPECIAL_CLASS __attribute__((sycl_special_class))
2626
#else
2727
#define __SYCL_SPECIAL_CLASS

sycl/include/sycl/ext/oneapi/device_global/device_global.hpp

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <sycl/exception.hpp>
1616
#include <sycl/ext/oneapi/device_global/properties.hpp>
1717
#include <sycl/ext/oneapi/properties/properties.hpp>
18+
#include <sycl/pointers.hpp>
1819

1920
#ifdef __SYCL_DEVICE_ONLY__
2021
#define __SYCL_HOST_NOT_SUPPORTED(Op)
@@ -42,9 +43,27 @@ struct HasArrowOperator<
4243
template <typename T, typename PropertyListT, typename = void>
4344
class device_global_base {
4445
protected:
45-
T *usmptr;
46-
T *get_ptr() noexcept { return usmptr; }
47-
const T *get_ptr() const noexcept { return usmptr; }
46+
using pointer_t = typename decorated_global_ptr<T>::pointer;
47+
pointer_t usmptr;
48+
pointer_t get_ptr() noexcept { return usmptr; }
49+
const pointer_t get_ptr() const noexcept { return usmptr; }
50+
51+
public:
52+
template <access::decorated IsDecorated>
53+
multi_ptr<T, access::address_space::global_space, IsDecorated>
54+
get_multi_ptr() noexcept {
55+
__SYCL_HOST_NOT_SUPPORTED("get_multi_ptr()")
56+
return multi_ptr<T, access::address_space::global_space, IsDecorated>{
57+
get_ptr()};
58+
}
59+
60+
template <access::decorated IsDecorated>
61+
multi_ptr<const T, access::address_space::global_space, IsDecorated>
62+
get_multi_ptr() const noexcept {
63+
__SYCL_HOST_NOT_SUPPORTED("get_multi_ptr()")
64+
return multi_ptr<const T, access::address_space::global_space, IsDecorated>{
65+
get_ptr()};
66+
}
4867
};
4968

5069
// Specialization of device_global base class for when device_image_scope is in
@@ -58,6 +77,23 @@ class device_global_base<
5877
T val{};
5978
T *get_ptr() noexcept { return &val; }
6079
const T *get_ptr() const noexcept { return &val; }
80+
81+
public:
82+
template <access::decorated IsDecorated>
83+
multi_ptr<T, access::address_space::global_space, IsDecorated>
84+
get_multi_ptr() noexcept {
85+
__SYCL_HOST_NOT_SUPPORTED("get_multi_ptr()")
86+
return address_space_cast<access::address_space::global_space, IsDecorated,
87+
T>(this->get_ptr());
88+
}
89+
90+
template <access::decorated IsDecorated>
91+
multi_ptr<const T, access::address_space::global_space, IsDecorated>
92+
get_multi_ptr() const noexcept {
93+
__SYCL_HOST_NOT_SUPPORTED("get_multi_ptr()")
94+
return address_space_cast<access::address_space::global_space, IsDecorated,
95+
const T>(this->get_ptr());
96+
}
6197
};
6298
} // namespace detail
6399

@@ -113,22 +149,6 @@ class
113149
device_global &operator=(const device_global &) = delete;
114150
device_global &operator=(const device_global &&) = delete;
115151

116-
template <access::decorated IsDecorated>
117-
multi_ptr<T, access::address_space::global_space, IsDecorated>
118-
get_multi_ptr() noexcept {
119-
__SYCL_HOST_NOT_SUPPORTED("get_multi_ptr()")
120-
return address_space_cast<access::address_space::global_space, IsDecorated>(
121-
this->get_ptr());
122-
}
123-
124-
template <access::decorated IsDecorated>
125-
multi_ptr<const T, access::address_space::global_space, IsDecorated>
126-
get_multi_ptr() const noexcept {
127-
__SYCL_HOST_NOT_SUPPORTED("get_multi_ptr()")
128-
return address_space_cast<access::address_space::global_space, IsDecorated,
129-
const T>(this->get_ptr());
130-
}
131-
132152
T &get() noexcept {
133153
__SYCL_HOST_NOT_SUPPORTED("get()")
134154
return *this->get_ptr();

0 commit comments

Comments
 (0)