Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions sycl/include/sycl/kernel_bundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,8 @@ __SYCL_EXPORT detail::KernelBundleImplPtr
get_kernel_bundle_impl(const context &Ctx, const std::vector<device> &Devs,
bundle_state State);

inline auto getDeviceComparisonLambda() {
return [](device a, device b) { return a.getNative() != b.getNative(); };
}

inline const std::vector<device>
removeDuplicateDevices(const std::vector<device> &Devs) {
auto compareDevices = getDeviceComparisonLambda();
std::set<device, decltype(compareDevices)> UniqueDeviceSet(
Devs.begin(), Devs.end(), compareDevices);
std::vector<device> UniqueDevices(UniqueDeviceSet.begin(),
UniqueDeviceSet.end());
return UniqueDevices;
}
__SYCL_EXPORT const std::vector<device>
removeDuplicateDevices(const std::vector<device> &Devs);

} // namespace detail

Expand Down
13 changes: 13 additions & 0 deletions sycl/source/kernel_bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ bool kernel_bundle_plain::is_specialization_constant_set(
///// sycl::detail free functions
//////////////////////////////////

const std::vector<device>
removeDuplicateDevices(const std::vector<device> &Devs) {
auto compareDevices = [](device a, device b) {
return getSyclObjImpl(a)->getHandleRef() <
getSyclObjImpl(b)->getHandleRef();
};
std::set<device, decltype(compareDevices)> UniqueDeviceSet(
Devs.begin(), Devs.end(), compareDevices);
std::vector<device> UniqueDevices(UniqueDeviceSet.begin(),
UniqueDeviceSet.end());
return UniqueDevices;
}

kernel_id get_kernel_id_impl(std::string KernelName) {
return detail::ProgramManager::getInstance().getSYCLKernelID(KernelName);
}
Expand Down
1 change: 1 addition & 0 deletions sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -3841,6 +3841,7 @@ _ZN4sycl3_V16detail22get_kernel_bundle_implERKNS0_7contextERKSt6vectorINS0_6devi
_ZN4sycl3_V16detail22has_kernel_bundle_implERKNS0_7contextERKSt6vectorINS0_6deviceESaIS6_EENS0_12bundle_stateE
_ZN4sycl3_V16detail22has_kernel_bundle_implERKNS0_7contextERKSt6vectorINS0_6deviceESaIS6_EERKS5_INS0_9kernel_idESaISB_EENS0_12bundle_stateE
_ZN4sycl3_V16detail22reduGetPreferredWGSizeERSt10shared_ptrINS1_10queue_implEEm
_ZN4sycl3_V16detail22removeDuplicateDevicesERKSt6vectorINS0_6deviceESaIS3_EE
_ZN4sycl3_V16detail23constructorNotificationEPvS2_NS0_6access6targetENS3_4modeERKNS1_13code_locationE
_ZN4sycl3_V16detail23getESIMDDeviceInterfaceEv
_ZN4sycl3_V16detail24find_device_intersectionERKSt6vectorINS0_13kernel_bundleILNS0_12bundle_stateE1EEESaIS5_EE
Expand Down
1 change: 1 addition & 0 deletions sycl/unittests/kernel-and-program/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ add_sycl_unittest(KernelAndProgramTests OBJECT
KernelInfo.cpp
DeviceInfo.cpp
PersistentDeviceCodeCache.cpp
KernelBuildOptions.cpp
)
target_compile_definitions(KernelAndProgramTests PRIVATE -D__SYCL_INTERNAL_API)
1 change: 0 additions & 1 deletion sycl/unittests/misc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ set(sycl_lib_dir $<TARGET_FILE_DIR:sycl>)
add_definitions(-DSYCL_LIB_DIR="${sycl_lib_dir}")
add_sycl_unittest(MiscTests SHARED
CircularBuffer.cpp
KernelBuildOptions.cpp
OsUtils.cpp
)