oneMKL icon indicating copy to clipboard operation
oneMKL copied to clipboard

[clang-format] Reformat due to transition from v9.0.0 to v19.1.0 and update of style configuration

Open dnhsieh-intel opened this issue 1 year ago • 4 comments

Description

This PR is a preparation step for issue #580. Since we will move from clang-format v9.0.0 to v19.1.0, this PR reformats the code according to v19.1.0. This PR is separated from the CI enabling (PR #595) in order to have a more informative git blame.

There are some changes I want to discuss.

  • src/lapack/backends/cusolver/cusolver_lapack.cpp The following changes are suggested by clang-format:
    -    queue.submit([&](sycl::handler &cgh) {
    -        onemkl_cusolver_host_task(cgh, queue, [=](CusolverScopedContextHandler &sc) {
    -            auto handle = sc.get_handle(queue);
    -            cusolverStatus_t err;
    -            CUSOLVER_ERROR_FUNC_T_SYNC(func_name, func, err, handle, m, n, scratch_size);
    -        });
    -    }).wait();
    +    queue
    +        .submit([&](sycl::handler &cgh) {
    +            onemkl_cusolver_host_task(cgh, queue, [=](CusolverScopedContextHandler &sc) {
    +                auto handle = sc.get_handle(queue);
    +                cusolverStatus_t err;
    +                CUSOLVER_ERROR_FUNC_T_SYNC(func_name, func, err, handle, m, n, scratch_size);
    +            });
    +        })
    +        .wait();
    
    Because it looks too funny, I added // clang-format off/on for all the similar suggestions in this file.
  • tests/unit_tests/dft/include/{compute_out_of_place,compute_inplace}.hpp Although I don't like the following formatting personally, it is probably still fine. I can turn the formatting off if there are objections.
    -                EXPECT_TRUE(check_equal_strided<domain == oneapi::mkl::dft::domain::REAL>(
    -                    bwd_ptr + backward_distance * i, out_host_ref.data() + ref_distance * i, sizes,
    -                    strides_bwd_cpy, abs_error_margin, rel_error_margin, std::cout));
    +                EXPECT_TRUE(check_equal_strided < domain ==
    +                            oneapi::mkl::dft::domain::REAL >
    +                                (bwd_ptr + backward_distance * i,
    +                                 out_host_ref.data() + ref_distance * i, sizes, strides_bwd_cpy,
    +                                 abs_error_margin, rel_error_margin, std::cout));
    

Checklist

All Submissions

  • Do all unit tests pass locally? Only code reformatting. The CPU tests in CI passed.
  • [X] Have you formatted the code using clang-format?

dnhsieh-intel avatar Oct 15 '24 07:10 dnhsieh-intel