Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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 .github/workflows/linux_cuda_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

# --- Download Build Artifact to Runner Temp Directory ---
- name: Download Build Artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: build-output-x64-Release # Must match the upload name
path: ${{ runner.temp }}/Release # Download contents into temp dir structure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_minimal_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ jobs:
with:
node-version: 20
- name: Download Test Data Artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: test_data
path: ${{ runner.temp }}/.test_data/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_tensorrt_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

# --- Download Build Artifact to Runner Temp Directory ---
- name: Download Build Artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: build-output-x64-Release # Must match the upload name
path: ${{ runner.temp }}/Release # Download contents into temp dir structure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
runs-on: macos-15

env:
xcode_version: 16
xcode_version: 16.4

strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-web-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
node-version: "20.x"

- name: Download WebAssembly artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: ${{ inputs.build_config }}_wasm
path: ${{ github.workspace }}/artifacts_wasm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
submodules: 'none'

- name: Download build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: build-artifacts
path: ${{ runner.temp }}\build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_tensorrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
submodules: 'none'

- name: Download build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: build-artifacts
path: ${{ runner.temp }}\build
Expand Down
9 changes: 9 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1791,3 +1791,12 @@ else()
include("${CMAKE_CURRENT_SOURCE_DIR}/arm64x.cmake")
endif()
endif()

if(onnxruntime_BUILD_UNIT_TESTS)
include("${CMAKE_CURRENT_SOURCE_DIR}/onnxruntime_test_pch.cmake")
endif()

# Include precompiled header configuration for providers
if(TARGET onnxruntime_providers)
include("${CMAKE_CURRENT_SOURCE_DIR}/onnxruntime_providers_pch.cmake")
endif()
8 changes: 8 additions & 0 deletions cmake/onnxruntime_providers_pch.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Precompiled header configuration for onnxruntime_providers

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Visual Studio PCH
target_precompile_headers(onnxruntime_providers PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/providers_pch.h"
)
endif()
20 changes: 20 additions & 0 deletions cmake/onnxruntime_test_pch.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Precompiled header configuration for onnxruntime_test_all

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Visual Studio PCH
target_precompile_headers(onnxruntime_test_all PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/test_pch.h"
)
endif()

# Exclude certain files that might conflict with PCH
set(PCH_EXCLUDE_FILES
# Add any problematic source files here
"${TEST_SRC_DIR}/framework/tensor_shape_test.cc"
)

foreach(file ${PCH_EXCLUDE_FILES})
set_source_files_properties(${file} PROPERTIES
SKIP_PRECOMPILE_HEADERS ON
)
endforeach()
25 changes: 25 additions & 0 deletions cmake/providers_pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

// Core framework headers (highest compilation time impact)
#include "core/framework/op_kernel.h"
#include "core/framework/op_kernel_info.h"
#include "core/framework/execution_provider.h"
#include "core/framework/op_node_proto_helper.h"
#include "core/framework/data_types.h"
#include "core/framework/tensor.h"

// Graph-related headers
#include "core/graph/graph_viewer.h"
#include "core/graph/graph.h"
#include "core/graph/onnx_protobuf.h"

// ONNX schema definitions
#include "onnx/defs/schema.h"

// Windows-specific headers (if applicable)
#ifdef _WIN32
#include <windows.h>
#endif
26 changes: 26 additions & 0 deletions cmake/test_pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

// Test framework headers (highest compilation time impact)
#include "gtest/gtest.h"
#include "gtest/gtest-assertion-result.h"
#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-port.h"

// Core test utilities (most frequently used in tests)
#include "test/providers/provider_test_utils.h"
#include "test/providers/checkers.h"

// ONNX and Protocol Buffer headers
#include "core/graph/onnx_protobuf.h"
#include "onnx/defs/schema.h"

// Data types and framework headers
#include "core/framework/data_types.h"

// Windows-specific headers (if applicable)
#ifdef _WIN32
#include <windows.h>
#endif
17 changes: 0 additions & 17 deletions include/onnxruntime/core/session/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,6 @@ class Environment {

using OrtAllocatorUniquePtr = std::unique_ptr<OrtAllocator, std::function<void(OrtAllocator*)>>;

// if the user calls CreateSharedAllocator and wraps the plugin EP's allocator with an arena we end up with
// OrtAllocator from EP -> wrapped in IAllocatorImplWrappingOrtAllocator -> inside a BFCArena IAllocator.
// we can put that in shared_allocators_ for sessions to use, but to have an OrtAllocator available in
// shared_ort_allocators_ that can be used outside of a session we need to additionally wrap that in an
// OrtAllocatorImplWrappingIAllocator. way too many levels of indirection but that is what it is currently.
// we need something to own that final OrtAllocator, so we add it to arena_ort_allocators_.
//
// TODO: we could split out the BFCArena implementation so it can be plugged into either an IAllocator
// or an OrtAllocator instance to reduce the indirection a little.
// with that we get an OrtAllocator from the EP, wrap it with an OrtAllocator based BFCArena, and wrap that with the
// IAllocatorImplWrappingOrtAllocator which takes ownership of the OrtAllocator and is in shared_allocators_.
//
// Alternatively we can disable wrapping an EP's allocator with a BFCArena and say the EP should provide the arena
// implementation directly. They're free to copy BFCArena as it came from TF originally. Or we could provide a
// cut-and-paste BFCArena implementation that works using the EP API that can be included in the EP source.
std::unordered_map<const OrtMemoryInfo*, std::unique_ptr<OrtAllocatorImplWrappingIAllocator>> arena_ort_allocators_;

#if !defined(ORT_MINIMAL_BUILD)
// register EPs that are built into the ORT binary so they can take part in AutoEP selection
// added to ep_libraries
Expand Down
Loading
Loading