Skip to content

[SYCL][E2E] fix one test leak #12037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

yingcong-wu
Copy link
Contributor

Because SYCL will throw an exception, malloced ptr will never freed, which is a leak. Use std::vector to make it freed automatically.

@yingcong-wu yingcong-wu requested a review from a team as a code owner November 30, 2023 02:39
Copy link
Contributor

@maarquitos14 maarquitos14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks!

@yingcong-wu
Copy link
Contributor Author

yingcong-wu commented Dec 1, 2023

Hi @maarquitos14 , I see from the failed test result that those failures seem not related to this PR. I wonder if they are flaky or what?

CUDA E2E
Failed Tests (1):
  SYCL :: Regression/vec_rel_swizzle_ops.cpp

AMD/HIP, ["Linux", "amdgpu"]
Failed Tests (1):
  SYCL :: Regression/vec_rel_swizzle_ops.cpp

e2e / Intel GEN12 Graphics with Level Zero
Timed Out Tests (1):
  SYCL :: Basic/vector/int-convert.cpp

@maarquitos14
Copy link
Contributor

They're not flaky, but they are known. They are addressed in #12040, #12043. I think this is good to merge, but I'll let @intel/llvm-gatekeepers decide.

sycl::queue q{};
{
sycl::buffer<float> buf(ptr, sycl::range<1>{n});
sycl::buffer<float> buf(array.data(), sycl::range<1>{n});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just

Suggested change
sycl::buffer<float> buf(array.data(), sycl::range<1>{n});
sycl::buffer<float> buf(sycl::range<1>{n});

without any vectors/pointers would be enough for this test, I think...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will try to use this constructor next time I see some similar problems.

@aelovikov-intel aelovikov-intel merged commit 06b0db6 into intel:sycl Dec 1, 2023
@yingcong-wu yingcong-wu deleted the yc/1129-fix-e2e-test branch June 20, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants