Skip to content

[SYCL] Fix DAE by avoiding creation of obsolete device images #4977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 24, 2021
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
8 changes: 8 additions & 0 deletions sycl/include/CL/sycl/detail/device_binary_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ class RTDeviceBinaryImage : public pi::DeviceBinaryImage {
: pi::DeviceBinaryImage(), ModuleHandle(ModuleHandle) {}
RTDeviceBinaryImage(pi_device_binary Bin, OSModuleHandle ModuleHandle)
: pi::DeviceBinaryImage(Bin), ModuleHandle(ModuleHandle) {}
// Explicitly delete copy constructor/operator= to avoid unintentional copies
RTDeviceBinaryImage(const RTDeviceBinaryImage &) = delete;
RTDeviceBinaryImage &operator=(const RTDeviceBinaryImage &) = delete;
// Explicitly retain move constructors to facilitate potential moves across
// collections
RTDeviceBinaryImage(RTDeviceBinaryImage &&) = default;
RTDeviceBinaryImage &operator=(RTDeviceBinaryImage &&) = default;

OSModuleHandle getOSModuleHandle() const { return ModuleHandle; }

~RTDeviceBinaryImage() override {}
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ device_image_plain ProgramManager::build(const device_image_plain &DeviceImage,
SerializedObj SpecConsts = InputImpl->get_spec_const_blob_ref();

// TODO: Unify this code with getBuiltPIProgram
auto BuildF = [this, &Context, Img, &Devs, &CompileOpts, &LinkOpts,
auto BuildF = [this, &Context, &Img, &Devs, &CompileOpts, &LinkOpts,
&InputImpl, SpecConsts] {
applyOptionsFromImage(CompileOpts, LinkOpts, Img);
ContextImplPtr ContextImpl = getSyclObjImpl(Context);
Expand Down