From 92004b02af992b6ef5b020243dcb6a43492f3fd8 Mon Sep 17 00:00:00 2001 From: Kamil Felskowski Date: Fri, 5 Sep 2025 12:13:17 +0000 Subject: [PATCH 1/2] [UR][OpenCL] Delete unused copy constructors and assignments --- unified-runtime/source/adapters/opencl/context.hpp | 3 +++ unified-runtime/source/adapters/opencl/device.hpp | 3 +++ unified-runtime/source/adapters/opencl/kernel.hpp | 3 +++ unified-runtime/source/adapters/opencl/memory.hpp | 3 +++ unified-runtime/source/adapters/opencl/platform.hpp | 3 +++ unified-runtime/source/adapters/opencl/queue.hpp | 3 +++ unified-runtime/source/adapters/opencl/sampler.hpp | 3 +++ 7 files changed, 21 insertions(+) diff --git a/unified-runtime/source/adapters/opencl/context.hpp b/unified-runtime/source/adapters/opencl/context.hpp index 237907e3ad5b6..485884ba319f4 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..927928e790703 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..e9b0ba44e83e7 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..288eb7efd4c2e 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..012a5ccdea7ec 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..a4edd59d6c86a 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..3c2123846f875 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); From 5a819d6ac481f86982f366e383dc84d1c5508b9e Mon Sep 17 00:00:00 2001 From: Kamil Felskowski Date: Sun, 7 Sep 2025 21:07:49 +0000 Subject: [PATCH 2/2] Fix formatting --- unified-runtime/source/adapters/opencl/context.hpp | 6 +++--- unified-runtime/source/adapters/opencl/device.hpp | 4 ++-- unified-runtime/source/adapters/opencl/kernel.hpp | 6 +++--- unified-runtime/source/adapters/opencl/memory.hpp | 6 +++--- unified-runtime/source/adapters/opencl/platform.hpp | 4 ++-- unified-runtime/source/adapters/opencl/queue.hpp | 4 ++-- unified-runtime/source/adapters/opencl/sampler.hpp | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/unified-runtime/source/adapters/opencl/context.hpp b/unified-runtime/source/adapters/opencl/context.hpp index 485884ba319f4..4060d17d25982 100644 --- a/unified-runtime/source/adapters/opencl/context.hpp +++ b/unified-runtime/source/adapters/opencl/context.hpp @@ -24,9 +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_(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 927928e790703..a615e5b4fbe8b 100644 --- a/unified-runtime/source/adapters/opencl/device.hpp +++ b/unified-runtime/source/adapters/opencl/device.hpp @@ -23,8 +23,8 @@ 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_(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) diff --git a/unified-runtime/source/adapters/opencl/kernel.hpp b/unified-runtime/source/adapters/opencl/kernel.hpp index e9b0ba44e83e7..bf308a714d245 100644 --- a/unified-runtime/source/adapters/opencl/kernel.hpp +++ b/unified-runtime/source/adapters/opencl/kernel.hpp @@ -26,9 +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_(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 288eb7efd4c2e..025b7f4acef8b 100644 --- a/unified-runtime/source/adapters/opencl/memory.hpp +++ b/unified-runtime/source/adapters/opencl/memory.hpp @@ -22,9 +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_(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 012a5ccdea7ec..306f9ec3ca3d8 100644 --- a/unified-runtime/source/adapters/opencl/platform.hpp +++ b/unified-runtime/source/adapters/opencl/platform.hpp @@ -22,8 +22,8 @@ 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_(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) {} diff --git a/unified-runtime/source/adapters/opencl/queue.hpp b/unified-runtime/source/adapters/opencl/queue.hpp index a4edd59d6c86a..64250570302f0 100644 --- a/unified-runtime/source/adapters/opencl/queue.hpp +++ b/unified-runtime/source/adapters/opencl/queue.hpp @@ -29,8 +29,8 @@ 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_(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) diff --git a/unified-runtime/source/adapters/opencl/sampler.hpp b/unified-runtime/source/adapters/opencl/sampler.hpp index 3c2123846f875..dec5ce2acce77 100644 --- a/unified-runtime/source/adapters/opencl/sampler.hpp +++ b/unified-runtime/source/adapters/opencl/sampler.hpp @@ -21,8 +21,8 @@ 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_(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) {