Skip to content

Commit 228dd16

Browse files
authored
Bump clang-format from 18.1.8 to 19.1.6 (#23346)
To replace #23327
1 parent d9cd27a commit 228dd16

File tree

20 files changed

+68
-82
lines changed

20 files changed

+68
-82
lines changed

include/onnxruntime/core/common/profiler_common.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class EpProfiler {
8181
virtual ~EpProfiler() = default;
8282
virtual bool StartProfiling(TimePoint profiling_start_time) = 0; // called when profiling starts
8383
virtual void EndProfiling(TimePoint start_time, Events& events) = 0; // called when profiling ends, save all captures numbers to "events"
84-
virtual void Start(uint64_t){}; // called before op start, accept an id as argument to identify the op
85-
virtual void Stop(uint64_t){}; // called after op stop, accept an id as argument to identify the op
84+
virtual void Start(uint64_t) {} // called before op start, accept an id as argument to identify the op
85+
virtual void Stop(uint64_t) {} // called after op stop, accept an id as argument to identify the op
8686
};
8787

8888
// Demangle C++ symbols

include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,18 @@ class ThreadPoolProfiler {
218218
WAIT_REVOKE,
219219
MAX_EVENT
220220
};
221-
ThreadPoolProfiler(int, const CHAR_TYPE*) {};
221+
ThreadPoolProfiler(int, const CHAR_TYPE*) {}
222222
~ThreadPoolProfiler() = default;
223223
ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(ThreadPoolProfiler);
224-
void Start() {};
224+
void Start() {}
225225
std::string Stop() { return "not available for minimal build"; }
226-
void LogStart() {};
227-
void LogEnd(ThreadPoolEvent){};
228-
void LogEndAndStart(ThreadPoolEvent){};
229-
void LogStartAndCoreAndBlock(std::ptrdiff_t){};
230-
void LogCoreAndBlock(std::ptrdiff_t){};
231-
void LogThreadId(int) {};
232-
void LogRun(int) {};
226+
void LogStart() {}
227+
void LogEnd(ThreadPoolEvent) {}
228+
void LogEndAndStart(ThreadPoolEvent) {}
229+
void LogStartAndCoreAndBlock(std::ptrdiff_t) {}
230+
void LogCoreAndBlock(std::ptrdiff_t) {}
231+
void LogThreadId(int) {}
232+
void LogRun(int) {}
233233
std::string DumpChildThreadStat() { return {}; }
234234
};
235235
#else

js/react_native/e2e/ios/MNISTDataHandler.mm

+2-8
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ @implementation MNISTDataHandler
4646

