Skip to content
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

Fix file_alloc() of the file memory provider #800

Merged

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Oct 14, 2024

Description

Fix file_alloc() of the file memory provider.

Fixes: #796

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@ldorau ldorau requested a review from a team as a code owner October 14, 2024 10:31
@ldorau ldorau force-pushed the Fix_updating_offset_mmap_in_file_alloc_aligned branch 2 times, most recently from 5ec8017 to 3a80ddc Compare October 14, 2024 13:30
@bratpiorka bratpiorka requested a review from lplewa October 14, 2024 16:47
Copy link
Contributor

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,57 @@
// Copyright (C) 2023 Intel Corporation
Copy link
Contributor

Choose a reason for hiding this comment

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

2024

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,57 @@
// Copyright (C) 2023 Intel Corporation
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
Copy link
Contributor

Choose a reason for hiding this comment

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

Also we have test_helpers.c and now you are adding test_helpers.cpp with other "c" functions.

First of all, we are writing tests in c++ so we should use c++ features. We should have a base class for all "provider tests" which has this method. Then extend this class with provider specific test classes for given provider.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change: "We should have a base class for all "provider tests" which has this method. Then extend this class with provider specific test classes for given provider." requires separate pull request IMHO.

The most important part of this PR is the fix for the file provider, because it is unusable at all now and this fix should be merged ASAP IMHO. Refactoring of tests can wait and should be done in a separate PR.

Copy link
Contributor Author

@ldorau ldorau Oct 15, 2024

Choose a reason for hiding this comment

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

If you insist, I can remove this and add only one simple test instead of this, like here: ldorau@e9282fc

Copy link
Contributor

Choose a reason for hiding this comment

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

An idea to have common test shared between providers was good. But it was implemented in wrong way. If you do not want to do it clean way, we can do your simple test. anyway we should have even better test for each provider which does multiple allocations and fire in (semi) random way, but it might be a topic for another day.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

First I have to provide the very important fix for the file provider - this is the most important thing now.
I added a simple test.

@lplewa Done

@ldorau ldorau force-pushed the Fix_updating_offset_mmap_in_file_alloc_aligned branch from 3a80ddc to b1da922 Compare October 16, 2024 08:07
@ldorau ldorau force-pushed the Fix_updating_offset_mmap_in_file_alloc_aligned branch from b1da922 to 62444d3 Compare October 17, 2024 09:31
@ldorau ldorau changed the title Fix updating offset mmap in file alloc aligned Fix file_alloc() of the file memory provider Oct 17, 2024
@ldorau
Copy link
Contributor Author

ldorau commented Oct 17, 2024

Code coverage of provider_file_memory.c increased from 76.8 % to 77.9 % (by 1.1 %).

@lplewa lplewa merged commit 5bf1b5e into oneapi-src:main Oct 17, 2024
77 checks passed
@ldorau ldorau deleted the Fix_updating_offset_mmap_in_file_alloc_aligned branch October 17, 2024 13:50
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.

Multiple allocations from file provider doesn't work
4 participants