-
Notifications
You must be signed in to change notification settings - Fork 35
Add devdax memory provider #671
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
bratpiorka
merged 3 commits into
oneapi-src:main
from
ldorau:Add_devdax_memory_provider
Sep 13, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This workflow builds and tests the devdax memory provider. | ||
# It requires a DAX device (e.g. /dev/dax0.0) configured in the OS. | ||
# This DAX device should be specified using UMF_TESTS_DEVDAX_PATH and UMF_TESTS_DEVDAX_SIZE | ||
# CI environment variables. | ||
|
||
name: DevDax | ||
|
||
on: [workflow_call] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
UMF_TESTS_DEVDAX_PATH : "/dev/dax0.0" | ||
UMF_TESTS_DEVDAX_SIZE : 1054867456 | ||
BUILD_DIR : "${{github.workspace}}/build" | ||
INSTL_DIR : "${{github.workspace}}/../install-dir" | ||
|
||
jobs: | ||
devdax: | ||
name: Build | ||
# run only on upstream; forks may not have a DAX device | ||
if: github.repository == 'oneapi-src/unified-memory-framework' | ||
strategy: | ||
matrix: | ||
build_type: [Debug, Release] | ||
shared_library: ['ON', 'OFF'] | ||
|
||
runs-on: ["DSS-DEVDAX", "DSS-Ubuntu"] | ||
steps: | ||
- name: Check if the devdax exists | ||
run: | | ||
ndctl list -N --device-dax | ||
ls -al ${{env.UMF_TESTS_DEVDAX_PATH}} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure build | ||
run: > | ||
cmake | ||
-B ${{env.BUILD_DIR}} | ||
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}" | ||
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | ||
-DCMAKE_C_COMPILER=gcc | ||
-DCMAKE_CXX_COMPILER=g++ | ||
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}} | ||
-DUMF_BUILD_BENCHMARKS=OFF | ||
-DUMF_BUILD_TESTS=ON | ||
-DUMF_BUILD_GPU_TESTS=OFF | ||
-DUMF_BUILD_GPU_EXAMPLES=OFF | ||
-DUMF_FORMAT_CODE_STYLE=OFF | ||
-DUMF_DEVELOPER_MODE=ON | ||
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON | ||
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON | ||
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF | ||
-DUMF_TESTS_FAIL_ON_SKIP=ON | ||
|
||
- name: Build UMF | ||
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $(nproc) | ||
|
||
- name: Run only devdax tests | ||
working-directory: ${{env.BUILD_DIR}} | ||
run: ctest -C ${{matrix.build_type}} -R devdax -V |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kswiecicki marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2024 Intel Corporation | ||
* | ||
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
*/ | ||
|
||
#ifndef UMF_DEVDAX_MEMORY_PROVIDER_H | ||
#define UMF_DEVDAX_MEMORY_PROVIDER_H | ||
|
||
#include <umf/providers/provider_os_memory.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/// @cond | ||
#define UMF_DEVDAX_RESULTS_START_FROM 2000 | ||
/// @endcond | ||
|
||
/// @brief Memory provider settings struct | ||
typedef struct umf_devdax_memory_provider_params_t { | ||
/// path of the device DAX | ||
char *path; | ||
/// size of the device DAX in bytes | ||
size_t size; | ||
/// combination of 'umf_mem_protection_flags_t' flags | ||
unsigned protection; | ||
} umf_devdax_memory_provider_params_t; | ||
|
||
/// @brief Devdax Memory Provider operation results | ||
typedef enum umf_devdax_memory_provider_native_error { | ||
UMF_DEVDAX_RESULT_SUCCESS = UMF_DEVDAX_RESULTS_START_FROM, ///< Success | ||
UMF_DEVDAX_RESULT_ERROR_ALLOC_FAILED, ///< Memory allocation failed | ||
UMF_DEVDAX_RESULT_ERROR_ADDRESS_NOT_ALIGNED, ///< Allocated address is not aligned | ||
UMF_DEVDAX_RESULT_ERROR_FREE_FAILED, ///< Memory deallocation failed | ||
UMF_DEVDAX_RESULT_ERROR_PURGE_FORCE_FAILED, ///< Force purging failed | ||
} umf_devdax_memory_provider_native_error_t; | ||
|
||
umf_memory_provider_ops_t *umfDevDaxMemoryProviderOps(void); | ||
|
||
/// @brief Create default params for the devdax memory provider | ||
static inline umf_devdax_memory_provider_params_t | ||
umfDevDaxMemoryProviderParamsDefault(char *path, size_t size) { | ||
umf_devdax_memory_provider_params_t params = { | ||
path, /* path of the device DAX */ | ||
size, /* size of the device DAX in bytes */ | ||
UMF_PROTECTION_READ | UMF_PROTECTION_WRITE, /* protection */ | ||
}; | ||
|
||
return params; | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* UMF_DEVDAX_MEMORY_PROVIDER_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.