diff --git a/unified-runtime/source/adapters/opencl/context.hpp b/unified-runtime/source/adapters/opencl/context.hpp index 237907e3ad5b6..4060d17d25982 100644 --- a/unified-runtime/source/adapters/opencl/context.hpp +++ b/unified-runtime/source/adapters/opencl/context.hpp @@ -24,6 +24,9 @@ struct ur_context_handle_t_ : ur::opencl::handle_base { bool IsNativeHandleOwned = true; ur::RefCount RefCount; + ur_context_handle_t_(const ur_context_handle_t_ &) = delete; + ur_context_handle_t_ &operator=(const ur_context_handle_t_ &) = delete; + ur_context_handle_t_(native_type Ctx, uint32_t DevCount, const ur_device_handle_t *phDevices) : handle_base(), CLContext(Ctx), DeviceCount(DevCount) { diff --git a/unified-runtime/source/adapters/opencl/device.hpp b/unified-runtime/source/adapters/opencl/device.hpp index 71adb063964f0..a615e5b4fbe8b 100644 --- a/unified-runtime/source/adapters/opencl/device.hpp +++ b/unified-runtime/source/adapters/opencl/device.hpp @@ -23,6 +23,9 @@ struct ur_device_handle_t_ : ur::opencl::handle_base { bool IsNativeHandleOwned = true; ur::RefCount RefCount; + ur_device_handle_t_(const ur_device_handle_t_ &) = delete; + ur_device_handle_t_ &operator=(const ur_device_handle_t_ &) = delete; + ur_device_handle_t_(native_type Dev, ur_platform_handle_t Plat, ur_device_handle_t Parent) : handle_base(), CLDevice(Dev), Platform(Plat), ParentDevice(Parent) { diff --git a/unified-runtime/source/adapters/opencl/kernel.hpp b/unified-runtime/source/adapters/opencl/kernel.hpp index 23bbe62face79..bf308a714d245 100644 --- a/unified-runtime/source/adapters/opencl/kernel.hpp +++ b/unified-runtime/source/adapters/opencl/kernel.hpp @@ -26,6 +26,9 @@ struct ur_kernel_handle_t_ : ur::opencl::handle_base { clSetKernelArgMemPointerINTEL_fn clSetKernelArgMemPointerINTEL = nullptr; ur::RefCount RefCount; + ur_kernel_handle_t_(const ur_kernel_handle_t_ &) = delete; + ur_kernel_handle_t_ &operator=(const ur_kernel_handle_t_ &) = delete; + ur_kernel_handle_t_(native_type Kernel, ur_program_handle_t Program, ur_context_handle_t Context) : handle_base(), CLKernel(Kernel), Program(Program), Context(Context) { diff --git a/unified-runtime/source/adapters/opencl/memory.hpp b/unified-runtime/source/adapters/opencl/memory.hpp index 847ffafa76021..025b7f4acef8b 100644 --- a/unified-runtime/source/adapters/opencl/memory.hpp +++ b/unified-runtime/source/adapters/opencl/memory.hpp @@ -22,6 +22,9 @@ struct ur_mem_handle_t_ : ur::opencl::handle_base { bool IsNativeHandleOwned = true; ur::RefCount RefCount; + ur_mem_handle_t_(const ur_mem_handle_t_ &) = delete; + ur_mem_handle_t_ &operator=(const ur_mem_handle_t_ &) = delete; + ur_mem_handle_t_(native_type Mem, ur_context_handle_t Ctx) : handle_base(), CLMemory(Mem), Context(Ctx) { urContextRetain(Context); diff --git a/unified-runtime/source/adapters/opencl/platform.hpp b/unified-runtime/source/adapters/opencl/platform.hpp index d82ff973de119..306f9ec3ca3d8 100644 --- a/unified-runtime/source/adapters/opencl/platform.hpp +++ b/unified-runtime/source/adapters/opencl/platform.hpp @@ -22,6 +22,9 @@ struct ur_platform_handle_t_ : ur::opencl::handle_base { std::map SubDevices; std::mutex SubDevicesLock; + ur_platform_handle_t_(const ur_platform_handle_t_ &) = delete; + ur_platform_handle_t_ &operator=(const ur_platform_handle_t_ &) = delete; + ur_platform_handle_t_(native_type Plat) : handle_base(), CLPlatform(Plat) {} ~ur_platform_handle_t_() { diff --git a/unified-runtime/source/adapters/opencl/queue.hpp b/unified-runtime/source/adapters/opencl/queue.hpp index 9456c8ae8618d..64250570302f0 100644 --- a/unified-runtime/source/adapters/opencl/queue.hpp +++ b/unified-runtime/source/adapters/opencl/queue.hpp @@ -29,6 +29,9 @@ struct ur_queue_handle_t_ : ur::opencl::handle_base { ur_event_handle_t LastEvent = nullptr; ur::RefCount RefCount; + ur_queue_handle_t_(const ur_queue_handle_t_ &) = delete; + ur_queue_handle_t_ &operator=(const ur_queue_handle_t_ &) = delete; + ur_queue_handle_t_(native_type Queue, ur_context_handle_t Ctx, ur_device_handle_t Dev, bool InOrder) : handle_base(), CLQueue(Queue), Context(Ctx), Device(Dev), diff --git a/unified-runtime/source/adapters/opencl/sampler.hpp b/unified-runtime/source/adapters/opencl/sampler.hpp index 26a116c8df0f7..dec5ce2acce77 100644 --- a/unified-runtime/source/adapters/opencl/sampler.hpp +++ b/unified-runtime/source/adapters/opencl/sampler.hpp @@ -21,6 +21,9 @@ struct ur_sampler_handle_t_ : ur::opencl::handle_base { bool IsNativeHandleOwned = false; ur::RefCount RefCount; + ur_sampler_handle_t_(const ur_sampler_handle_t_ &) = delete; + ur_sampler_handle_t_ &operator=(const ur_sampler_handle_t_ &) = delete; + ur_sampler_handle_t_(native_type Sampler, ur_context_handle_t Ctx) : handle_base(), CLSampler(Sampler), Context(Ctx) { urContextRetain(Context);