Skip to content

Commit 88e71c0

Browse files
authored
Merge pull request #881 from veselypeta/petr/bump_adapters
[ADAPTERS] Bump adapters branch to commit used in SYCL
2 parents d0200e3 + 294a4d6 commit 88e71c0

26 files changed

+222
-91
lines changed

.github/workflows/cmake.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ jobs:
5858
cd ..
5959
6060
- name: Download DPC++
61+
if: matrix.os == 'ubuntu-22.04'
6162
run: |
6263
sudo apt install libncurses5
63-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
64-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
64+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
65+
mkdir -p ${{github.workspace}}/dpcpp_compiler
66+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
6567
6668
- name: Configure CMake
69+
if: matrix.os == 'ubuntu-22.04'
6770
run: >
6871
cmake
6972
-B${{github.workspace}}/build
@@ -77,6 +80,20 @@ jobs:
7780
${{matrix.libbacktrace}}
7881
${{matrix.pool_tracking}}
7982
83+
- name: Configure CMake
84+
if: matrix.os == 'ubuntu-20.04'
85+
run: >
86+
cmake
87+
-B${{github.workspace}}/build
88+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
89+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
90+
-DUR_ENABLE_TRACING=ON
91+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
92+
-DUR_BUILD_TESTS=ON
93+
-DUR_FORMAT_CPP_STYLE=ON
94+
${{matrix.libbacktrace}}
95+
${{matrix.pool_tracking}}
96+
8097
- name: Generate source from spec, check for uncommitted diff
8198
if: matrix.os == 'ubuntu-22.04'
8299
run: cmake --build ${{github.workspace}}/build --target check-generated
@@ -159,7 +176,7 @@ jobs:
159176

160177
- name: Download DPC++
161178
run: |
162-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-08-31/sycl_linux.tar.gz
179+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
163180
mkdir dpcpp_compiler
164181
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
165182

CMakeLists.txt

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
1818
set(CMAKE_FIND_FRAMEWORK NEVER)
1919
endif()
2020

21-
find_package(Python3 COMPONENTS Interpreter)
21+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
2222

2323
set(CMAKE_CXX_STANDARD 17)
2424
set(CMAKE_CXX_STANDARD_REQUIRED YES)
2525