4747
// It gets raw input data, which can be uri or byte array and others,
4848
// returns cooked data formatted as input of a model.
49-
RCT_EXPORT_METHOD(preprocess
50-
: (NSString*)uri resolve
51-
: (RCTPromiseResolveBlock)resolve reject
52-
: (RCTPromiseRejectBlock)reject) {
49+
RCT_EXPORT_METHOD(preprocess : (NSString*)uri resolve : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) {
5350
@try {
5451
NSDictionary* inputDataMap = [self preprocess:uri];
5552
resolve(inputDataMap);
@@ -60,10 +57,7 @@ @implementation MNISTDataHandler
6057

6158
// It gets a result from onnxruntime and a duration of session time for input data,
6259
// returns output data formatted as React Native map.
63-
RCT_EXPORT_METHOD(postprocess
64-
: (NSDictionary*)result resolve
65-
: (RCTPromiseResolveBlock)resolve reject
66-
: (RCTPromiseRejectBlock)reject) {
60+
RCT_EXPORT_METHOD(postprocess : (NSDictionary*)result resolve : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) {
6761
@try {
6862
NSDictionary* cookedMap = [self postprocess:result];
6963
resolve(cookedMap);

js/react_native/ios/OnnxruntimeModule.mm

+4-21
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ - (void)setBlobManager:(RCTBlobManager*)manager {
7373
* @param reject callback for returning an error back to react native js
7474
* @note when run() is called, the same modelPath must be passed into the first parameter.
7575
*/
76-
RCT_EXPORT_METHOD(loadModel
77-
: (NSString*)modelPath options
78-
: (NSDictionary*)options resolver
79-
: (RCTPromiseResolveBlock)resolve rejecter
80-
: (RCTPromiseRejectBlock)reject) {
76+
RCT_EXPORT_METHOD(loadModel : (NSString*)modelPath options : (NSDictionary*)options resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
8177
@try {
8278
NSDictionary* resultMap = [self loadModel:modelPath options:options];
8379
resolve(resultMap);
@@ -95,11 +91,7 @@ - (void)setBlobManager:(RCTBlobManager*)manager {
9591
* @param reject callback for returning an error back to react native js
9692
* @note when run() is called, the same modelPath must be passed into the first parameter.
9793
*/
98-
RCT_EXPORT_METHOD(loadModelFromBlob
99-
: (NSDictionary*)modelDataBlob options
100-
: (NSDictionary*)options resolver
101-
: (RCTPromiseResolveBlock)resolve rejecter
102-
: (RCTPromiseRejectBlock)reject) {
94+
RCT_EXPORT_METHOD(loadModelFromBlob : (NSDictionary*)modelDataBlob options : (NSDictionary*)options resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
10395
@try {
10496
[self checkBlobManager];
10597
NSString* blobId = [modelDataBlob objectForKey:@"blobId"];
@@ -121,10 +113,7 @@ - (void)setBlobManager:(RCTBlobManager*)manager {
121113
* @param resolve callback for returning output back to react native js
122114
* @param reject callback for returning an error back to react native js
123115
*/
124-
RCT_EXPORT_METHOD(dispose
125-
: (NSString*)key resolver
126-
: (RCTPromiseResolveBlock)resolve rejecter
127-
: (RCTPromiseRejectBlock)reject) {
116+
RCT_EXPORT_METHOD(dispose : (NSString*)key resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
128117
@try {
129118
[self dispose:key];
130119
resolve(nil);
@@ -143,13 +132,7 @@ - (void)setBlobManager:(RCTBlobManager*)manager {
143132
* @param resolve callback for returning an inference result back to react native js
144133
* @param reject callback for returning an error back to react native js
145134
*/
146-
RCT_EXPORT_METHOD(run
147-
: (NSString*)url input
148-
: (NSDictionary*)input output
149-
: (NSArray*)output options
150-
: (NSDictionary*)options resolver
151-
: (RCTPromiseResolveBlock)resolve rejecter
152-
: (RCTPromiseRejectBlock)reject) {
135+
RCT_EXPORT_METHOD(run : (NSString*)url input : (NSDictionary*)input output : (NSArray*)output options : (NSDictionary*)options resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
153136
@try {
154137
NSDictionary* resultMap = [self run:url input:input output:output options:options];
155138
resolve(resultMap);

js/react_native/ios/OnnxruntimeModuleTest/OnnxruntimeModuleTest.mm

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ - (void)testOnnxruntimeModule_AppendCoreml {
144144
XCTAssertEqualObjects(outputNames[0], @"output");
145145
}
146146

147-
{ [onnxruntimeModule dispose:sessionKey]; }
147+
{
148+
[onnxruntimeModule dispose:sessionKey];
149+
}
148150
}
149151

150152
@end

onnxruntime/core/graph/graph.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ namespace onnxruntime {
5050
#define NO_CHANGE_ON_SYNC_FLAG(...) \
5151
do { \
5252
const bool sync_needed = GraphProtoSyncNeeded(); \
53-
{ __VA_ARGS__; } \
53+
{ \
54+
__VA_ARGS__; \
55+
} \
5456
GraphProtoSyncNeeded(sync_needed); \
5557
} while (0)
5658

onnxruntime/core/providers/cpu/element_wise_ranged_transform.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ElementWiseRangedTransform<T>::~ElementWiseRangedTransform() {
5656
Status Init(const onnxruntime::NodeAttributes& attributes) { \
5757
return (GetFloatParam(#X, attributes, X)); \
5858
} \
59-
GSL_SUPPRESS(r.11) \
59+
GSL_SUPPRESS(r.11) \
6060
ElementWiseRangedTransform<T>* Copy() const final { \
6161
using T1 = typename std::remove_pointer<decltype(this)>::type; \
6262
using T2 = typename std::remove_const<T1>::type; \
@@ -71,7 +71,7 @@ ElementWiseRangedTransform<T>::~ElementWiseRangedTransform() {
7171
ORT_RETURN_IF_ERROR(GetFloatParam(#Y, attributes, Y)); \
7272
return Status::OK(); \
7373
} \
74-
GSL_SUPPRESS(r.11) \
74+
GSL_SUPPRESS(r.11) \
7575
ElementWiseRangedTransform<T>* Copy() const final { \
7676
using T1 = typename std::remove_pointer<decltype(this)>::type; \
7777
using T2 = typename std::remove_const<T1>::type; \

onnxruntime/core/providers/cuda/cuda_profiler.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class CudaProfiler final : public EpProfiler {
3333
ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(CudaProfiler);
3434
~CudaProfiler() {}
3535
bool StartProfiling(TimePoint) override { return true; }
36-
void EndProfiling(TimePoint, Events&) override {};
37-
void Start(uint64_t) override{};
38-
void Stop(uint64_t) override{};
36+
void EndProfiling(TimePoint, Events&) override {}
37+
void Start(uint64_t) override {}
38+
void Stop(uint64_t) override {}
3939
};
4040

4141
#endif

onnxruntime/core/providers/cuda/nn/pool.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,14 @@ Status Pool<T, MaxPool<8>, Layout>::ComputeInternal(OpKernelContext* context) co
287287
}
288288

289289
Tensor* I = context->Output(1, TensorShape(i_dims));
290+
constexpr bool pool_template_arg = Layout == LAYOUT_NHWC;
290291
if (nullptr != I || !this->pool_attrs_.default_dilations) {
291292
auto i_data = nullptr == I ? nullptr : I->MutableData<int64_t>();
292-
MaxPoolWithIndex<CudaT, Layout == LAYOUT_NHWC>(this->Stream(context), x_shape, TensorShape(y_dims), kernel_shape,
293-
strides, pads, this->pool_attrs_.dilations,
294-
this->pool_attrs_.storage_order, x_data, y_data, i_data);
293+
MaxPoolWithIndex<CudaT, pool_template_arg>(this->Stream(context), x_shape, TensorShape(y_dims), kernel_shape,
294+
strides, pads, this->pool_attrs_.dilations,
295+
this->pool_attrs_.storage_order, x_data, y_data, i_data);
295296
} else {
296-
ORT_RETURN_IF_ERROR((Pool<T, MaxPool<1>, Layout == LAYOUT_NHWC>::ComputeInternal(context)));
297+
ORT_RETURN_IF_ERROR((Pool<T, MaxPool<1>, pool_template_arg>::ComputeInternal(context)));
297298
}
298299
return Status::OK();
299300
}

onnxruntime/core/providers/cuda/tensor/space_depth_ops.cc

+12-12
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ Status SpaceToDepth<Layout>::ComputeInternal(OpKernelContext* context) const {
171171
int64_t output_depth = -1;
172172
int64_t output_height = -1;
173173
int64_t output_width = -1;
174-
174+
constexpr bool template_arg = Layout == LAYOUT_NHWC;
175175
ORT_RETURN_IF_ERROR(
176-
InputValidationsAndOutputDimsCalc<Layout == LAYOUT_NHWC>(input,
177-
batch,
178-
input_depth, input_height, input_width,
179-
output_depth, output_height, output_width,
180-
true));
176+
InputValidationsAndOutputDimsCalc<template_arg>(input,
177+
batch,
178+
input_depth, input_height, input_width,
179+
output_depth, output_height, output_width,
180+
true));
181181

182182
// We use the "actual" output shape to construct the output tensor
183183
Tensor& output = (Layout == LAYOUT_NCHW)
@@ -223,13 +223,13 @@ Status DepthToSpace<Layout>::ComputeInternal(OpKernelContext* context) const {
223223
int64_t output_depth = -1;
224224
int64_t output_height = -1;
225225
int64_t output_width = -1;
226-
226+
constexpr bool template_arg = Layout == LAYOUT_NHWC;
227227
ORT_RETURN_IF_ERROR(
228-
InputValidationsAndOutputDimsCalc<Layout == LAYOUT_NHWC>(input,
229-
batch,
230-
input_depth, input_height, input_width,
231-
output_depth, output_height, output_width,
232-
false));
228+
InputValidationsAndOutputDimsCalc<template_arg>(input,
229+
batch,
230+
input_depth, input_height, input_width,
231+
output_depth, output_height, output_width,
232+
false));
233233

234234
// We use the "actual" output shape to construct the output tensor
235235
Tensor& output = (Layout == LAYOUT_NCHW)

onnxruntime/core/providers/rocm/rocm_profiler.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class RocmProfiler final : public EpProfiler {
3434
ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(RocmProfiler);
3535
~RocmProfiler() {}
3636
bool StartProfiling(TimePoint) override { return true; }
37-
void EndProfiling(TimePoint, Events&) override {};
38-
void Start(uint64_t) override{};
39-
void Stop(uint64_t) override{};
37+
void EndProfiling(TimePoint, Events&) override {}
38+
void Start(uint64_t) override {}
39+
void Stop(uint64_t) override {}
4040
};
4141

4242
} // namespace profiling

onnxruntime/core/providers/vitisai/vitisai_profiler.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class VitisaiProfiler final : public EpProfiler {
1414
~VitisaiProfiler() {}
1515
bool StartProfiling(TimePoint) override;
1616
void EndProfiling(TimePoint, Events&) override;
17-
void Start(uint64_t) override{};
18-
void Stop(uint64_t) override{};
17+
void Start(uint64_t) override {}
18+
void Stop(uint64_t) override {}
1919
};
2020
#endif
2121

onnxruntime/test/fuzzing/src/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ int main(int argc, char* argv[]) {
282282
// Enable telemetry events
283283
//
284284
env.EnableTelemetryEvents();
285-
struct RunStats run_stats {};
285+
struct RunStats run_stats{};
286286
runtimeOpt opt{};
287287
user_options& user_opt{opt.user_opt};
288288
Logger::wcstream& werr_stream_buf{opt.werr_stream_buf};

orttraining/orttraining/python/training/ortmodule/torch_cpp_extensions/cuda/fused_ops/type_shim.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ __device__ __forceinline__ T reduce_block_into_lanes(T* x, T val, int lanes = 1,
5151
final = x[tid] + x[tid + 32];
5252
else
5353
final = val;
54-
// __SYNCWARP();
54+
// __SYNCWARP();
5555

5656
#pragma unroll
5757
#if defined(CUDA_VERSION) && CUDA_VERSION >= 9000

orttraining/orttraining/test/gradient/gradient_ops_test.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,9 @@ TEST(GradientCheckerTest, SigmoidGrad) { UnaryOpGradientTest("Sigmoid"); }
15711571

15721572
TEST(GradientCheckerTest, QuickGeluGrad) {
15731573
// Default alpha = 1.702, relax the tolerance due failure on Win for some seed.
1574-
{ UnaryOpGradientTest("QuickGelu", kMSDomain, 1, nullptr, nullptr, {}, 5e-2f); }
1574+
{
1575+
UnaryOpGradientTest("QuickGelu", kMSDomain, 1, nullptr, nullptr, {}, 5e-2f);
1576+
}
15751577

15761578
// Silu, alpha = 1.0.
15771579
{

requirements-lintrunner.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ ruff==0.5.4
88
black==24.10.0
99
isort==5.13.2
1010
# CLANGFORMAT
11-
clang-format==18.1.8
11+
clang-format==19.1.6

winml/lib/Api.Ort/OnnxruntimeEngine.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class OnnxruntimeEngine
9191
STDMETHOD(CreateTensorValueFromExternalD3DResource)
9292
(ID3D12Resource* resource, const int64_t* shape, size_t count, winml::TensorKind kind, _Out_ IValue** out) override;
9393
STDMETHOD(CreateTensorValueFromExternalBuffer)
94-
(void* data, size_t size_in_bytes, const int64_t* shape, size_t count, winml::TensorKind kind, _Out_ IValue** out
95-
) override;
94+
(void* data, size_t size_in_bytes, const int64_t* shape, size_t count, winml::TensorKind kind, _Out_ IValue** out)
95+
override;
9696
STDMETHOD(CreateStringTensorValueFromDataWithCopy)
9797
(const char* const* data, size_t num_elements, const int64_t* shape, size_t count, _Out_ IValue** out) override;
9898
STDMETHOD(CreateNullValue)

winml/lib/Api/LearningModelSession.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ LearningModelSession::LearningModelSession(_winml::IEngine* engine)
3737
}
3838

3939
LearningModelSession::LearningModelSession(winml::LearningModel const& model) try
40-
: LearningModelSession(model, make<LearningModelDevice>(LearningModelDeviceKind::Default)) {}
40+
: LearningModelSession(model, make<LearningModelDevice>(LearningModelDeviceKind::Default)) {
41+
}
4142
WINML_CATCH_ALL
4243

4344
LearningModelSession::LearningModelSession(
4445
winml::LearningModel const& model, winml::LearningModelDevice const& deviceToRunOn
4546
) try
46-
: LearningModelSession(model, deviceToRunOn, nullptr) {}
47+
: LearningModelSession(model, deviceToRunOn, nullptr) {
48+
}
4749
WINML_CATCH_ALL
4850

4951
LearningModelSession::LearningModelSession(

winml/test/api/raw/buffer_backed_random_access_stream_reference.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ struct RandomAccessStream
116116
ABI::Windows::Storage::Streams::IInputStream,
117117
ABI::Windows::Storage::Streams::IOutputStream,
118118
ABI::Windows::Foundation::IClosable> {
119-
InspectableClass(L"WinMLTest.RandomAccessStream", BaseTrust)
119+
InspectableClass(L"WinMLTest.RandomAccessStream", BaseTrust)
120120

121-
private : Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IBuffer> buffer_ = nullptr;
121+
private : Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IBuffer> buffer_ = nullptr;
122122
UINT64 position_ = 0;
123123

124124
public:
@@ -266,8 +266,8 @@ struct BufferBackedRandomAccessStreamReferenceOpenReadAsync
266266
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix | Microsoft::WRL::InhibitRoOriginateError>,
267267
__FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType,
268268
ABI::Windows::Foundation::IAsyncInfo> {
269-
InspectableClass(L"WinMLTest.BufferBackedRandomAccessStreamReferenceOpenReadAsync", BaseTrust) public
270-
: Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType> ras_;
269+
InspectableClass(L"WinMLTest.BufferBackedRandomAccessStreamReferenceOpenReadAsync", BaseTrust) public
270+
: Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType> ras_;
271271
Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncOperationCompletedHandler<
272272
ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*>>
273273
completed_handler_;

winml/test/api/raw/weak_buffer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ struct WeakBuffer
1818
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix | Microsoft::WRL::InhibitRoOriginateError>,
1919
ABI::Windows::Storage::Streams::IBuffer,
2020
Windows::Storage::Streams::IBufferByteAccess> {
21-
InspectableClass(L"WinMLTest.WeakBuffer", BaseTrust)
21+
InspectableClass(L"WinMLTest.WeakBuffer", BaseTrust)
2222

23-
private : const T* m_p_begin;
23+
private : const T* m_p_begin;
2424
const T* m_p_end;
2525

2626
public:

0 commit comments

Comments
 (0)