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
4 changes: 2 additions & 2 deletions sycl/source/detail/context_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ class context_impl : public std::enable_shared_from_this<context_impl> {
};

template <typename T, typename Capabilities>
void GetCapabilitiesIntersectionSet(const std::vector<sycl::device> &Devices,
void GetCapabilitiesIntersectionSet(devices_range Devices,
std::vector<T> &CapabilityList) {
for (const sycl::device &Device : Devices) {
for (device_impl &Device : Devices) {
std::vector<T> NewCapabilityList;
std::vector<T> DeviceCapabilities = Device.get_info<Capabilities>();
std::set_intersection(
Expand Down
13 changes: 7 additions & 6 deletions sycl/source/detail/kernel_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ std::string_view kernel_impl::getName() const {
return MName;
}

bool kernel_impl::isBuiltInKernel(const device &Device) const {
bool kernel_impl::isBuiltInKernel(device_impl &Device) const {
auto BuiltInKernels = Device.get_info<info::device::built_in_kernel_ids>();
if (BuiltInKernels.empty())
return false;
Expand All @@ -116,9 +116,10 @@ bool kernel_impl::isBuiltInKernel(const device &Device) const {
void kernel_impl::checkIfValidForNumArgsInfoQuery() const {
if (isInteropOrSourceBased())
return;
auto Devices = MKernelBundleImpl->get_devices();
if (std::any_of(Devices.begin(), Devices.end(),
[this](device &Device) { return isBuiltInKernel(Device); }))
devices_range Devices = MKernelBundleImpl->get_devices();
if (std::any_of(Devices.begin(), Devices.end(), [this](device_impl &Device) {
return isBuiltInKernel(Device);
}))
return;

throw sycl::exception(
Expand Down Expand Up @@ -149,8 +150,8 @@ kernel_impl::get_backend_info<info::platform::version>() const {
"the info::platform::version info descriptor can "
"only be queried with an OpenCL backend");
}
auto Devices = MKernelBundleImpl->get_devices();
return Devices[0].get_platform().get_info<info::platform::version>();
devices_range Devices = MKernelBundleImpl->get_devices();
return Devices.front().get_platform().get_info<info::platform::version>();
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/kernel_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class kernel_impl {
std::mutex *MCacheMutex = nullptr;
mutable std::string MName;

bool isBuiltInKernel(const device &Device) const;
bool isBuiltInKernel(device_impl &Device) const;
void checkIfValidForNumArgsInfoQuery() const;

/// Check if the occupancy limits are exceeded for the given kernel launch
Expand Down Expand Up @@ -327,7 +327,7 @@ kernel_impl::get_info(const device &Device) const {
Param, info::kernel_device_specific::global_work_size>) {
bool isDeviceCustom = Device.get_info<info::device::device_type>() ==
info::device_type::custom;
if (!isDeviceCustom && !isBuiltInKernel(Device))
if (!isDeviceCustom && !isBuiltInKernel(*getSyclObjImpl(Device)))
throw exception(
sycl::make_error_code(errc::invalid),
"info::kernel_device_specific::global_work_size descriptor may only "
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/queue_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
int Idx = get_property<ext::intel::property::queue::compute_index>()
.get_index();
int NumIndices =
createSyclObjFromImpl<device>(Device)
Device
.get_info<ext::intel::info::device::max_compute_queue_indices>();
if (Idx < 0 || Idx >= NumIndices)
throw sycl::exception(
Expand Down
12 changes: 6 additions & 6 deletions sycl/source/detail/syclbin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// LLVMObject.

#include <detail/compiler.hpp>
#include <detail/device_impl.hpp>
#include <detail/program_manager/program_manager.hpp>
#include <detail/syclbin.hpp>

Expand Down Expand Up @@ -389,14 +390,13 @@ SYCLBINBinaries::convertAbstractModuleProperties(SYCLBIN::AbstractModule &AM) {
}

std::vector<const RTDeviceBinaryImage *>
SYCLBINBinaries::getBestCompatibleImages(const device &Dev) {
detail::device_impl &DevImpl = *getSyclObjImpl(Dev);
SYCLBINBinaries::getBestCompatibleImages(device_impl &Dev) {
auto SelectCompatibleImages =
[&](const std::vector<RTDeviceBinaryImage> &Imgs) {
std::vector<const RTDeviceBinaryImage *> CompatImgs;
for (const RTDeviceBinaryImage &Img : Imgs)
if (doesDevSupportDeviceRequirements(DevImpl, Img) &&
doesImageTargetMatchDevice(Img, DevImpl))
if (doesDevSupportDeviceRequirements(Dev, Img) &&
doesImageTargetMatchDevice(Img, Dev))
CompatImgs.push_back(&Img);
return CompatImgs;
};
Expand All @@ -412,9 +412,9 @@ SYCLBINBinaries::getBestCompatibleImages(const device &Dev) {
}

std::vector<const RTDeviceBinaryImage *>
SYCLBINBinaries::getBestCompatibleImages(const std::vector<device> &Devs) {
SYCLBINBinaries::getBestCompatibleImages(devices_range Devs) {
std::set<const RTDeviceBinaryImage *> Images;
for (const device &Dev : Devs) {
for (device_impl &Dev : Devs) {
std::vector<const RTDeviceBinaryImage *> BestImagesForDev =
getBestCompatibleImages(Dev);
Images.insert(BestImagesForDev.cbegin(), BestImagesForDev.cend());
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/syclbin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ struct SYCLBINBinaries {
SYCLBINBinaries(const char *SYCLBINContent, size_t SYCLBINSize);

std::vector<const RTDeviceBinaryImage *>
getBestCompatibleImages(const device &Dev);
getBestCompatibleImages(device_impl &Dev);
std::vector<const RTDeviceBinaryImage *>
getBestCompatibleImages(const std::vector<device> &Dev);
getBestCompatibleImages(devices_range Dev);

uint8_t getState() const noexcept {
PropertySet &GlobalMetadata =
Expand Down