SWDEV-470698 - fix formatting, add format check workflow (#657)

这个提交包含在:
Danylo Lytovchenko 编写, GitHub 于 2025-08-20 19:58:06 +05:30 提交
1 父节点 5840940caa
当前提交 f7338717ae
1574 个文件已更改
+162903 -199277

没有与搜索条件相匹配的文件

@@ -32,17 +32,17 @@ static void Copy_to_device() {
int* A_h = nullptr;
int* A_d = nullptr;
hipError_t status = hipHostMalloc(&A_h, ele_size*sizeof(int));
hipError_t status = hipHostMalloc(&A_h, ele_size * sizeof(int));
if (status != hipSuccess) return;
status = hipMalloc(&A_d, ele_size * sizeof(int));
if (status != hipSuccess) return;
for(unsigned int i = 0; i < ele_size; ++i) {
for (unsigned int i = 0; i < ele_size; ++i) {
A_h[i] = 123;
}
HIP_CHECK(hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
hipStreamPerThread));
HIP_CHECK(
hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice, hipStreamPerThread));
// Clean up
HIP_CHECK(hipHostFree(A_h));
HIP_CHECK(hipFree(A_d));
@@ -52,10 +52,10 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_1") {
constexpr unsigned int MAX_THREAD_CNT = 10;
std::vector<std::thread> threads(MAX_THREAD_CNT);
for (auto &th : threads) {
for (auto& th : threads) {
th = std::thread(Copy_to_device);
}
for (auto &th : threads) {
for (auto& th : threads) {
th.join();
}
@@ -75,7 +75,7 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_2") {
int* A_h = nullptr;
int* A_d = nullptr;
hipError_t status = hipHostMalloc(&A_h, ele_size*sizeof(int));
hipError_t status = hipHostMalloc(&A_h, ele_size * sizeof(int));
if (status != hipSuccess) return;
status = hipMalloc(&A_d, ele_size * sizeof(int));
if (status != hipSuccess) return;
@@ -83,8 +83,8 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_2") {
for (unsigned int i = 0; i < ele_size; ++i) {
A_h[i] = 123;
}
status = hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
hipStreamPerThread);
status =
hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice, hipStreamPerThread);
if (status != hipSuccess) return;
HIP_CHECK(hipStreamSynchronize(hipStreamPerThread));
@@ -96,13 +96,13 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_2") {
// After reset all memory objects will be destroyed hence allocating them again
// Intention is to use hipStreamPerThread successfully after reset hence not validating
// values after copy
status = hipHostMalloc(&A_h, ele_size*sizeof(int));
status = hipHostMalloc(&A_h, ele_size * sizeof(int));
if (status != hipSuccess) return;
status = hipMalloc(&A_d, ele_size * sizeof(int));
if (status != hipSuccess) return;
status = hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
hipStreamPerThread);
status =
hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice, hipStreamPerThread);
if (status != hipSuccess) return;
HIP_CHECK(hipStreamSynchronize(hipStreamPerThread));