Skip to content

Commit ac6915f

Browse files
authored
Merge branch 'main' into martin/updateCMakeWarningDPCXX
2 parents fe8151e + c9999a7 commit ac6915f

File tree

19 files changed

+164
-35
lines changed

19 files changed

+164
-35
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)
7-
project(unified-runtime VERSION 0.10.0)
7+
project(unified-runtime VERSION 0.11.0)
88

99
# Check if unified runtime is built as a standalone project.
1010
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR UR_STANDALONE_BUILD)

include/ur_api.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
88
*
99
* @file ur_api.h
10-
* @version v0.10-r0
10+
* @version v0.11-r0
1111
*
1212
*/
1313
#ifndef UR_API_H_INCLUDED
@@ -1133,7 +1133,8 @@ typedef enum ur_api_version_t {
11331133
UR_API_VERSION_0_8 = UR_MAKE_VERSION(0, 8), ///< version 0.8
11341134
UR_API_VERSION_0_9 = UR_MAKE_VERSION(0, 9), ///< version 0.9
11351135
UR_API_VERSION_0_10 = UR_MAKE_VERSION(0, 10), ///< version 0.10
1136-
UR_API_VERSION_CURRENT = UR_MAKE_VERSION(0, 10), ///< latest known version
1136+
UR_API_VERSION_0_11 = UR_MAKE_VERSION(0, 11), ///< version 0.11
1137+
UR_API_VERSION_CURRENT = UR_MAKE_VERSION(0, 11), ///< latest known version
11371138
/// @cond
11381139
UR_API_VERSION_FORCE_UINT32 = 0x7fffffff
11391140
/// @endcond

include/ur_ddi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
88
*
99
* @file ur_ddi.h
10-
* @version v0.10-r0
10+
* @version v0.11-r0
1111
*
1212
*/
1313
#ifndef UR_DDI_H_INCLUDED

include/ur_print.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
88
*
99
* @file ur_print.hpp
10-
* @version v0.10-r0
10+
* @version v0.11-r0
1111
*
1212
*/
1313
#ifndef UR_PRINT_HPP

scripts/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Intel One API Unified Runtime API"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = v0.10
41+
PROJECT_NUMBER = v0.11
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

scripts/core/CONTRIB.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ Adapter Change Process
127127
.. _intel/llvm:
128128
https://github.com/intel/llvm
129129
.. _UNIFIED_RUNTIME_REPO:
130-
https://github.com/intel/llvm/blob/sycl/sycl/plugins/unified_runtime/CMakeLists.txt#L102
130+
https://github.com/intel/llvm/blob/sycl/sycl/cmake/modules/FetchUnifiedRuntime.cmake#L119
131131
.. _UNIFIED_RUNTIME_TAG:
132-
https://github.com/intel/llvm/blob/sycl/sycl/plugins/unified_runtime/CMakeLists.txt#L109
132+
https://github.com/intel/llvm/blob/sycl/sycl/cmake/modules/FetchUnifiedRuntime.cmake#L126
133133

134134
Build Environment
135135
=================

scripts/core/platform.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ etors:
143143
- name: "0_10"
144144
value: "$X_MAKE_VERSION( 0, 10 )"
145145
desc: "version 0.10"
146+
- name: "0_11"
147+
value: "$X_MAKE_VERSION( 0, 11 )"
148+
desc: "version 0.11"
146149
--- #--------------------------------------------------------------------------
147150
type: function
148151
desc: "Returns the API version supported by the specified platform"

scripts/parse_specs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from version import Version
2222

2323

24-
default_version = Version("0.10")
25-
all_versions = [Version(ver) for ver in ["0.6", "0.7", "0.8", "0.9", "0.10"]]
24+
default_version = Version("0.11")
25+
all_versions = [Version(ver) for ver in ["0.6", "0.7", "0.8", "0.9", "0.10", "0.11"]]
2626

2727
"""
2828
preprocess object

source/adapters/cuda/image.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp(
961961
ur_context_handle_t, ur_exp_image_mem_native_handle_t hImageMem,
962962
ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) {
963963

964+
CUarray hCUarray;
965+
CUresult Err = cuMipmappedArrayGetLevel(
966+
&hCUarray, reinterpret_cast<CUmipmappedArray>(hImageMem), 0);
967+
968+
// If cuMipmappedArrayGetLevel failed, hImageMem is already CUarray.
969+
if (Err != CUDA_SUCCESS) {
970+
hCUarray = reinterpret_cast<CUarray>(hImageMem);
971+
}
972+
964973
CUDA_ARRAY3D_DESCRIPTOR ArrayDesc;
965-
UR_CHECK_ERROR(cuArray3DGetDescriptor(&ArrayDesc, (CUarray)hImageMem));
974+
UR_CHECK_ERROR(cuArray3DGetDescriptor(&ArrayDesc, hCUarray));
966975
switch (propName) {
967976
case UR_IMAGE_INFO_WIDTH:
968977
if (pPropValue) {

source/adapters/level_zero/adapter.cpp

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,27 @@
1212
#include "ur_level_zero.hpp"
1313
#include <iomanip>
1414

15+
// As windows order of unloading dlls is reversed from linux, windows will call
16+
// umfTearDown before it could release umf objects in level_zero, so we call
17+
// umfInit on urAdapterGet and umfAdapterTearDown to enforce the teardown of umf
18+
// after umf objects are destructed.
19+
#if defined(_WIN32)
20+
#include <umf.h>
21+
#endif
22+
1523
// Due to multiple DLLMain definitions with SYCL, Global Adapter is init at
1624
// variable creation.
1725
#if defined(_WIN32)
1826
ur_adapter_handle_t_ *GlobalAdapter = new ur_adapter_handle_t_();
1927
#else
2028
ur_adapter_handle_t_ *GlobalAdapter;
2129
#endif
22-
30+
// This is a temporary workaround on windows, where UR adapter is teardowned
31+
// before the UR loader, which will result in access violation when we use print
32+
// function as the overrided print function was already released with the UR
33+
// adapter.
34+
// TODO: Change adapters to use a common sink class in the loader instead of
35+
// using thier own sink class that inherit from logger::Sink.
2336
class ur_legacy_sink : public logger::Sink {
2437
public:
2538
ur_legacy_sink(std::string logger_name = "", bool skip_prefix = true)
@@ -32,7 +45,11 @@ class ur_legacy_sink : public logger::Sink {
3245
fprintf(stderr, "%s", msg.c_str());
3346
}
3447

35-
~ur_legacy_sink() = default;
48+
~ur_legacy_sink() {
49+
#if defined(_WIN32)
50+
logger::isTearDowned = true;
51+
#endif
52+
};
3653
};
3754

3855
ur_result_t initPlatforms(PlatformVec &platforms) noexcept try {
@@ -74,7 +91,14 @@ ur_result_t initPlatforms(PlatformVec &platforms) noexcept try {
7491
return exceptionToResult(std::current_exception());
7592
}
7693

77-
ur_result_t adapterStateInit() { return UR_RESULT_SUCCESS; }
94+
ur_result_t adapterStateInit() {
95+
96+
#if defined(_WIN32)
97+
umfInit();
98+
#endif
99+
100+
return UR_RESULT_SUCCESS;
101+
}
78102

79103
ur_adapter_handle_t_::ur_adapter_handle_t_()
80104
: logger(logger::get_logger("level_zero")) {
@@ -258,6 +282,7 @@ ur_result_t adapterStateTeardown() {
258282
// Due to multiple DLLMain definitions with SYCL, register to cleanup the
259283
// Global Adapter after refcnt is 0
260284
#if defined(_WIN32)
285+
umfTearDown();
261286
std::atexit(globalAdapterOnDemandCleanup);
262287
#endif
263288

0 commit comments

Comments
 (0)