Use clang-format-18 for source formatting (#256)

* Updating clang-format to v18

- Updates the pre-commit-config
- Formats source files according to the utility

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Update format source workflow

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Update CONTRIBUTING

* Update comment in .clang-format

* Update CONTRIBUTING.md

* Update helper script

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

[ROCm/rocprofiler-systems commit: 1e13b590e7]
Этот коммит содержится в:
David Galiffi authored and GitHub committed 2025-06-22 08:48:08 -04:00
1 родитель 6a8cef771e
Коммит 0403aaa97f
76 files changed
+258 -255

No files matched your search

+2 -1
Просмотреть файл
@@ -75,7 +75,8 @@ run(const char* _name, int nchildren)
for(auto& itr : _children)
{
while(itr == 0)
{}
{
}
printf("[%s][%i] performing waitpid(%i, ...)\n", _name, getpid(), itr);
while((_wait_pid = waitpid(itr, &_status, WUNTRACED | WNOHANG)) <= 0)
{
+12 -12
Просмотреть файл
@@ -471,8 +471,8 @@ public:
num_channels = 1;
output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = align(output_image.pitch[0] *
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
}
else
{
@@ -481,29 +481,29 @@ public:
output_image.pitch[1] = is_roi_valid ? roi_width : widths[1];
output_image.pitch[2] = is_roi_valid ? roi_width : widths[2];
channel_sizes[0] = align(output_image.pitch[0] *
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
channel_sizes[1] = align(output_image.pitch[1] *
(is_roi_valid ? roi_height : heights[1]),
mem_alignment);
(is_roi_valid ? roi_height : heights[1]),
mem_alignment);
channel_sizes[2] = align(output_image.pitch[2] *
(is_roi_valid ? roi_height : heights[2]),
mem_alignment);
(is_roi_valid ? roi_height : heights[2]),
mem_alignment);
}
break;
case ROCJPEG_OUTPUT_Y:
num_channels = 1;
output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = align(output_image.pitch[0] *
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
break;
case ROCJPEG_OUTPUT_RGB:
num_channels = 1;
output_image.pitch[0] = (is_roi_valid ? roi_width : widths[0]) * 3;
channel_sizes[0] = align(output_image.pitch[0] *
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
(is_roi_valid ? roi_height : heights[0]),
mem_alignment);
break;
case ROCJPEG_OUTPUT_RGB_PLANAR:
num_channels = 3;
+3 -3
Просмотреть файл
@@ -2169,7 +2169,7 @@ main(int argc, char* argv[])
MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
#else
numRanks = 1;
myRank = 0;
myRank = 0;
#endif
Kokkos::initialize(argc, argv);
@@ -2246,7 +2246,7 @@ main(int argc, char* argv[])
while((locDom.time() < locDom.stoptime()) && (locDom.cycle() < opts.its))
{
Kokkos::Tools::startSection(_time_incrp);
//CAUSAL_BEGIN("Iteration")
// CAUSAL_BEGIN("Iteration")
TimeIncrement(locDom);
Kokkos::Tools::stopSection(_time_incrp);
@@ -2254,7 +2254,7 @@ main(int argc, char* argv[])
LagrangeLeapFrog(locDom);
Kokkos::Tools::stopSection(_leap_frogp);
CAUSAL_PROGRESS_NAMED("Iteration")
//CAUSAL_END("Iteration")
// CAUSAL_END("Iteration")
if((opts.showProg != 0) && (opts.quiet == 0) && (myRank == 0))
{
+1 -1
Просмотреть файл
@@ -407,7 +407,7 @@ main(int /*argc*/, char** /*argv*/)
x[j] = norm_temp2 * z[j];
}
} /* end of main iter inv pow meth */
} /* end parallel */
} /* end parallel */
timer_stop(T_BENCH);
/*
+1 -1
Просмотреть файл
@@ -48,7 +48,7 @@ template <typename T>
void
vmul(T* a, T* b, T* c, int N)
{
#pragma omp target map(to : a [0:N], b [0:N]) map(from : c [0:N])
#pragma omp target map(to : a[0 : N], b[0 : N]) map(from : c[0 : N])
#pragma omp teams distribute parallel for
for(int i = 0; i < N; i++)
{
+2 -7
Просмотреть файл
@@ -84,16 +84,11 @@ typedef enum OutputSurfaceMemoryType_enum
#if DBGINFO
# define INFO(X) \
std::clog << "[INF] " \
<< " {" << __func__ << "} " \
<< " " << X << std::endl;
std::clog << "[INF] " << " {" << __func__ << "} " << " " << X << std::endl;
#else
# define INFO(X) ;
#endif
#define ERR(X) \
std::cerr << "[ERR] " \
<< " {" << __func__ << "} " \
<< " " << X << std::endl;
#define ERR(X) std::cerr << "[ERR] " << " {" << __func__ << "} " << " " << X << std::endl;
class RocVideoDecodeException : public std::exception
{
+2 -2
Просмотреть файл
@@ -234,7 +234,7 @@ public:
if(pts)
{
*pts =
(int64_t)(packet_filtered_->pts * default_time_scale_ * time_base_);
(int64_t) (packet_filtered_->pts * default_time_scale_ * time_base_);
pkt_duration_ = packet_filtered_->duration;
}
}
@@ -277,7 +277,7 @@ public:
}
if(pts)
{
*pts = (int64_t)(packet_->pts * default_time_scale_ * time_base_);
*pts = (int64_t) (packet_->pts * default_time_scale_ * time_base_);
pkt_duration_ = packet_->duration;
}
}