Skip to content

Commit 3944da1

Browse files
committed
rocr:Only set asan flag on GPU agents
1 parent 9a950ab commit 3944da1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,8 @@ hsa_status_t hsa_amd_memory_pool_allocate(hsa_amd_memory_pool_t memory_pool, siz
834834
alloc_flag |= core::MemoryRegion::AllocateExecutable;
835835

836836
#ifdef SANITIZER_AMDGPU
837-
alloc_flag |= core::MemoryRegion::AllocateAsan;
837+
if (mem_region->owner()->device_type() == core::Agent::kAmdGpuDevice)
838+
alloc_flag |= core::MemoryRegion::AllocateAsan;
838839
#endif
839840

840841
return core::Runtime::runtime_singleton_->AllocateMemory(mem_region, size, alloc_flag, ptr);

0 commit comments

Comments
 (0)