Skip to content
Merged
Changes from all 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
22 changes: 11 additions & 11 deletions onnxruntime/core/providers/vitisai/vitisai_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ VitisAIExecutionProvider::VitisAIExecutionProvider(
const ProviderOptions& info)
: IExecutionProvider{onnxruntime::kVitisAIExecutionProvider,
OrtDevice(OrtDevice::CPU, OrtDevice::MemType::DEFAULT, OrtDevice::VendorIds::NONE,
DEFAULT_CPU_ALLOCATOR_DEVICE_ID,
kAlloc4KAlignment)},
info_(info) {
DEFAULT_CPU_ALLOCATOR_DEVICE_ID)},
info_(info) { // Removed 4k alignment for now, need better fix
auto it = info_.find("ep_context_enable");
ep_ctx_enabled_ = it != info_.end() && it->second == "1";
it = info_.find("ep_context_embed_mode");
Expand Down Expand Up @@ -148,20 +147,21 @@ std::unique_ptr<profiling::EpProfiler> VitisAIExecutionProvider::GetProfiler() {

std::vector<AllocatorPtr> VitisAIExecutionProvider::CreatePreferredAllocators() {
std::vector<AllocatorPtr> result;
// We do not want arena for this, as it would not respect alignment.
constexpr const bool use_arena_false = false;
AllocatorCreationInfo device_info_cpu_aligned_4k{
// We do not want arena for 4k alignment, as it would not respect alignment.
// For CPU, use arena
// Removed 4k alignment for now, need better fix
constexpr const bool use_arena_true = true;
AllocatorCreationInfo device_info_cpu{
[](OrtDevice::DeviceId device_id) {
return std::make_unique<CPUAllocator>(
OrtMemoryInfo(
onnxruntime::CPU_ALIGNED_4K, OrtAllocatorType::OrtDeviceAllocator,
onnxruntime::CPU, OrtAllocatorType::OrtDeviceAllocator,
OrtDevice(OrtDevice::CPU, OrtDevice::MemType::DEFAULT, OrtDevice::VendorIds::NONE,
Comment thread
VishalX marked this conversation as resolved.
device_id,
kAlloc4KAlignment)));
device_id)));
},
DEFAULT_CPU_ALLOCATOR_DEVICE_ID, use_arena_false};
DEFAULT_CPU_ALLOCATOR_DEVICE_ID, use_arena_true};

result.push_back(CreateAllocator(device_info_cpu_aligned_4k));
result.push_back(CreateAllocator(device_info_cpu));
return result;
}

Expand Down
Loading