2626
# Build Options
27-
option(UR_DEVELOPER_MODE "enable developer checks, treats warnings as errors" OFF)
2827
option(UR_BUILD_TESTS "Build unit tests." ON)
28+
option(UR_BUILD_TOOLS "build ur tools" ON)
2929
option(UR_FORMAT_CPP_STYLE "format code style of C++ sources" OFF)
30+
option(UR_DEVELOPER_MODE "enable developer checks, treats warnings as errors" OFF)
3031
option(UR_USE_ASAN "enable AddressSanitizer" OFF)
3132
option(UR_USE_UBSAN "enable UndefinedBehaviorSanitizer" OFF)
3233
option(UR_USE_MSAN "enable MemorySanitizer" OFF)
3334
option(UR_USE_TSAN "enable ThreadSanitizer" OFF)
34-
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
3535
option(UR_ENABLE_TRACING "enable api tracing through xpti" OFF)
36-
option(VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF)
37-
option(UR_BUILD_TOOLS "build ur tools" ON)
36+
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
3837
option(UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" OFF)
3938
option(UR_BUILD_ADAPTER_L0 "build level 0 adapter from SYCL" OFF)
4039
option(UR_BUILD_ADAPTER_OPENCL "build opencl adapter from SYCL" OFF)
4140
option(UR_BUILD_ADAPTER_CUDA "build cuda adapter from SYCL" OFF)
4241
option(UR_BUILD_ADAPTER_HIP "build hip adapter from SYCL" OFF)
4342
option(UR_BUILD_EXAMPLE_CODEGEN "Build the codegen example." OFF)
43+
option(VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF)
4444

4545
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
4646
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -135,23 +135,15 @@ if(UR_USE_MSAN)
135135
add_sanitizer_flag(memory)
136136
endif()
137137

138-
# Allow custom third_party folder
139-
if(NOT DEFINED THIRD_PARTY_DIR)
140-
set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
141-
endif()
142-
143-
find_program(CLANG_FORMAT NAMES clang-format-15 clang-format-15.0 clang-format)
144-
145-
set(CLANG_FORMAT_REQUIRED "15.0")
138+
# Check if clang-format (in correct version) is available for Cpp code formatting.
139+
if(UR_FORMAT_CPP_STYLE)
140+
find_program(CLANG_FORMAT NAMES clang-format-15 clang-format-15.0 clang-format)
146141

147-
if(CLANG_FORMAT)
148-
get_program_version_major_minor(${CLANG_FORMAT} CLANG_FORMAT_VERSION)
149-
message(STATUS "Found clang-format: ${CLANG_FORMAT} (version: ${CLANG_FORMAT_VERSION})")
150-
endif()
142+
if(CLANG_FORMAT)
143+
get_program_version_major_minor(${CLANG_FORMAT} CLANG_FORMAT_VERSION)
144+
message(STATUS "Found clang-format: ${CLANG_FORMAT} (version: ${CLANG_FORMAT_VERSION})")
151145

152-
# Check if the correct version of clang-format is available
153-
if(UR_FORMAT_CPP_STYLE)
154-
if(CLANG_FORMAT)
146+
set(CLANG_FORMAT_REQUIRED "15.0")
155147
if(NOT (CLANG_FORMAT_VERSION VERSION_EQUAL CLANG_FORMAT_REQUIRED))
156148
message(FATAL_ERROR "required clang-format version is ${CLANG_FORMAT_REQUIRED}")
157149
endif()
@@ -160,7 +152,7 @@ if(UR_FORMAT_CPP_STYLE)
160152
endif()
161153
endif()
162154

163-
# Obtain files for clang-format
155+
# Obtain files for clang-format and license check
164156
set(format_glob)
165157
set(license_glob)
166158
foreach(dir examples include source test tools)
@@ -185,7 +177,7 @@ endforeach()
185177
file(GLOB_RECURSE format_src ${format_glob})
186178
file(GLOB_RECURSE license_src ${license_glob})
187179

188-
# check for licence
180+
# Add license check target
189181
list(FILTER license_src EXCLUDE REGEX "registry.yml")
190182
add_custom_target(verify-licenses
191183
COMMAND ${Python3_EXECUTABLE}
@@ -196,9 +188,13 @@ add_custom_target(verify-licenses
196188

197189
# Add code formatter target
198190
add_custom_target(cppformat)
191+
# ... and all source files to the formatter
192+
add_cppformat(all-sources ${format_src})
199193

200-
# Add files to the formatter
201-
add_cppformat(src-formatter ${format_src})
194+
# Allow custom third_party folder
195+
if(NOT DEFINED THIRD_PARTY_DIR)
196+
set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
197+
endif()
202198

203199
add_subdirectory(${THIRD_PARTY_DIR})
204200

@@ -278,5 +274,5 @@ if(UR_FORMAT_CPP_STYLE)
278274
DEPENDS generate
279275
)
280276
else()
281-
message(WARNING "UR_FORMAT_CPP_STYLE not set. Targets: 'generate' and 'check-generated' and not available")
277+
message(STATUS " UR_FORMAT_CPP_STYLE not set. Targets: 'generate' and 'check-generated' are not available")
282278
endif()

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ see cmake options for details.
2222
- [Weekly tags](#weekly-tags)
2323
- [Third-Party tools](#third-party-tools)
2424
- [Building](#building)
25+
- [Requirements](#requirements)
2526
- [Windows](#windows)
2627
- [Linux](#linux)
2728
- [CMake standard options](#cmake-standard-options)
@@ -79,9 +80,14 @@ Tools can be acquired via instructions in [third_party](/third_party/README.md).
7980

8081
## Building
8182

82-
Requirements:
83+
### Requirements
84+
85+
Required packages:
8386
- C++ compiler with C++17 support
8487
- [CMake](https://cmake.org/) >= 3.14.0
88+
- Python v3.6.6 or later
89+
90+
For development and contributions:
8591
- clang-format-15.0 (can be installed with `python -m pip install clang-format==15.0.7`)
8692

8793
### Windows

cmake/match.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
for i, match_line in enumerate(match_lines):
3131
if match_line.startswith(opt):
3232
optional_line = True
33-
match_line = match_line.removeprefix(opt)
33+
match_line = match_line[len(opt):]
3434
else:
3535
optional_line = False
3636

include/ur.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,10 @@ def __str__(self):
641641
## @brief AMD GCN
642642
UR_DEVICE_BINARY_TARGET_AMDGCN = "amdgcn"
643643

644+
###############################################################################
645+
## @brief Native CPU
646+
UR_DEVICE_BINARY_TARGET_NATIVE_CPU = "native_cpu"
647+
644648
###############################################################################
645649
## @brief Device Binary Type
646650
class ur_device_binary_t(Structure):
@@ -828,6 +832,7 @@ class ur_device_info_v(IntEnum):
828832
## is implementation-defined, but newer devices should have a higher
829833
## version than older devices.
830834
VIRTUAL_MEMORY_SUPPORT = 114 ## [::ur_bool_t] return true if the device supports virtual memory.
835+
ESIMD_SUPPORT = 115 ## [::ur_bool_t] return true if the device supports ESIMD.
831836
BINDLESS_IMAGES_SUPPORT_EXP = 0x2000 ## [::ur_bool_t] returns true if the device supports the creation of
832837
## bindless images
833838
BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001 ## [::ur_bool_t] returns true if the device supports the creation of

include/ur_api.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,12 @@ typedef enum ur_platform_backend_t {
12251225
#define UR_DEVICE_BINARY_TARGET_AMDGCN "amdgcn"
12261226
#endif // UR_DEVICE_BINARY_TARGET_AMDGCN
12271227

1228+
///////////////////////////////////////////////////////////////////////////////
1229+
#ifndef UR_DEVICE_BINARY_TARGET_NATIVE_CPU
1230+
/// @brief Native CPU
1231+
#define UR_DEVICE_BINARY_TARGET_NATIVE_CPU "native_cpu"
1232+
#endif // UR_DEVICE_BINARY_TARGET_NATIVE_CPU
1233+
12281234
///////////////////////////////////////////////////////////////////////////////
12291235
/// @brief Device Binary Type
12301236
typedef struct ur_device_binary_t {
@@ -1455,6 +1461,7 @@ typedef enum ur_device_info_t {
14551461
///< is implementation-defined, but newer devices should have a higher
14561462
///< version than older devices.
14571463
UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 114, ///< [::ur_bool_t] return true if the device supports virtual memory.
1464+
UR_DEVICE_INFO_ESIMD_SUPPORT = 115, ///< [::ur_bool_t] return true if the device supports ESIMD.
14581465
UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP = 0x2000, ///< [::ur_bool_t] returns true if the device supports the creation of
14591466
///< bindless images
14601467
UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001, ///< [::ur_bool_t] returns true if the device supports the creation of
@@ -4408,8 +4415,6 @@ urProgramCreateWithNativeHandle(
44084415
/// @brief Create kernel object from a program.
44094416
///
44104417
/// @details
4411-
/// - Multiple calls to this function will return identical device handles,
4412-
/// in the same order.
44134418
/// - The application may call this function from simultaneous threads.
44144419
/// - The implementation of this function should be lock-free.
44154420
///

scripts/core/device.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ desc: "AMD GCN"
6161
name: "$X_DEVICE_BINARY_TARGET_AMDGCN"
6262
value: "\"amdgcn\""
6363
--- #--------------------------------------------------------------------------
64+
type: macro
65+
desc: "Native CPU"
66+
name: "$X_DEVICE_BINARY_TARGET_NATIVE_CPU"
67+
value: "\"native_cpu\""
68+
--- #--------------------------------------------------------------------------
6469
type: struct
6570
desc: "Device Binary Type"
6671
name: $x_device_binary_t
@@ -385,6 +390,8 @@ etors:
385390
desc: "[uint32_t] The device IP version. The meaning of the device IP version is implementation-defined, but newer devices should have a higher version than older devices."
386391
- name: VIRTUAL_MEMORY_SUPPORT
387392
desc: "[$x_bool_t] return true if the device supports virtual memory."
393+
- name: ESIMD_SUPPORT
394+
desc: "[$x_bool_t] return true if the device supports ESIMD."
388395
--- #--------------------------------------------------------------------------
389396
type: function
390397
desc: "Retrieves various information about device"

scripts/core/kernel.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ name: Create
1919
decl: static
2020
ordinal: "0"
2121
details:
22-
- "Multiple calls to this function will return identical device handles, in the same order."
2322
- "The application may call this function from simultaneous threads."
2423
- "The implementation of this function should be lock-free."
2524
params:

source/adapters/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endfunction()
3030

3131
add_subdirectory(null)
3232

33-
set(INTEL_LLVM_TAG nightly-2023-08-20)
33+
set(INTEL_LLVM_TAG nightly-2023-09-20)
3434

3535
if(UR_BUILD_ADAPTER_L0)
3636
set(SYCL_ADAPTER_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/level_zero")

source/common/ur_params.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,6 +2854,10 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
28542854
os << "UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT";
28552855
break;
28562856

2857+
case UR_DEVICE_INFO_ESIMD_SUPPORT:
2858+
os << "UR_DEVICE_INFO_ESIMD_SUPPORT";
2859+
break;
2860+
28572861
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP:
28582862
os << "UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP";
28592863
break;
@@ -4492,6 +4496,20 @@ inline void serializeTagged(std::ostream &os, const void *ptr,
44924496
os << ")";
44934497
} break;
44944498

4499+
case UR_DEVICE_INFO_ESIMD_SUPPORT: {
4500+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4501+
if (sizeof(ur_bool_t) > size) {
4502+
os << "invalid size (is: " << size
4503+
<< ", expected: >=" << sizeof(ur_bool_t) << ")";
4504+
return;
4505+
}
4506+
os << (void *)(tptr) << " (";
4507+
4508+
os << *tptr;
4509+
4510+
os << ")";
4511+
} break;
4512+
44954513
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: {
44964514
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
44974515
if (sizeof(ur_bool_t) > size) {

0 commit comments

Comments
 (0)