Skip to content

Commit e264cc1

Browse files
committed
address comments
1 parent 3e3bd51 commit e264cc1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ SanitizerInterceptor::~SanitizerInterceptor() {
187187
DestroyShadowMemoryOnPVC();
188188
DestroyShadowMemoryOnDG2();
189189

190+
// We must release these objects before releasing adapters, since
191+
// they may use the adapter in their destruction process
190192
m_Quarantine = nullptr;
191193
m_MemBufferMap.clear();
192194
m_AllocationMap.clear();

source/loader/layers/sanitizer/asan_interceptor.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ struct DeviceInfo {
4949
std::queue<std::shared_ptr<AllocInfo>> Quarantine;
5050
size_t QuarantineSize = 0;
5151

52-
// TODO: re-enable retaining and releasing device handles in DeviceInfo
53-
// constructor/destructor. See PR
54-
// https://github.com/oneapi-src/unified-runtime/pull/1883
52+
// Device handles are special and alive in the whole process lifetime,
53+
// so we needn't retain&release here.
5554
explicit DeviceInfo(ur_device_handle_t Device) : Handle(Device) {}
5655

5756
ur_result_t allocShadowMemory(ur_context_handle_t Context);

test/layers/sanitizer/asan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* See LICENSE.TXT
77
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
88
*
9-
* @file codeloc.cpp
9+
* @file asan.cpp
1010
*
1111
*/
1212

0 commit comments

Comments
 (0)