From 3944da1d7604463805d2d447aa20519119451aa6 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Wed, 19 Feb 2025 18:44:56 +0000 Subject: [PATCH] rocr:Only set asan flag on GPU agents --- runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp b/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp index be5a5dcaa1..acd492a984 100644 --- a/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp +++ b/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp @@ -834,7 +834,8 @@ hsa_status_t hsa_amd_memory_pool_allocate(hsa_amd_memory_pool_t memory_pool, siz alloc_flag |= core::MemoryRegion::AllocateExecutable; #ifdef SANITIZER_AMDGPU - alloc_flag |= core::MemoryRegion::AllocateAsan; + if (mem_region->owner()->device_type() == core::Agent::kAmdGpuDevice) + alloc_flag |= core::MemoryRegion::AllocateAsan; #endif return core::Runtime::runtime_singleton_->AllocateMemory(mem_region, size, alloc_flag, ptr);