Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8214bf2
[UR][CTS] Upstream CTS parser
Aug 21, 2023
0625273
[umf] extend error message for disjoint pool
igchor Aug 22, 2023
17e719f
Make urInit and urTearDown loader-only
callumfare Aug 25, 2023
f7682a2
Merge pull request #793 from callumfare/callum/loader_init
pbalcer Aug 28, 2023
790384e
[UR] Refactor CTS parser to use JSON output from tests
Aug 28, 2023
2118102
Merge pull request #822 from veselypeta/petr/820/fix-invalid-native-c…
veselypeta Aug 28, 2023
40a6846
[CMDBUF] Add fill commands to cmd buffer exp feature
Bensuo Aug 21, 2023
26b9d82
[UR] List available tests and track crashes
Aug 28, 2023
19f391b
Merge pull request #818 from Bensuo/cmd-buffer-fill
kbenzie Aug 29, 2023
b079f63
[UR] Fetch testsuite names from ctest
Aug 29, 2023
04bd987
Merge pull request #810 from veselypeta/petr/port-ctest-parser
veselypeta Aug 30, 2023
2580e08
[UR] Fixup minor CTS issues
veselypeta Aug 31, 2023
a8e4955
Fix device CTS tests (#834)
Aug 31, 2023
4ce5cdd
Merge pull request #835 from veselypeta/petr/fixup-cts
veselypeta Sep 1, 2023
fd93ee0
Move nightly CI tests to the main branch
PatKamin Sep 1, 2023
7b5956a
Speed up CI jobs
PatKamin Sep 1, 2023
4c7cb30
[umf] add critnib datastructure
igchor Aug 10, 2023
c8a2d34
[umf] replace memory tracker with a critnib-based impl
igchor Aug 10, 2023
fe44f26
[umf] add windows support to critnib
igchor Aug 10, 2023
273c82b
Merge pull request #846 from PatKamin/main-shorten-ci
pbalcer Sep 4, 2023
022bbae
Merge pull request #844 from PatKamin/fix-nightly-tests
pbalcer Sep 4, 2023
eb061c8
Merge pull request #841 from igchor/disjoint_pool_extend_error
pbalcer Sep 5, 2023
845357b
[UR] Fix program CTS assesion checks
veselypeta Sep 6, 2023
a3120e7
Merge pull request #850 from veselypeta/petr/fix-program-cts
veselypeta Sep 6, 2023
6d59b4c
Merge pull request #796 from igchor/umf_critnib
pbalcer Sep 7, 2023
2c533e6
Update specification for urEnqueue entrypoints (#851)
Sep 7, 2023
065edc1
[umf] Fix macOS build
kbenzie Sep 11, 2023
172bc24
Merge pull request #853 from kbenzie/benie/fix-macos-build
kbenzie Sep 11, 2023
017c998
Create layered image properties struct.
isaacault Sep 8, 2023
8edc7e2
Add initial CUDA and HIP usage guides
Aug 22, 2023
764ecf2
Merge pull request #852 from isaacault/iault/layered_image_prop_struct
kbenzie Sep 12, 2023
b29b23c
[UMF] Fix -Wempty-body warning
veselypeta Sep 12, 2023
8b3da24
Merge pull request #815 from hdelan/add-cuda-hip-usage-guides
kbenzie Sep 12, 2023
739d11c
[UR] Enable warnings for empty-body
veselypeta Sep 12, 2023
a346a30
Merge pull request #855 from veselypeta/petr/fix-empty-body-warning
pbalcer Sep 13, 2023
db69f90
Add extra checks for optional parameters and invalid flags (#857)
Sep 13, 2023
04b5da3
Add more detailed build instructions to the Contribution Guide
callumfare Sep 13, 2023
fdffac3
Clarify the behaviour of urUSMMemAdvise and urUSMPrefetch when the hi…
Sep 14, 2023
bcf2b2a
Merge pull request #858 from callumfare/callum/update_contrib_build_g…
callumfare Sep 14, 2023
019551c
[UR] Add validation check to urDeviceGet
Sep 15, 2023
bb542f3
Add cooperative kernels experimental feature
0x12CC Sep 5, 2023
12c8312
Merge pull request #849 from 0x12CC/cooperative_kernels
kbenzie Sep 15, 2023
b8cc5ae
Merge pull request #860 from veselypeta/petr/fix-device-get-errorcodes
pbalcer Sep 18, 2023
5640ea6
[Bindless] Struct for unique addressing modes per dimension
Seanst98 Sep 6, 2023
099fe5e
Merge pull request #863 from Seanst98/sean/addr-mode-per-dimension
kbenzie Sep 18, 2023
494233b
[UR] Check for unused parameters
Sep 15, 2023
bd4f75d
[UR] fix warnings in collector
Sep 15, 2023
747613b
[UR] Remove parameters from main
Sep 18, 2023
7217fd7
[UR] Support Raw C Arrays
Sep 18, 2023
88c7f8f
[UR] Remove parameter names
Sep 19, 2023
e40a321
Merge pull request #861 from veselypeta/petr/add-unused-parameter-checks
veselypeta Sep 19, 2023
28ac2e1
[cmake] Respect Python virtualenv on macOS
kbenzie Sep 19, 2023
e9aa0f4
[UR] Address Review Feedback
Sep 19, 2023
9a9d2e8
Merge pull request #870 from veselypeta/petr/860/support-raw-c-arrays
veselypeta Sep 19, 2023
dcbf226
Merge pull request #872 from kbenzie/benie/macos-respect-python-virtu…
kbenzie Sep 19, 2023
d47bd7e
Fix a few small spec issues:
aarongreig Sep 19, 2023
1dc6a52
Merge pull request #873 from aarongreig/aaron/miscSpecFixes
aarongreig Sep 19, 2023
db42003
Fix a few minor CTS issues, notably:
aarongreig Sep 20, 2023
fe4402d
Merge pull request #874 from aarongreig/aaron/miscCTSFixes
aarongreig Sep 20, 2023
1cccb50
[EXP][CMDBUF] Add Prefetch and Advise commands to cmd buffer experime…
Sep 22, 2023
57b452c
Update scripts/core/EXP-COMMAND-BUFFER.rst
Sep 25, 2023
043b4d2
Update scripts/core/exp-command-buffer.yml
Sep 25, 2023
267c89f
[SYCL][Graph] Adds a detail section in the comment of bith functions
Sep 25, 2023
b12b606
[SYCL][Graph] Adds dependencies to the Advise function
Sep 25, 2023
b42649f
Revert "Revert "Bump adapters branch""
omarahmed1111 Oct 30, 2023
7ba8fec
Merge branch 'adapters' into revert-1015-revert-1005-merge-some-main-…
Nov 8, 2023
7c7bf22
Merge commit 'b12b606c35bb7469c1dfdf932e2917238635f02d' into merge-so…
Nov 10, 2023
07ad4f8
Fix some merge problems
Nov 8, 2023
65bfeab
Merge branch 'adapters' into merge-some-main-changes-into-adapters-se…
Nov 10, 2023
d86aada
Add more merge fixes
Nov 10, 2023
dad6534
Merge branch 'adapters' into merge-some-main-changes-into-adapters-se…
Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Nightly

on:
schedule:
# Run every day at 23:00 UTC
- cron: '0 23 * * *'

jobs:
long-fuzz-test:
name: Run long fuzz tests
strategy:
matrix:
build_type: [Debug, Release]
compiler: [{c: clang, cxx: clang++}]

runs-on: 'ubuntu-22.04'

steps:
- uses: actions/checkout@v3
# with-ref part to be removed after merging 'adapters' branch with 'main'
with:
ref: adapters

- name: Install pip packages
run: pip install -r third_party/requirements.txt

- name: Download DPC++
run: |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-08-31/sycl_linux.tar.gz
mkdir dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler

- name: Configure CMake
run: >
cmake
-B${{github.workspace}}/build
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUR_ENABLE_TRACING=ON
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUR_BUILD_TESTS=ON
-DUR_USE_ASAN=ON
-DUR_USE_UBSAN=ON
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++

- name: Build
run: >
LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
cmake --build ${{github.workspace}}/build -j $(nproc)

- name: Fuzz long test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-long"
5 changes: 3 additions & 2 deletions 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 All @@ -15,7 +15,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(helpers)

if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_FIND_FRAMEWORK NEVER)
set(Python3_FIND_FRAMEWORK NEVER)
set(Python3_FIND_STRATEGY LOCATION)
endif()

find_package(Python3 COMPONENTS Interpreter REQUIRED)
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,19 @@ Tools can be acquired via instructions in [third_party](/third_party/README.md).

## Building

The requirements and instructions below are for building the project from source
without any modifications. To make modifications to the specification, please
see the
[Contribution Guide](https://oneapi-src.github.io/unified-runtime/core/CONTRIB.html)
for more detailed instructions on the correct setup.

### Requirements

Required packages:
- C++ compiler with C++17 support
- [CMake](https://cmake.org/) >= 3.14.0
- Python v3.6.6 or later

For development and contributions:
- clang-format-15.0 (can be installed with `python -m pip install clang-format==15.0.7`)

### Windows

Generating Visual Studio Project. EXE and binaries will be in **build/bin/{build_config}**
Expand Down Expand Up @@ -154,6 +157,10 @@ It will generate the source code **and** run automated code formatting:
$ make generate
```

This target has additional dependencies which are described in the *Build
Environment* section of the
[Contribution Guide](https://oneapi-src.github.io/unified-runtime/core/CONTRIB.html).

## Contributions

For those who intend to make a contribution to the project please read our
Expand Down
4 changes: 3 additions & 1 deletion cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ function(add_ur_target_compile_options name)
-fPIC
-Wall
-Wpedantic
-Wempty-body
-Wunused-parameter
$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>
)
Expand All @@ -78,7 +80,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
6 changes: 3 additions & 3 deletions examples/codegen/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ constexpr unsigned PAGE_SIZE = 4096;

void ur_check(const ur_result_t r) {
if (r != UR_RESULT_SUCCESS) {
urTearDown(nullptr);
urLoaderTearDown();
throw std::runtime_error("Unified runtime error: " + std::to_string(r));
}
}
Expand Down Expand Up @@ -95,7 +95,7 @@ template <typename T, size_t N> struct alignas(PAGE_SIZE) AlignedArray {

int main() {
ur_loader_config_handle_t loader_config = nullptr;
ur_check(urInit(UR_DEVICE_INIT_FLAG_GPU, loader_config));
ur_check(urLoaderInit(UR_DEVICE_INIT_FLAG_GPU, loader_config));

auto adapters = get_adapters();
auto supported_adapters = get_supported_adapters(adapters);
Expand Down Expand Up @@ -172,5 +172,5 @@ int main() {
std::cout << "Results are incorrect." << std::endl;
}

return urTearDown(nullptr) == UR_RESULT_SUCCESS && expectedResult ? 0 : 1;
return urLoaderTearDown() == UR_RESULT_SUCCESS && expectedResult ? 0 : 1;
}
2 changes: 1 addition & 1 deletion examples/collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ mkdir build
$ cd build
$ cmake .. -DUR_ENABLE_TRACING=ON
$ make
$ UR_ADAPTERS_FORCE_LOAD=./lib/libur_adapter_null.so XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=./lib/libxptifw.so XPTI_SUBSCRIBERS=./lib/libcollector.so ./bin/hello_world
$ UR_ADAPTERS_FORCE_LOAD=./lib/libur_adapter_null.so UR_ENABLE_LAYERS=UR_LAYER_TRACING XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=./lib/libxptifw.so XPTI_SUBSCRIBERS=./lib/libcollector.so ./bin/hello_world
```

See [XPTI framework documentation](https://github.com/intel/llvm/blob/sycl/xptifw/doc/XPTI_Framework.md) for more information.
45 changes: 26 additions & 19 deletions examples/collector/collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,41 @@ constexpr uint16_t TRACE_FN_END =
constexpr std::string_view UR_STREAM_NAME = "ur";

/**
* @brief Formats the function parameters and arguments for urInit
* @brief Formats the function parameters and arguments for urAdapterGet
*/
std::ostream &operator<<(std::ostream &os,
const struct ur_init_params_t *params) {
os << ".device_flags = ";
if (*params->pdevice_flags & UR_DEVICE_INIT_FLAG_GPU) {
os << "UR_DEVICE_INIT_FLAG_GPU";
} else {
os << "0";
const struct ur_adapter_get_params_t *params) {
os << ".NumEntries = ";
os << *params->pNumEntries;
os << ", ";
os << ".phAdapters = ";
os << *params->pphAdapters;
if (*params->pphAdapters) {
os << " (" << **params->pphAdapters << ")";
}
os << ", ";
os << ".pNumAdapters = ";
os << *params->ppNumAdapters;
if (*params->ppNumAdapters) {
os << " (" << **params->ppNumAdapters << ")";
}
os << "";
return os;
}

/**
* A map of functions that format the parameters and arguments for each UR function.
* This example only implements a handler for one function, `urInit`, but it's
* This example only implements a handler for one function, `urAdapterGet`, but it's
* trivial to expand it to support more.
*/
static std::unordered_map<
std::string_view,
std::function<void(const xpti::function_with_args_t *, std::ostream &)>>
handlers = {{"urInit", [](const xpti::function_with_args_t *fn_args,
std::ostream &os) {
auto params = static_cast<const struct ur_init_params_t *>(
fn_args->args_data);
handlers = {{"urAdapterGet", [](const xpti::function_with_args_t *fn_args,
std::ostream &os) {
auto params =
static_cast<const struct ur_adapter_get_params_t *>(
fn_args->args_data);
os << params;
}}};

Expand All @@ -73,10 +82,9 @@ static std::unordered_map<
* On begin, it prints the function declaration with the call arguments specified,
* and on end it prints the function name with the result of the call.
*/
XPTI_CALLBACK_API void trace_cb(uint16_t trace_type,
xpti::trace_event_data_t *parent,
xpti::trace_event_data_t *event,
uint64_t instance, const void *user_data) {
XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *,
xpti::trace_event_data_t *, uint64_t instance,
const void *user_data) {
auto *args = static_cast<const xpti::function_with_args_t *>(user_data);
std::ostringstream out;
if (trace_type == TRACE_FN_BEGIN) {
Expand Down Expand Up @@ -110,8 +118,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type,
* selected trace types.
*/
XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
unsigned int minor_version,
const char *version_str,
unsigned int minor_version, const char *,
const char *stream_name) {
if (stream_name == nullptr) {
std::cout << "Stream name not provided. Aborting." << std::endl;
Expand Down Expand Up @@ -149,5 +156,5 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
*
* Can be used to cleanup state or resources.
*/
XPTI_CALLBACK_API void xptiTraceFinish(const char *stream_name) { /* noop */
XPTI_CALLBACK_API void xptiTraceFinish(const char *) { /* noop */
}
9 changes: 5 additions & 4 deletions examples/hello_world/hello_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
#include "ur_api.h"

//////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[]) {
int main(int, char *[]) {
ur_result_t status;

// Initialize the platform
status = urInit(0, nullptr);
status = urLoaderInit(0, nullptr);
if (status != UR_RESULT_SUCCESS) {
std::cout << "urInit failed with return code: " << status << std::endl;
std::cout << "urLoaderInit failed with return code: " << status
<< std::endl;
return 1;
}
std::cout << "Platform initialized.\n";
Expand Down Expand Up @@ -119,6 +120,6 @@ int main(int argc, char *argv[]) {
for (auto adapter : adapters) {
urAdapterRelease(adapter);
}
urTearDown(nullptr);
urLoaderTearDown();
return status == UR_RESULT_SUCCESS ? 0 : 1;
}
Loading