Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
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.20.0 FATAL_ERROR)
project(unified-runtime VERSION 0.10.3)
project(unified-runtime VERSION 0.10.4)

# Check if unified runtime is built as a standalone project.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR UR_STANDALONE_BUILD)
Expand Down
15 changes: 15 additions & 0 deletions source/adapters/opencl/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ urUSMHostAlloc(ur_context_handle_t hContext, const ur_usm_desc_t *pUSMDesc,
void *Ptr = nullptr;
uint32_t Alignment = pUSMDesc ? pUSMDesc->align : 0;

if (pUSMDesc && pUSMDesc->align != 0 &&
((pUSMDesc->align & (pUSMDesc->align - 1)) != 0)) {
return UR_RESULT_ERROR_INVALID_VALUE;
}

std::vector<cl_mem_properties_intel> AllocProperties;
if (pUSMDesc && pUSMDesc->pNext) {
UR_RETURN_ON_FAILURE(usmDescToCLMemProperties(
Expand Down Expand Up @@ -130,6 +135,11 @@ urUSMDeviceAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice,
void *Ptr = nullptr;
uint32_t Alignment = pUSMDesc ? pUSMDesc->align : 0;

if (pUSMDesc && pUSMDesc->align != 0 &&
((pUSMDesc->align & (pUSMDesc->align - 1)) != 0)) {
return UR_RESULT_ERROR_INVALID_VALUE;
}

std::vector<cl_mem_properties_intel> AllocProperties;
if (pUSMDesc && pUSMDesc->pNext) {
UR_RETURN_ON_FAILURE(usmDescToCLMemProperties(
Expand Down Expand Up @@ -173,6 +183,11 @@ urUSMSharedAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice,
void *Ptr = nullptr;
uint32_t Alignment = pUSMDesc ? pUSMDesc->align : 0;

if (pUSMDesc && pUSMDesc->align != 0 &&
((pUSMDesc->align & (pUSMDesc->align - 1)) != 0)) {
return UR_RESULT_ERROR_INVALID_VALUE;
}

std::vector<cl_mem_properties_intel> AllocProperties;
if (pUSMDesc && pUSMDesc->pNext) {
UR_RETURN_ON_FAILURE(usmDescToCLMemProperties(
Expand Down
4 changes: 2 additions & 2 deletions source/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if (NOT DEFINED UMF_REPO)
endif()

if (NOT DEFINED UMF_TAG)
# v0.9.x 19.08.2024: Merge pull request #688 ...
set(UMF_TAG 59c4150b7120a7af5b3c8eb2d9b8bbb5d2e96aa3)
# v0.9.x 23.08.2024: Merge pull request #696 ...
set(UMF_TAG 3c340e61c197f4f9e29abd947f90ce27c571433e)
endif()

message(STATUS "Will fetch Unified Memory Framework from ${UMF_REPO}")
Expand Down
9 changes: 5 additions & 4 deletions source/loader/layers/tracing/ur_tracing_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ struct XptiContextManager {
~XptiContextManager() { xptiFrameworkFinalize(); }
};

static std::shared_ptr<XptiContextManager> xptiContextManagerGlobal = [] {
return std::make_shared<XptiContextManager>();
}();
static std::shared_ptr<XptiContextManager> xptiContextManagerGet() {
static auto contextManager = std::make_shared<XptiContextManager>();
return contextManager;
};
static thread_local xpti_td *activeEvent;

///////////////////////////////////////////////////////////////////////////////
context_t::context_t() : logger(logger::create_logger("tracing", true, true)) {
this->xptiContextManager = xptiContextManagerGlobal;
this->xptiContextManager = xptiContextManagerGet();

call_stream_id = xptiRegisterStream(CALL_STREAM_NAME);
std::ostringstream streamv;
Expand Down