Skip to content

Commit

Permalink
Merge branch 'adapters' into cuda-cmd-buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanC committed Oct 30, 2023
2 parents 74f42f8 + 2417fcf commit df79dad
Show file tree
Hide file tree
Showing 39 changed files with 1,013 additions and 792 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ source/adapters/opencl @oneapi-src/unified-runtime-opencl-write
source/adapters/**/command_buffer.* @oneapi-src/unified-runtime-command-buffer-write
scripts/core/EXP-COMMAND-BUFFER.rst @oneapi-src/unified-runtime-command-buffer-write
scripts/core/exp-command-buffer.yml @oneapi-src/unified-runtime-command-buffer-write

# Bindless Images experimental feature
scripts/core/EXP-BINDLESS-IMAGES.rst @oneapi-src/unified-runtime-bindless-images-write
scripts/core/exp-bindless-images.yml @oneapi-src/unified-runtime-bindless-images-write
source/adapters/**/image.* @oneapi-src/unified-runtime-bindless-images-write
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
project(unified-runtime VERSION 0.7.0)
project(unified-runtime VERSION 0.8.0)

include(GNUInstallDirs)
include(CheckCXXSourceCompiles)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ List of options provided by CMake:
| UR_BUILD_ADAPTER_CUDA | Fetch and use cuda adapter from SYCL | ON/OFF | OFF |
| UR_BUILD_ADAPTER_HIP | Fetch and use hip adapter from SYCL | ON/OFF | OFF |
| UR_HIP_PLATFORM | Build hip adapter for AMD or NVIDIA platform | AMD/NVIDIA | AMD |
| UR_ENABLE_COMGR | Enable comgr lib usage | AMD/NVIDIA | AMD |

### Additional make targets

Expand Down
2 changes: 1 addition & 1 deletion cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function(add_ur_target_compile_options name)
endif()
elseif(MSVC)
target_compile_options(${name} PRIVATE
/MP
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
/W3
/MD$<$<CONFIG:Debug>:d>
/GS
Expand Down
5 changes: 3 additions & 2 deletions include/ur.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
@file ur.py
@version v0.7-r0
@version v0.8-r0
"""
import platform
Expand Down Expand Up @@ -570,7 +570,8 @@ def __str__(self):
class ur_api_version_v(IntEnum):
_0_6 = UR_MAKE_VERSION( 0, 6 ) ## version 0.6
_0_7 = UR_MAKE_VERSION( 0, 7 ) ## version 0.7
CURRENT = UR_MAKE_VERSION( 0, 7 ) ## latest known version
_0_8 = UR_MAKE_VERSION( 0, 8 ) ## version 0.8
CURRENT = UR_MAKE_VERSION( 0, 8 ) ## latest known version

class ur_api_version_t(c_int):
def __str__(self):
Expand Down
5 changes: 3 additions & 2 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
* @file ur_api.h
* @version v0.7-r0
* @version v0.8-r0
*
*/
#ifndef UR_API_H_INCLUDED
Expand Down Expand Up @@ -1022,7 +1022,8 @@ urPlatformGetInfo(
typedef enum ur_api_version_t {
UR_API_VERSION_0_6 = UR_MAKE_VERSION(0, 6), ///< version 0.6
UR_API_VERSION_0_7 = UR_MAKE_VERSION(0, 7), ///< version 0.7
UR_API_VERSION_CURRENT = UR_MAKE_VERSION(0, 7), ///< latest known version
UR_API_VERSION_0_8 = UR_MAKE_VERSION(0, 8), ///< version 0.8
UR_API_VERSION_CURRENT = UR_MAKE_VERSION(0, 8), ///< latest known version
/// @cond
UR_API_VERSION_FORCE_UINT32 = 0x7fffffff
/// @endcond
Expand Down
2 changes: 1 addition & 1 deletion include/ur_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
* @file ur_ddi.h
* @version v0.7-r0
* @version v0.8-r0
*
*/
#ifndef UR_DDI_H_INCLUDED
Expand Down
2 changes: 1 addition & 1 deletion scripts/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Intel One API Unified Runtime API"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v0.7
PROJECT_NUMBER = v0.8

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
80 changes: 0 additions & 80 deletions scripts/ci.py

This file was deleted.

9 changes: 9 additions & 0 deletions scripts/core/INTRO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,15 @@ Specific environment variables can be set to control the behavior of unified run

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

.. envvar:: UR_ADAPTERS_DEEP_BIND

If set, the loader will use `RTLD_DEEPBIND` when opening adapter libraries. This might be useful if an adapter
requires a different version of a shared library compared to the rest of the applcation.

.. note::

This environment variable is Linux-only.

.. envvar:: UR_ENABLE_LAYERS

Holds a comma-separated list of layers to enable in addition to any specified via ``urInit``.
Expand Down
3 changes: 3 additions & 0 deletions scripts/core/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ etors:
- name: "0_7"
value: "$X_MAKE_VERSION( 0, 7 )"
desc: "version 0.7"
- name: "0_8"
value: "$X_MAKE_VERSION( 0, 8 )"
desc: "version 0.8"
--- #--------------------------------------------------------------------------
type: function
desc: "Returns the API version supported by the specified platform"
Expand Down
4 changes: 2 additions & 2 deletions scripts/parse_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import ctypes
import itertools

default_version = "0.7"
all_versions = ["0.6", "0.7"]
default_version = "0.8"
all_versions = ["0.6", "0.7", "0.8"]

"""
preprocess object
Expand Down
26 changes: 18 additions & 8 deletions scripts/templates/params.hpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ from templates import helper as th
${x}_params::serializePtr(os, ${caller.body()});
%elif th.type_traits.is_handle(itype):
${x}_params::serializePtr(os, ${caller.body()});
%elif iname and iname.startswith("pfn"):
os << reinterpret_cast<void*>(${caller.body()});
%else:
os << ${caller.body()};
%endif
Expand Down Expand Up @@ -104,7 +106,7 @@ template <> struct is_handle<${th.make_type_name(n, tags, obj)}> : std::true_typ
%endfor
template <typename T>
inline constexpr bool is_handle_v = is_handle<T>::value;
template <typename T> inline void serializePtr(std::ostream &os, T *ptr);
template <typename T> inline void serializePtr(std::ostream &os, const T *ptr);
template <typename T> inline void serializeFlag(std::ostream &os, uint32_t flag);
template <typename T> inline void serializeTagged(std::ostream &os, const void *ptr, T value, size_t size);

Expand Down Expand Up @@ -192,7 +194,11 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
case ${ename}: {
%if th.value_traits.is_array(vtype):
<% atype = th.value_traits.get_array_name(vtype) %>
%if 'void' in atype:
const ${atype} const *tptr = (const ${atype} const*)ptr;
%else:
const ${atype} *tptr = (const ${atype} *)ptr;
%endif
%if "char" in atype: ## print char* arrays as simple NULL-terminated strings
serializePtr(os, tptr);
%else:
Expand All @@ -209,12 +215,16 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
os << "}";
%endif
%else:
%if 'void' in vtype:
const ${vtype} const *tptr = (const ${vtype} const *)ptr;
%else:
const ${vtype} *tptr = (const ${vtype} *)ptr;
%endif
if (sizeof(${vtype}) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(${vtype}) << ")";
return;
}
os << (void *)(tptr) << " (";
os << (const void *)(tptr) << " (";
<%call expr="member(tptr, vtype, False)">
*tptr
</%call>
Expand All @@ -237,7 +247,7 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
}

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

namespace ${x}_params {

template <typename T> inline void serializePtr(std::ostream &os, T *ptr) {
template <typename T> inline void serializePtr(std::ostream &os, const T *ptr) {
if (ptr == nullptr) {
os << "nullptr";
} else if constexpr (std::is_pointer_v<T>) {
os << (void *)(ptr) << " (";
os << (const void *)(ptr) << " (";
serializePtr(os, *ptr);
os << ")";
} else if constexpr (std::is_void_v<T> || is_handle_v<T *>) {
os << (void *)ptr;
os << (const void *)ptr;
} else if constexpr (std::is_same_v<std::remove_cv_t< T >, char>) {
os << (void *)(ptr) << " (";
os << (const void *)(ptr) << " (";
os << ptr;
os << ")";
} else {
os << (void *)(ptr) << " (";
os << (const void *)(ptr) << " (";
os << *ptr;
os << ")";
}
Expand Down
Loading

0 comments on commit df79dad

Please sign in to comment.