Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate CPU allocator arena creation checks into a helper function. #22460

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edgchen1
Copy link
Contributor

Description

Consolidate CPU allocator arena creation checks into a helper function. Make it easier to keep the logic consistent.

Motivation and Context

Address this comment:
#22304 (comment)

skottmckay
skottmckay previously approved these changes Oct 16, 2024
onnxruntime/core/framework/cpu_allocator_utils.h Outdated Show resolved Hide resolved
@@ -75,4 +77,21 @@
}
}

bool ShouldCpuAllocatorUseArena([[maybe_unused]] bool is_arena_requested) {

Check warning

Code scanning / PREfast

You can attempt to make 'onnxruntime::ShouldCpuAllocatorUseArena' constexpr unless it contains any undefined behavior (f.4). Warning

You can attempt to make 'onnxruntime::ShouldCpuAllocatorUseArena' constexpr unless it contains any undefined behavior (f.4).
Copy link
Member

@hariharans29 hariharans29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants