Skip to content

Commit

Permalink
[SYCL][NFC] Fix warnings in queue_impl.* and device_binary_image.* (#…
Browse files Browse the repository at this point in the history
…13021)

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
  • Loading branch information
KseniyaTikhomirova committed Mar 18, 2024
1 parent 0906022 commit 0643862
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions sycl/source/detail/device_binary_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ RTDeviceBinaryImage::getProperty(const char *PropName) const {
}

void RTDeviceBinaryImage::init(pi_device_binary Bin) {
// Bin != nullptr is guaranteed here.
this->Bin = Bin;
// If device binary image format wasn't set by its producer, then can't change
// now, because 'Bin' data is part of the executable image loaded into memory
Expand All @@ -177,8 +178,7 @@ void RTDeviceBinaryImage::init(pi_device_binary Bin) {
DeviceRequirements.init(Bin, __SYCL_PI_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS);
HostPipes.init(Bin, __SYCL_PI_PROPERTY_SET_SYCL_HOST_PIPES);

if (Bin)
ImageId = ImageCounter++;
ImageId = ImageCounter++;
}

std::atomic<uintptr_t> RTDeviceBinaryImage::ImageCounter = 1;
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/device_binary_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class RTDeviceBinaryImage {

private:
static std::atomic<uintptr_t> ImageCounter;
uintptr_t ImageId;
uintptr_t ImageId = 0;
};

// Dynamically allocated device binary image, which de-allocates its binary
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/queue_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ event queue_impl::submitMemOpHelper(const std::shared_ptr<queue_impl> &Self,

// If we have a command graph set we need to capture the op through the
// handler rather than by-passing the scheduler.
if (!MGraph.lock() &&
if (MGraph.expired() &&
areEventsSafeForSchedulerBypass(ExpandedDepEvents, MContext)) {
if (MSupportsDiscardingPiEvents) {
MemOpFunc(MemOpArgs..., getPIEvents(ExpandedDepEvents),
Expand All @@ -360,7 +360,7 @@ event queue_impl::submitMemOpHelper(const std::shared_ptr<queue_impl> &Self,

if (isInOrder()) {
auto &EventToStoreIn =
MGraph.lock() ? MGraphLastEventPtr : MLastEventPtr;
MGraph.expired() ? MLastEventPtr : MGraphLastEventPtr;
EventToStoreIn = EventImpl;
}
// Track only if we won't be able to handle it with piQueueFinish.
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/queue_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class queue_impl {
/// \param PropList is a list of properties to use for queue construction.
queue_impl(const DeviceImplPtr &Device, const async_handler &AsyncHandler,
const property_list &PropList)
: queue_impl(Device, getDefaultOrNew(Device), AsyncHandler, PropList){};
: queue_impl(Device, getDefaultOrNew(Device), AsyncHandler, PropList) {};

/// Constructs a SYCL queue with an async_handler and property_list provided
/// form a device and a context.
Expand Down Expand Up @@ -767,7 +767,7 @@ class queue_impl {
// the RT but will not be passed to the backend. See getPIEvents in
// Command.
auto &EventToBuildDeps =
MGraph.lock() ? MGraphLastEventPtr : MLastEventPtr;
MGraph.expired() ? MLastEventPtr : MGraphLastEventPtr;
if (EventToBuildDeps)
Handler.depends_on(
createSyclObjFromImpl<sycl::event>(EventToBuildDeps));
Expand Down

0 comments on commit 0643862

Please sign in to comment.