Skip to content

Commit 92004b0

Browse files
committed
[UR][OpenCL] Delete unused copy constructors and assignments
1 parent 0433e4d commit 92004b0

File tree

7 files changed

+21
-0
lines changed

7 files changed

+21
-0
lines changed

unified-runtime/source/adapters/opencl/context.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ struct ur_context_handle_t_ : ur::opencl::handle_base {
2424
bool IsNativeHandleOwned = true;
2525
ur::RefCount RefCount;
2626

27+
ur_context_handle_t_(const ur_context_handle_t_&) = delete;
28+
ur_context_handle_t_& operator=(const ur_context_handle_t_&) = delete;
29+
2730
ur_context_handle_t_(native_type Ctx, uint32_t DevCount,
2831
const ur_device_handle_t *phDevices)
2932
: handle_base(), CLContext(Ctx), DeviceCount(DevCount) {

unified-runtime/source/adapters/opencl/device.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ struct ur_device_handle_t_ : ur::opencl::handle_base {
2323
bool IsNativeHandleOwned = true;
2424
ur::RefCount RefCount;
2525

26+
ur_device_handle_t_(const ur_device_handle_t_&) = delete;
27+
ur_device_handle_t_& operator=(const ur_device_handle_t_&) = delete;
28+
2629
ur_device_handle_t_(native_type Dev, ur_platform_handle_t Plat,
2730
ur_device_handle_t Parent)
2831
: handle_base(), CLDevice(Dev), Platform(Plat), ParentDevice(Parent) {

unified-runtime/source/adapters/opencl/kernel.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ struct ur_kernel_handle_t_ : ur::opencl::handle_base {
2626
clSetKernelArgMemPointerINTEL_fn clSetKernelArgMemPointerINTEL = nullptr;
2727
ur::RefCount RefCount;
2828

29+
ur_kernel_handle_t_(const ur_kernel_handle_t_&) = delete;
30+
ur_kernel_handle_t_& operator=(const ur_kernel_handle_t_&) = delete;
31+
2932
ur_kernel_handle_t_(native_type Kernel, ur_program_handle_t Program,
3033
ur_context_handle_t Context)
3134
: handle_base(), CLKernel(Kernel), Program(Program), Context(Context) {

unified-runtime/source/adapters/opencl/memory.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct ur_mem_handle_t_ : ur::opencl::handle_base {
2222
bool IsNativeHandleOwned = true;
2323
ur::RefCount RefCount;
2424

25+
ur_mem_handle_t_(const ur_mem_handle_t_&) = delete;
26+
ur_mem_handle_t_& operator=(const ur_mem_handle_t_&) = delete;
27+
2528
ur_mem_handle_t_(native_type Mem, ur_context_handle_t Ctx)
2629
: handle_base(), CLMemory(Mem), Context(Ctx) {
2730
urContextRetain(Context);

unified-runtime/source/adapters/opencl/platform.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct ur_platform_handle_t_ : ur::opencl::handle_base {
2222
std::map<cl_device_id, ur_device_handle_t> SubDevices;
2323
std::mutex SubDevicesLock;
2424

25+
ur_platform_handle_t_(const ur_platform_handle_t_&) = delete;
26+
ur_platform_handle_t_& operator=(const ur_platform_handle_t_&) = delete;
27+
2528
ur_platform_handle_t_(native_type Plat) : handle_base(), CLPlatform(Plat) {}
2629

2730
~ur_platform_handle_t_() {

unified-runtime/source/adapters/opencl/queue.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ struct ur_queue_handle_t_ : ur::opencl::handle_base {
2929
ur_event_handle_t LastEvent = nullptr;
3030
ur::RefCount RefCount;
3131

32+
ur_queue_handle_t_(const ur_queue_handle_t_&) = delete;
33+
ur_queue_handle_t_& operator=(const ur_queue_handle_t_&) = delete;
34+
3235
ur_queue_handle_t_(native_type Queue, ur_context_handle_t Ctx,
3336
ur_device_handle_t Dev, bool InOrder)
3437
: handle_base(), CLQueue(Queue), Context(Ctx), Device(Dev),

unified-runtime/source/adapters/opencl/sampler.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ struct ur_sampler_handle_t_ : ur::opencl::handle_base {
2121
bool IsNativeHandleOwned = false;
2222
ur::RefCount RefCount;
2323

24+
ur_sampler_handle_t_(const ur_sampler_handle_t_&) = delete;
25+
ur_sampler_handle_t_& operator=(const ur_sampler_handle_t_&) = delete;
26+
2427
ur_sampler_handle_t_(native_type Sampler, ur_context_handle_t Ctx)
2528
: handle_base(), CLSampler(Sampler), Context(Ctx) {
2629
urContextRetain(Context);

0 commit comments

Comments
 (0)