Skip to content

Commit 3be3918

Browse files
Merge branch 'main' into urlza-414
2 parents 0e2916a + 22b425f commit 3be3918

File tree

100 files changed

+2808
-970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2808
-970
lines changed

.github/docker/install_dpcpp.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ if [ "${SKIP_DPCPP_BUILD}" ]; then
1616
fi
1717

1818
mkdir -p ${DPCPP_PATH}/dpcpp_compiler
19-
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
19+
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
2020
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/dpcpp_compiler

.github/workflows/benchmarks-reusable.yml

+36-1
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,49 @@ jobs:
156156
- name: Install UR
157157
run: cmake --install ${{github.workspace}}/ur_build
158158

159+
- name: Checkout UMF
160+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
161+
with:
162+
repository: oneapi-src/unified-memory-framework
163+
ref: main
164+
path: umf-repo
165+
fetch-depth: 1
166+
fetch-tags: false
167+
168+
- name: Configure UMF
169+
run: >
170+
cmake -DCMAKE_BUILD_TYPE=Release
171+
-S${{github.workspace}}/umf-repo
172+
-B${{github.workspace}}/umf_build
173+
-DUMF_BUILD_BENCHMARKS=ON
174+
-DUMF_TESTS_FAIL_ON_SKIP=ON
175+
176+
- name: Build UMF
177+
run: cmake --build ${{github.workspace}}/umf_build -j $(nproc)
178+
179+
- name: Compute core range
180+
run: |
181+
# Compute the core range for the first NUMA node, skipping the first 4 cores.
182+
# This is to avoid the first cores that the kernel is likely to schedule more work on.
183+
CORES=$(lscpu | awk '
184+
/NUMA node0 CPU|On-line CPU/ {line=$0}
185+
END {
186+
split(line, a, " ")
187+
split(a[4], b, ",")
188+
sub(/^0/, "4", b[1])
189+
print b[1]
190+
}')
191+
echo "CORES=$CORES" >> $GITHUB_ENV
192+
159193
- name: Run benchmarks
160194
working-directory: ${{ github.workspace }}/ur-repo/
161195
id: benchmarks
162196
run: >
163-
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
197+
taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
164198
~/bench_workdir
165199
--sycl ${{ github.workspace }}/sycl_build
166200
--ur ${{ github.workspace }}/ur_install
201+
--umf ${{ github.workspace }}/umf_build
167202
--adapter ${{ matrix.adapter.str_name }}
168203
${{ inputs.upload_report && '--output-html' || '' }}
169204
${{ inputs.bench_script_params }}

.github/workflows/build-fuzz-reusable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Download DPC++
3737
run: |
38-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
38+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
3939
mkdir dpcpp_compiler
4040
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
4141

.github/workflows/build-hw-reusable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777

7878
- name: Download DPC++
7979
run: |
80-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
80+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
8181
mkdir dpcpp_compiler
8282
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
8383

.github/workflows/cmake.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: matrix.os == 'ubuntu-22.04'
7777
run: |
7878
sudo apt install libncurses5
79-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
79+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
8080
mkdir -p ${{github.workspace}}/dpcpp_compiler
8181
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
8282

.github/workflows/multi_device.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Download DPC++
3535
run: |
36-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
36+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
3737
mkdir dpcpp_compiler
3838
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
3939

include/ur_api.h

+59-1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ typedef enum ur_function_t {
233233
UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT = 246, ///< Enumerator for ::urEnqueueEventsWaitWithBarrierExt
234234
UR_FUNCTION_TENSOR_MAP_ENCODE_IM_2_COL_EXP = 247, ///< Enumerator for ::urTensorMapEncodeIm2ColExp
235235
UR_FUNCTION_TENSOR_MAP_ENCODE_TILED_EXP = 248, ///< Enumerator for ::urTensorMapEncodeTiledExp
236+
UR_FUNCTION_PHYSICAL_MEM_GET_INFO = 249, ///< Enumerator for ::urPhysicalMemGetInfo
236237
/// @cond
237238
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
238239
/// @endcond
@@ -2525,7 +2526,7 @@ typedef enum ur_mem_type_t {
25252526
///////////////////////////////////////////////////////////////////////////////
25262527
/// @brief Memory Information type
25272528
typedef enum ur_mem_info_t {
2528-
UR_MEM_INFO_SIZE = 0, ///< [size_t] actual size of of memory object in bytes
2529+
UR_MEM_INFO_SIZE = 0, ///< [size_t] actual size of the memory object in bytes
25292530
UR_MEM_INFO_CONTEXT = 1, ///< [::ur_context_handle_t] context in which the memory object was created
25302531
UR_MEM_INFO_REFERENCE_COUNT = 2, ///< [uint32_t] Reference count of the memory object.
25312532
///< The reference count returned should be considered immediately stale.
@@ -4138,6 +4139,50 @@ urPhysicalMemRelease(
41384139
ur_physical_mem_handle_t hPhysicalMem ///< [in][release] handle of the physical memory object to release.
41394140
);
41404141

4142+
///////////////////////////////////////////////////////////////////////////////
4143+
/// @brief Physical memory range info queries.
4144+
typedef enum ur_physical_mem_info_t {
4145+
UR_PHYSICAL_MEM_INFO_CONTEXT = 0, ///< [::ur_context_handle_t] context in which the physical memory object
4146+
///< was created.
4147+
UR_PHYSICAL_MEM_INFO_DEVICE = 1, ///< [::ur_device_handle_t] device associated with this physical memory
4148+
///< object.
4149+
UR_PHYSICAL_MEM_INFO_SIZE = 2, ///< [size_t] actual size of the physical memory object in bytes.
4150+
UR_PHYSICAL_MEM_INFO_PROPERTIES = 3, ///< [::ur_physical_mem_properties_t] properties set when creating this
4151+
///< physical memory object.
4152+
UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT = 4, ///< [uint32_t] Reference count of the physical memory object.
4153+
///< The reference count returned should be considered immediately stale.
4154+
///< It is unsuitable for general use in applications. This feature is
4155+
///< provided for identifying memory leaks.
4156+
/// @cond
4157+
UR_PHYSICAL_MEM_INFO_FORCE_UINT32 = 0x7fffffff
4158+
/// @endcond
4159+
4160+
} ur_physical_mem_info_t;
4161+
4162+
///////////////////////////////////////////////////////////////////////////////
4163+
/// @brief Get information about a physical memory object.
4164+
///
4165+
/// @returns
4166+
/// - ::UR_RESULT_SUCCESS
4167+
/// - ::UR_RESULT_ERROR_UNINITIALIZED
4168+
/// - ::UR_RESULT_ERROR_DEVICE_LOST
4169+
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
4170+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
4171+
/// + `NULL == hPhysicalMem`
4172+
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
4173+
/// + `::UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT < propName`
4174+
UR_APIEXPORT ur_result_t UR_APICALL
4175+
urPhysicalMemGetInfo(
4176+
ur_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object to query.
4177+
ur_physical_mem_info_t propName, ///< [in] type of the info to query.
4178+
size_t propSize, ///< [in] size in bytes of the memory pointed to by pPropValue.
4179+
void *pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding
4180+
///< the info. If propSize is less than the real number of bytes needed to
4181+
///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is
4182+
///< returned and pPropValue is not used.
4183+
size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName."
4184+
);
4185+
41414186
#if !defined(__GNUC__)
41424187
#pragma endregion
41434188
#endif
@@ -8517,6 +8562,7 @@ urCommandBufferReleaseExp(
85178562
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
85188563
/// + `NULL == hCommandBuffer`
85198564
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
8565+
/// - ::UR_RESULT_ERROR_INVALID_OPERATION - "If `hCommandBuffer` has already been finalized"
85208566
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
85218567
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
85228568
UR_APIEXPORT ur_result_t UR_APICALL
@@ -11317,6 +11363,18 @@ typedef struct ur_physical_mem_release_params_t {
1131711363
ur_physical_mem_handle_t *phPhysicalMem;
1131811364
} ur_physical_mem_release_params_t;
1131911365

11366+
///////////////////////////////////////////////////////////////////////////////
11367+
/// @brief Function parameters for urPhysicalMemGetInfo
11368+
/// @details Each entry is a pointer to the parameter passed to the function;
11369+
/// allowing the callback the ability to modify the parameter's value
11370+
typedef struct ur_physical_mem_get_info_params_t {
11371+
ur_physical_mem_handle_t *phPhysicalMem;
11372+
ur_physical_mem_info_t *ppropName;
11373+
size_t *ppropSize;
11374+
void **ppPropValue;
11375+
size_t **ppPropSizeRet;
11376+
} ur_physical_mem_get_info_params_t;
11377+
1132011378
///////////////////////////////////////////////////////////////////////////////
1132111379
/// @brief Function parameters for urAdapterGet
1132211380
/// @details Each entry is a pointer to the parameter passed to the function;

include/ur_api_funcs.def

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ _UR_API(urMemImageGetInfo)
9696
_UR_API(urPhysicalMemCreate)
9797
_UR_API(urPhysicalMemRetain)
9898
_UR_API(urPhysicalMemRelease)
99+
_UR_API(urPhysicalMemGetInfo)
99100
_UR_API(urAdapterGet)
100101
_UR_API(urAdapterRelease)
101102
_UR_API(urAdapterRetain)

include/ur_ddi.h

+10
Original file line numberDiff line numberDiff line change
@@ -978,12 +978,22 @@ typedef ur_result_t(UR_APICALL *ur_pfnPhysicalMemRetain_t)(
978978
typedef ur_result_t(UR_APICALL *ur_pfnPhysicalMemRelease_t)(
979979
ur_physical_mem_handle_t);
980980

981+
///////////////////////////////////////////////////////////////////////////////
982+
/// @brief Function-pointer for urPhysicalMemGetInfo
983+
typedef ur_result_t(UR_APICALL *ur_pfnPhysicalMemGetInfo_t)(
984+
ur_physical_mem_handle_t,
985+
ur_physical_mem_info_t,
986+
size_t,
987+
void *,
988+
size_t *);
989+
981990
///////////////////////////////////////////////////////////////////////////////
982991
/// @brief Table of PhysicalMem functions pointers
983992
typedef struct ur_physical_mem_dditable_t {
984993
ur_pfnPhysicalMemCreate_t pfnCreate;
985994
ur_pfnPhysicalMemRetain_t pfnRetain;
986995
ur_pfnPhysicalMemRelease_t pfnRelease;
996+
ur_pfnPhysicalMemGetInfo_t pfnGetInfo;
987997
} ur_physical_mem_dditable_t;
988998

989999
///////////////////////////////////////////////////////////////////////////////

include/ur_print.h

+16
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemFlags(enum ur_physical_mem
594594
/// - `buff_size < out_size`
595595
UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemProperties(const struct ur_physical_mem_properties_t params, char *buffer, const size_t buff_size, size_t *out_size);
596596

597+
///////////////////////////////////////////////////////////////////////////////
598+
/// @brief Print ur_physical_mem_info_t enum
599+
/// @returns
600+
/// - ::UR_RESULT_SUCCESS
601+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
602+
/// - `buff_size < out_size`
603+
UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemInfo(enum ur_physical_mem_info_t value, char *buffer, const size_t buff_size, size_t *out_size);
604+
597605
///////////////////////////////////////////////////////////////////////////////
598606
/// @brief Print ur_program_metadata_type_t enum
599607
/// @returns
@@ -1850,6 +1858,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemRetainParams(const struct
18501858
/// - `buff_size < out_size`
18511859
UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemReleaseParams(const struct ur_physical_mem_release_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
18521860

1861+
///////////////////////////////////////////////////////////////////////////////
1862+
/// @brief Print ur_physical_mem_get_info_params_t struct
1863+
/// @returns
1864+
/// - ::UR_RESULT_SUCCESS
1865+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
1866+
/// - `buff_size < out_size`
1867+
UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemGetInfoParams(const struct ur_physical_mem_get_info_params_t *params, char *buffer, const size_t buff_size, size_t *out_size);
1868+
18531869
///////////////////////////////////////////////////////////////////////////////
18541870
/// @brief Print ur_adapter_get_params_t struct
18551871
/// @returns

0 commit comments

Comments
 (0)