Skip to content

Update File provider config API #927

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 2 commits into from
Nov 26, 2024

Conversation

vinser52
Copy link
Contributor

@vinser52 vinser52 commented Nov 22, 2024

Description

Change the File Provider config as we agreed in #844.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • New tests added, especially if they will fail without my changes

@vinser52 vinser52 requested a review from a team as a code owner November 22, 2024 13:04
@vinser52 vinser52 force-pushed the svinogra_file_params branch 5 times, most recently from c9f4b11 to 3928cdc Compare November 22, 2024 20:00
@vinser52 vinser52 force-pushed the svinogra_file_params branch from 3928cdc to 55debf5 Compare November 25, 2024 08:51
@vinser52 vinser52 requested a review from ldorau November 25, 2024 12:31
@vinser52 vinser52 force-pushed the svinogra_file_params branch from 55debf5 to 52eef19 Compare November 25, 2024 13:42
@vinser52 vinser52 force-pushed the svinogra_file_params branch 2 times, most recently from 877d0e1 to 0a2d0c3 Compare November 25, 2024 21:35
ldorau

This comment was marked as duplicate.

@ldorau ldorau self-requested a review November 26, 2024 08:10
Copy link
Contributor

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

The code coverage of the src/provider/provider_file_memory.c file on the main branch is 81% while on this PR 78.8% - it could be improved, so that it does not decrease.

@vinser52
Copy link
Contributor Author

The code coverage of the src/provider/provider_file_memory.c file on the main branch is 81% while on this PR 78.8% - it could be improved, so that it does not decrease.

The main reason for code coverage decrease is because of these lines:

#if defined(_WIN32) || defined(UMF_NO_HWLOC)

umf_memory_provider_ops_t *umfFileMemoryProviderOps(void) {
    // not supported
    return NULL;
}

umf_result_t umfFileMemoryProviderParamsCreate(
    umf_file_memory_provider_params_handle_t *hParams, const char *path) {
    (void)hParams;
    (void)path;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsDestroy(
    umf_file_memory_provider_params_handle_t hParams) {
    (void)hParams;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsSetPath(
    umf_file_memory_provider_params_handle_t hParams, const char *path) {
    (void)hParams;
    (void)path;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsSetProtection(
    umf_file_memory_provider_params_handle_t hParams, unsigned protection) {
    (void)hParams;
    (void)protection;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsSetVisibility(
    umf_file_memory_provider_params_handle_t hParams,
    umf_memory_visibility_t visibility) {
    (void)hParams;
    (void)visibility;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

#else // !defined(_WIN32) && !defined(UMF_NO_HWLOC)

We have no tests when provider is disabled at build time. And it is true for all providers.

@vinser52 vinser52 force-pushed the svinogra_file_params branch from 0a2d0c3 to 0325f30 Compare November 26, 2024 09:27
@vinser52
Copy link
Contributor Author

The code coverage of the src/provider/provider_file_memory.c file on the main branch is 81% while on this PR 78.8% - it could be improved, so that it does not decrease.

The main reason for code coverage decrease is because of these lines:

#if defined(_WIN32) || defined(UMF_NO_HWLOC)

umf_memory_provider_ops_t *umfFileMemoryProviderOps(void) {
    // not supported
    return NULL;
}

umf_result_t umfFileMemoryProviderParamsCreate(
    umf_file_memory_provider_params_handle_t *hParams, const char *path) {
    (void)hParams;
    (void)path;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsDestroy(
    umf_file_memory_provider_params_handle_t hParams) {
    (void)hParams;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsSetPath(
    umf_file_memory_provider_params_handle_t hParams, const char *path) {
    (void)hParams;
    (void)path;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsSetProtection(
    umf_file_memory_provider_params_handle_t hParams, unsigned protection) {
    (void)hParams;
    (void)protection;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

umf_result_t umfFileMemoryProviderParamsSetVisibility(
    umf_file_memory_provider_params_handle_t hParams,
    umf_memory_visibility_t visibility) {
    (void)hParams;
    (void)visibility;
    return UMF_RESULT_ERROR_NOT_SUPPORTED;
}

#else // !defined(_WIN32) && !defined(UMF_NO_HWLOC)

We have no tests when provider is disabled at build time. And it is true for all providers.

Ok, I have added corresponding test.

@vinser52
Copy link
Contributor Author

The new code coverage of the src/provider/provider_file_memory.c file is 81.7%.

@vinser52 vinser52 requested a review from PatKamin November 26, 2024 10:26
@vinser52 vinser52 force-pushed the svinogra_file_params branch from 0325f30 to 31372be Compare November 26, 2024 10:28
@bratpiorka bratpiorka merged commit e53e52f into oneapi-src:main Nov 26, 2024
77 checks passed
@vinser52 vinser52 deleted the svinogra_file_params branch February 4, 2025 11:34
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.

4 participants