Skip to content

Commit b232631

Browse files
Revert "Bump adapters branch"
1 parent 2417fcf commit b232631

File tree

19 files changed

+337
-285
lines changed

19 files changed

+337
-285
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.14.0 FATAL_ERROR)
7-
project(unified-runtime VERSION 0.8.0)
7+
project(unified-runtime VERSION 0.7.0)
88

99
include(GNUInstallDirs)
1010
include(CheckCXXSourceCompiles)

cmake/helpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function(add_ur_target_compile_options name)
7878
endif()
7979
elseif(MSVC)
8080
target_compile_options(${name} PRIVATE
81-
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
81+
/MP
8282
/W3
8383
/MD$<$<CONFIG:Debug>:d>
8484
/GS

include/ur.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
77
88
@file ur.py
9-
@version v0.8-r0
9+
@version v0.7-r0
1010
1111
"""
1212
import platform
@@ -570,8 +570,7 @@ def __str__(self):
570570
class ur_api_version_v(IntEnum):
571571
_0_6 = UR_MAKE_VERSION( 0, 6 ) ## version 0.6
572572
_0_7 = UR_MAKE_VERSION( 0, 7 ) ## version 0.7
573-
_0_8 = UR_MAKE_VERSION( 0, 8 ) ## version 0.8
574-
CURRENT = UR_MAKE_VERSION( 0, 8 ) ## latest known version
573+
CURRENT = UR_MAKE_VERSION( 0, 7 ) ## latest known version
575574

576575
class ur_api_version_t(c_int):
577576
def __str__(self):

include/ur_api.h

Lines changed: 2 additions & 3 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.8-r0
10+
* @version v0.7-r0
1111
*
1212
*/
1313
#ifndef UR_API_H_INCLUDED
@@ -1022,8 +1022,7 @@ urPlatformGetInfo(
10221022
typedef enum ur_api_version_t {
10231023
UR_API_VERSION_0_6 = UR_MAKE_VERSION(0, 6), ///< version 0.6
10241024
UR_API_VERSION_0_7 = UR_MAKE_VERSION(0, 7), ///< version 0.7
1025-
UR_API_VERSION_0_8 = UR_MAKE_VERSION(0, 8), ///< version 0.8
1026-
UR_API_VERSION_CURRENT = UR_MAKE_VERSION(0, 8), ///< latest known version
1025+
UR_API_VERSION_CURRENT = UR_MAKE_VERSION(0, 7), ///< latest known version
10271026
/// @cond
10281027
UR_API_VERSION_FORCE_UINT32 = 0x7fffffff
10291028
/// @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.8-r0
10+
* @version v0.7-r0
1111
*
1212
*/
1313
#ifndef UR_DDI_H_INCLUDED

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.8
41+
PROJECT_NUMBER = v0.7
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/ci.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import os
2+
import sys
3+
import argparse
4+
import re
5+
import fileinput
6+
from distutils import dir_util
7+
import util
8+
9+
script_dir = os.path.dirname(os.path.abspath(__file__))
10+
root_dir = os.path.dirname(script_dir)
11+
12+
13+
"""
14+
Entry-point:
15+
publishes HTML for GitLab pages
16+
"""
17+
def publish_gitlab_html():
18+
src_html_dir = os.path.join(root_dir, "docs", "html")
19+
src_img_dir = os.path.join(root_dir, "images")
20+
tmp_dir = os.path.join(root_dir, ".public")
21+
tmp_img_dir = os.path.join(root_dir, ".public/images")
22+
publishing_dir = os.path.join(root_dir, "public")
23+
24+
# Remove dest dirs
25+
if os.path.exists(tmp_dir):
26+
print("Deleting temp dir: %s" % tmp_dir)
27+
util.removePath(tmp_dir)
28+
if os.path.exists(publishing_dir):
29+
print("Deleting publishing dir: %s" % publishing_dir)
30+
util.removePath(publishing_dir)
31+
32+
# Copy over generated content to new folder
33+
print("Copying html files from '%s' to '%s'" % (src_html_dir, tmp_dir))
34+
dir_util.copy_tree(src_html_dir, tmp_dir)
35+
36+
# Fixes html files by converting paths relative to root html folder instead of repo
37+
print("Fixing paths in html files in '%s' to be relative to root..." % (tmp_dir))
38+
regex_pattern = re.compile(r'\.\.[\/|\\]images')
39+
files = util.findFiles(tmp_dir, "*.html")
40+
print("Found %s files" % (len(files)))
41+
with fileinput.FileInput(files=files, inplace=True) as f:
42+
for line in f:
43+
print(re.sub(regex_pattern, './images', line), end='')
44+
45+
# Publish new folder to GitLab Pages folder (/public)
46+
print("Publishing to GitLab pages by renaming '%s' to '%s'" % (tmp_dir, publishing_dir))
47+
os.rename(tmp_dir, publishing_dir)
48+
49+
50+
"""
51+
Entry-point:
52+
main()
53+
"""
54+
def main(args=sys.argv[1:]):
55+
# Define args
56+
parser = argparse.ArgumentParser()
57+
parser.add_argument(
58+
"--publish-html",
59+
help="Publish html",
60+
action="store_true")
61+
62+
# Parse args
63+
options = parser.parse_args(args)
64+
65+
# Publish GitLab html
66+
if options.publish_html:
67+
try:
68+
publish_gitlab_html()
69+
except Exception as e:
70+
print(e)
71+
print("Failed")
72+
return 1
73+
74+
print("Done")
75+
return 0
76+
77+
78+
if __name__ == '__main__':
79+
sys.exit(main())
80+
# END OF FILE

scripts/core/INTRO.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,6 @@ Specific environment variables can be set to control the behavior of unified run
296296

297297
This environment variable is ignored when :envvar:`UR_ADAPTERS_FORCE_LOAD` environment variable is used.
298298

299-
.. envvar:: UR_ADAPTERS_DEEP_BIND
300-
301-
If set, the loader will use `RTLD_DEEPBIND` when opening adapter libraries. This might be useful if an adapter
302-
requires a different version of a shared library compared to the rest of the applcation.
303-
304-
.. note::
305-
306-
This environment variable is Linux-only.
307-
308299
.. envvar:: UR_ENABLE_LAYERS
309300

310301
Holds a comma-separated list of layers to enable in addition to any specified via ``urInit``.

scripts/core/platform.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ etors:
133133
- name: "0_7"
134134
value: "$X_MAKE_VERSION( 0, 7 )"
135135
desc: "version 0.7"
136-
- name: "0_8"
137-
value: "$X_MAKE_VERSION( 0, 8 )"
138-
desc: "version 0.8"
139136
--- #--------------------------------------------------------------------------
140137
type: function
141138
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
@@ -18,8 +18,8 @@
1818
import ctypes
1919
import itertools
2020

21-
default_version = "0.8"
22-
all_versions = ["0.6", "0.7", "0.8"]
21+
default_version = "0.7"
22+
all_versions = ["0.6", "0.7"]
2323

2424
"""
2525
preprocess object

scripts/templates/params.hpp.mako

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ from templates import helper as th
3636
${x}_params::serializePtr(os, ${caller.body()});
3737
%elif th.type_traits.is_handle(itype):
3838
${x}_params::serializePtr(os, ${caller.body()});
39-
%elif iname and iname.startswith("pfn"):
40-
os << reinterpret_cast<void*>(${caller.body()});
4139
%else:
4240
os << ${caller.body()};
4341
%endif
@@ -106,7 +104,7 @@ template <> struct is_handle<${th.make_type_name(n, tags, obj)}> : std::true_typ
106104
%endfor
107105
template <typename T>
108106
inline constexpr bool is_handle_v = is_handle<T>::value;
109-
template <typename T> inline void serializePtr(std::ostream &os, const T *ptr);
107+
template <typename T> inline void serializePtr(std::ostream &os, T *ptr);
110108
template <typename T> inline void serializeFlag(std::ostream &os, uint32_t flag);
111109
template <typename T> inline void serializeTagged(std::ostream &os, const void *ptr, T value, size_t size);
112110

@@ -194,11 +192,7 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
194192
case ${ename}: {
195193
%if th.value_traits.is_array(vtype):
196194
<% atype = th.value_traits.get_array_name(vtype) %>
197-
%if 'void' in atype:
198-
const ${atype} const *tptr = (const ${atype} const*)ptr;
199-
%else:
200195
const ${atype} *tptr = (const ${atype} *)ptr;
201-
%endif
202196
%if "char" in atype: ## print char* arrays as simple NULL-terminated strings
203197
serializePtr(os, tptr);
204198
%else:
@@ -215,16 +209,12 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
215209
os << "}";
216210
%endif
217211
%else:
218-
%if 'void' in vtype:
219-
const ${vtype} const *tptr = (const ${vtype} const *)ptr;
220-
%else:
221212
const ${vtype} *tptr = (const ${vtype} *)ptr;
222-
%endif
223213
if (sizeof(${vtype}) > size) {
224214
os << "invalid size (is: " << size << ", expected: >=" << sizeof(${vtype}) << ")";
225215
return;
226216
}
227-
os << (const void *)(tptr) << " (";
217+
os << (void *)(tptr) << " (";
228218
<%call expr="member(tptr, vtype, False)">
229219
*tptr
230220
</%call>
@@ -247,7 +237,7 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
247237
}
248238

249239
## structure type enum value must be first
250-
const enum ${th.make_enum_name(n, tags, obj)} *value = (const enum ${th.make_enum_name(n, tags, obj)} *)ptr;
240+
enum ${th.make_enum_name(n, tags, obj)} *value = (enum ${th.make_enum_name(n, tags, obj)} *)ptr;
251241
switch (*value) {
252242
%for n, item in enumerate(obj['etors']):
253243
<%
@@ -372,21 +362,21 @@ inline std::ostream &operator<<(std::ostream &os, const struct ${th.make_pfncb_p
372362

373363
namespace ${x}_params {
374364

375-
template <typename T> inline void serializePtr(std::ostream &os, const T *ptr) {
365+
template <typename T> inline void serializePtr(std::ostream &os, T *ptr) {
376366
if (ptr == nullptr) {
377367
os << "nullptr";
378368
} else if constexpr (std::is_pointer_v<T>) {
379-
os << (const void *)(ptr) << " (";
369+
os << (void *)(ptr) << " (";
380370
serializePtr(os, *ptr);
381371
os << ")";
382372
} else if constexpr (std::is_void_v<T> || is_handle_v<T *>) {
383-
os << (const void *)ptr;
373+
os << (void *)ptr;
384374
} else if constexpr (std::is_same_v<std::remove_cv_t< T >, char>) {
385-
os << (const void *)(ptr) << " (";
375+
os << (void *)(ptr) << " (";
386376
os << ptr;
387377
os << ")";
388378
} else {
389-
os << (const void *)(ptr) << " (";
379+
os << (void *)(ptr) << " (";
390380
os << *ptr;
391381
os << ")";
392382
}

source/common/CMakeLists.txt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
add_subdirectory(unified_malloc_framework)
7-
add_subdirectory(umf_pools)
8-
9-
add_ur_library(ur_common STATIC
10-
umf_helpers.hpp
11-
ur_pool_manager.hpp
12-
$<$<PLATFORM_ID:Windows>:windows/ur_lib_loader.cpp>
13-
$<$<PLATFORM_ID:Linux,Darwin>:linux/ur_lib_loader.cpp>
14-
)
6+
add_library(ur_common INTERFACE)
157
add_library(${PROJECT_NAME}::common ALIAS ur_common)
168

17-
target_include_directories(ur_common PUBLIC
9+
target_include_directories(ur_common INTERFACE
1810
${CMAKE_CURRENT_SOURCE_DIR}
1911
${CMAKE_SOURCE_DIR}/include
2012
)
2113

22-
target_link_libraries(ur_common PUBLIC
23-
unified_malloc_framework
24-
disjoint_pool
25-
${CMAKE_DL_LIBS}
26-
${PROJECT_NAME}::headers
27-
)
14+
add_subdirectory(unified_malloc_framework)
15+
add_subdirectory(umf_pools)
16+
target_link_libraries(ur_common INTERFACE unified_malloc_framework disjoint_pool ${CMAKE_DL_LIBS} ${PROJECT_NAME}::headers)
17+
18+
if(WIN32)
19+
target_sources(ur_common
20+
INTERFACE
21+
${CMAKE_CURRENT_SOURCE_DIR}/windows/ur_lib_loader.cpp
22+
umf_helpers.hpp ur_pool_manager.hpp
23+
)
24+
else()
25+
target_sources(ur_common
26+
INTERFACE
27+
${CMAKE_CURRENT_SOURCE_DIR}/linux/ur_lib_loader.cpp
28+
umf_helpers.hpp ur_pool_manager.hpp
29+
)
30+
endif()

source/common/linux/ur_lib_loader.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
#include "logger/ur_logger.hpp"
1313
#include "ur_lib_loader.hpp"
1414

15-
#define DEEP_BIND_ENV "UR_ADAPTERS_DEEP_BIND"
15+
#if defined(SANITIZER_ANY) || defined(__APPLE__)
16+
#define LOAD_DRIVER_LIBRARY(NAME) dlopen(NAME, RTLD_LAZY | RTLD_LOCAL)
17+
#else
18+
#define LOAD_DRIVER_LIBRARY(NAME) \
19+
dlopen(NAME, RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND)
20+
#endif
1621

1722
namespace ur_loader {
1823

@@ -29,21 +34,8 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {
2934

3035
std::unique_ptr<HMODULE, LibLoader::lib_dtor>
3136
LibLoader::loadAdapterLibrary(const char *name) {
32-
int mode = RTLD_LAZY | RTLD_LOCAL;
33-
#if !defined(__APPLE__)
34-
bool deepbind = getenv_tobool(DEEP_BIND_ENV);
35-
if (deepbind) {
36-
#if defined(SANITIZER_ANY)
37-
logger::warning(
38-
"Enabling RTLD_DEEPBIND while running under a sanitizer is likely "
39-
"to cause issues. Consider disabling {} environment variable.",
40-
DEEP_BIND_ENV);
41-
#endif
42-
mode |= RTLD_DEEPBIND;
43-
}
44-
#endif
45-
46-
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(dlopen(name, mode));
37+
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(
38+
LOAD_DRIVER_LIBRARY(name));
4739
}
4840

4941
void *LibLoader::getFunctionPtr(HMODULE handle, const char *func_name) {

0 commit comments

Comments
 (0)