Skip to content

Commit bbed9a0

Browse files
committed
apply changes from #19057
1 parent 9b3fc77 commit bbed9a0

20 files changed

+41
-41
lines changed

unified-runtime/source/adapters/opencl/adapter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ urAdapterGet(uint32_t NumEntries, ur_adapter_handle_t *phAdapters,
7878
}
7979

8080
auto &adapter = *phAdapters;
81-
adapter->getRefCount().increment();
81+
adapter->getRefCount().retain();
8282
}
8383

8484
if (pNumAdapters) {
@@ -90,13 +90,13 @@ urAdapterGet(uint32_t NumEntries, ur_adapter_handle_t *phAdapters,
9090

9191
UR_APIEXPORT ur_result_t UR_APICALL
9292
urAdapterRetain(ur_adapter_handle_t hAdapter) {
93-
hAdapter->getRefCount().increment();
93+
hAdapter->getRefCount().retain();
9494
return UR_RESULT_SUCCESS;
9595
}
9696

9797
UR_APIEXPORT ur_result_t UR_APICALL
9898
urAdapterRelease(ur_adapter_handle_t hAdapter) {
99-
if (hAdapter->getRefCount().decrementAndTest()) {
99+
if (hAdapter->getRefCount().release()) {
100100
delete hAdapter;
101101
}
102102
return UR_RESULT_SUCCESS;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ struct ur_adapter_handle_t_ : ur::opencl::handle_base {
3838
#include "core_functions.def"
3939
#undef CL_CORE_FUNCTION
4040

41-
URRefCount &getRefCount() noexcept { return RefCount; }
41+
ur::RefCount &getRefCount() noexcept { return RefCount; }
4242

4343
private:
44-
URRefCount RefCount;
44+
ur::RefCount RefCount;
4545
};
4646

4747
namespace ur {

unified-runtime/source/adapters/opencl/command_buffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp(
108108

109109
UR_APIEXPORT ur_result_t UR_APICALL
110110
urCommandBufferRetainExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
111-
hCommandBuffer->getRefCount().increment();
111+
hCommandBuffer->getRefCount().retain();
112112
return UR_RESULT_SUCCESS;
113113
}
114114

115115
UR_APIEXPORT ur_result_t UR_APICALL
116116
urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
117-
if (hCommandBuffer->getRefCount().decrementAndTest()) {
117+
if (hCommandBuffer->getRefCount().release()) {
118118
delete hCommandBuffer;
119119
}
120120

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ struct ur_exp_command_buffer_handle_t_ : ur::opencl::handle_base {
6969

7070
~ur_exp_command_buffer_handle_t_();
7171

72-
URRefCount &getRefCount() noexcept { return RefCount; }
72+
ur::RefCount &getRefCount() noexcept { return RefCount; }
7373

7474
private:
75-
URRefCount RefCount;
75+
ur::RefCount RefCount;
7676
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName,
117117

118118
UR_APIEXPORT ur_result_t UR_APICALL
119119
urContextRelease(ur_context_handle_t hContext) {
120-
if (hContext->getRefCount().decrementAndTest()) {
120+
if (hContext->getRefCount().release()) {
121121
delete hContext;
122122
}
123123

@@ -126,7 +126,7 @@ urContextRelease(ur_context_handle_t hContext) {
126126

127127
UR_APIEXPORT ur_result_t UR_APICALL
128128
urContextRetain(ur_context_handle_t hContext) {
129-
hContext->getRefCount().increment();
129+
hContext->getRefCount().retain();
130130
return UR_RESULT_SUCCESS;
131131
}
132132

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ struct ur_context_handle_t_ : ur::opencl::handle_base {
5050
}
5151
}
5252

53-
URRefCount &getRefCount() noexcept { return RefCount; }
53+
ur::RefCount &getRefCount() noexcept { return RefCount; }
5454

5555
private:
56-
URRefCount RefCount;
56+
ur::RefCount RefCount;
5757
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition(
15611561
// Root devices ref count are unchanged through out the program lifetime.
15621562
UR_APIEXPORT ur_result_t UR_APICALL urDeviceRetain(ur_device_handle_t hDevice) {
15631563
if (hDevice->ParentDevice) {
1564-
hDevice->getRefCount().increment();
1564+
hDevice->getRefCount().retain();
15651565
}
15661566

15671567
return UR_RESULT_SUCCESS;
@@ -1571,7 +1571,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceRetain(ur_device_handle_t hDevice) {
15711571
UR_APIEXPORT ur_result_t UR_APICALL
15721572
urDeviceRelease(ur_device_handle_t hDevice) {
15731573
if (hDevice->ParentDevice) {
1574-
if (hDevice->getRefCount().decrementAndTest()) {
1574+
if (hDevice->getRefCount().release()) {
15751575
delete hDevice;
15761576
}
15771577
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ struct ur_device_handle_t_ : ur::opencl::handle_base {
108108
return UR_RESULT_SUCCESS;
109109
}
110110

111-
URRefCount &getRefCount() noexcept { return RefCount; }
111+
ur::RefCount &getRefCount() noexcept { return RefCount; }
112112

113113
private:
114-
URRefCount RefCount;
114+
ur::RefCount RefCount;
115115
};

unified-runtime/source/adapters/opencl/event.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetNativeHandle(
136136
}
137137

138138
UR_APIEXPORT ur_result_t UR_APICALL urEventRelease(ur_event_handle_t hEvent) {
139-
if (hEvent->getRefCount().decrementAndTest()) {
139+
if (hEvent->getRefCount().release()) {
140140
delete hEvent;
141141
}
142142
return UR_RESULT_SUCCESS;
143143
}
144144

145145
UR_APIEXPORT ur_result_t UR_APICALL urEventRetain(ur_event_handle_t hEvent) {
146-
hEvent->getRefCount().increment();
146+
hEvent->getRefCount().retain();
147147
return UR_RESULT_SUCCESS;
148148
}
149149

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ struct ur_event_handle_t_ : ur::opencl::handle_base {
5454
return UR_RESULT_SUCCESS;
5555
}
5656

57-
URRefCount &getRefCount() noexcept { return RefCount; }
57+
ur::RefCount &getRefCount() noexcept { return RefCount; }
5858

5959
private:
60-
URRefCount RefCount;
60+
ur::RefCount RefCount;
6161
};
6262

6363
inline cl_event *ifUrEvent(ur_event_handle_t *ReturnedEvent, cl_event &Event) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,13 @@ urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice,
343343
}
344344

345345
UR_APIEXPORT ur_result_t UR_APICALL urKernelRetain(ur_kernel_handle_t hKernel) {
346-
hKernel->getRefCount().increment();
346+
hKernel->getRefCount().retain();
347347
return UR_RESULT_SUCCESS;
348348
}
349349

350350
UR_APIEXPORT ur_result_t UR_APICALL
351351
urKernelRelease(ur_kernel_handle_t hKernel) {
352-
if (hKernel->getRefCount().decrementAndTest()) {
352+
if (hKernel->getRefCount().release()) {
353353
delete hKernel;
354354
}
355355
return UR_RESULT_SUCCESS;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ struct ur_kernel_handle_t_ : ur::opencl::handle_base {
5050
ur_context_handle_t Context,
5151
ur_kernel_handle_t &Kernel);
5252

53-
URRefCount &getRefCount() noexcept { return RefCount; }
53+
ur::RefCount &getRefCount() noexcept { return RefCount; }
5454

5555
private:
56-
URRefCount RefCount;
56+
ur::RefCount RefCount;
5757
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
569569
}
570570

571571
UR_APIEXPORT ur_result_t UR_APICALL urMemRetain(ur_mem_handle_t hMem) {
572-
hMem->getRefCount().increment();
572+
hMem->getRefCount().retain();
573573
return UR_RESULT_SUCCESS;
574574
}
575575

576576
UR_APIEXPORT ur_result_t UR_APICALL urMemRelease(ur_mem_handle_t hMem) {
577-
if (hMem->getRefCount().decrementAndTest()) {
577+
if (hMem->getRefCount().release()) {
578578
delete hMem;
579579
}
580580
return UR_RESULT_SUCCESS;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ struct ur_mem_handle_t_ : ur::opencl::handle_base {
3737
ur_context_handle_t Ctx,
3838
ur_mem_handle_t &Mem);
3939

40-
URRefCount &getRefCount() noexcept { return RefCount; }
40+
ur::RefCount &getRefCount() noexcept { return RefCount; }
4141

4242
private:
43-
URRefCount RefCount;
43+
ur::RefCount RefCount;
4444
};

unified-runtime/source/adapters/opencl/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,13 @@ urProgramGetBuildInfo(ur_program_handle_t hProgram, ur_device_handle_t hDevice,
383383

384384
UR_APIEXPORT ur_result_t UR_APICALL
385385
urProgramRetain(ur_program_handle_t hProgram) {
386-
hProgram->getRefCount().increment();
386+
hProgram->getRefCount().retain();
387387
return UR_RESULT_SUCCESS;
388388
}
389389

390390
UR_APIEXPORT ur_result_t UR_APICALL
391391
urProgramRelease(ur_program_handle_t hProgram) {
392-
if (hProgram->getRefCount().decrementAndTest()) {
392+
if (hProgram->getRefCount().release()) {
393393
delete hProgram;
394394
}
395395
return UR_RESULT_SUCCESS;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ struct ur_program_handle_t_ : ur::opencl::handle_base {
4343
ur_context_handle_t Context,
4444
ur_program_handle_t &Program);
4545

46-
URRefCount &getRefCount() noexcept { return RefCount; }
46+
ur::RefCount &getRefCount() noexcept { return RefCount; }
4747

4848
private:
49-
URRefCount RefCount;
49+
ur::RefCount RefCount;
5050
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueFlush(ur_queue_handle_t hQueue) {
289289
}
290290

291291
UR_APIEXPORT ur_result_t UR_APICALL urQueueRetain(ur_queue_handle_t hQueue) {
292-
hQueue->getRefCount().increment();
292+
hQueue->getRefCount().retain();
293293
return UR_RESULT_SUCCESS;
294294
}
295295

296296
UR_APIEXPORT ur_result_t UR_APICALL urQueueRelease(ur_queue_handle_t hQueue) {
297-
if (hQueue->getRefCount().decrementAndTest()) {
297+
if (hQueue->getRefCount().release()) {
298298
delete hQueue;
299299
}
300300
return UR_RESULT_SUCCESS;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ struct ur_queue_handle_t_ : ur::opencl::handle_base {
6868
return UR_RESULT_SUCCESS;
6969
}
7070

71-
URRefCount &getRefCount() noexcept { return RefCount; }
71+
ur::RefCount &getRefCount() noexcept { return RefCount; }
7272

7373
private:
74-
URRefCount RefCount;
74+
ur::RefCount RefCount;
7575
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ urSamplerGetInfo(ur_sampler_handle_t hSampler, ur_sampler_info_t propName,
221221

222222
UR_APIEXPORT ur_result_t UR_APICALL
223223
urSamplerRetain(ur_sampler_handle_t hSampler) {
224-
hSampler->getRefCount().increment();
224+
hSampler->getRefCount().retain();
225225
return UR_RESULT_SUCCESS;
226226
}
227227

228228
UR_APIEXPORT ur_result_t UR_APICALL
229229
urSamplerRelease(ur_sampler_handle_t hSampler) {
230-
if (hSampler->getRefCount().decrementAndTest()) {
230+
if (hSampler->getRefCount().release()) {
231231
delete hSampler;
232232
}
233233
return UR_RESULT_SUCCESS;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct ur_sampler_handle_t_ : ur::opencl::handle_base {
3232
}
3333
}
3434

35-
URRefCount &getRefCount() noexcept { return RefCount; }
35+
ur::RefCount &getRefCount() noexcept { return RefCount; }
3636

3737
private:
38-
URRefCount RefCount;
38+
ur::RefCount RefCount;
3939
};

0 commit comments

Comments
 (0)