Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions scripts/templates/valddi.cpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,11 @@ namespace ur_validation_layer
}

${x}_result_t context_t::tearDown() {
${x}_result_t result = ${X}_RESULT_SUCCESS;

if (enableLeakChecking) {
getContext()->refCountContext->logInvalidReferences();
getContext()->refCountContext->clear();
}
return result;

return ${X}_RESULT_SUCCESS;
}

} // namespace ur_validation_layer
4 changes: 2 additions & 2 deletions source/loader/layers/sanitizer/asan_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct AsanOptions {

auto KV = OptionsEnvMap->find("quarantine_size_mb");
if (KV != OptionsEnvMap->end()) {
auto Value = KV->second.front();
const auto &Value = KV->second.front();
try {
auto temp_long = std::stoul(Value);
if (temp_long > UINT32_MAX) {
Expand Down Expand Up @@ -129,7 +129,7 @@ struct AsanOptions {

KV = OptionsEnvMap->find("max_redzone");
if (KV != OptionsEnvMap->end()) {
auto Value = KV->second.front();
const auto &Value = KV->second.front();
try {
MaxRZSize = std::stoul(Value);
if (MaxRZSize > 2048) {
Expand Down
4 changes: 1 addition & 3 deletions source/loader/layers/validation/ur_leak_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct RefCountContext {
// No more active adapters, so any references still held are leaked
if (adapterCount == 0) {
logInvalidReferences();
clear();
counts.clear();
}
}

Expand All @@ -133,8 +133,6 @@ struct RefCountContext {
updateRefCount(handle, REFCOUNT_CREATE_OR_INCREASE, isAdapterHandle);
}

void clear() { counts.clear(); }

template <typename T> bool isReferenceValid(T handle) {
std::unique_lock<std::mutex> lock(mutex);
auto it = counts.find(static_cast<void *>(handle));
Expand Down
6 changes: 2 additions & 4 deletions source/loader/layers/validation/ur_valddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11182,13 +11182,11 @@ ur_result_t context_t::init(ur_dditable_t *dditable,
}

ur_result_t context_t::tearDown() {
ur_result_t result = UR_RESULT_SUCCESS;

if (enableLeakChecking) {
getContext()->refCountContext->logInvalidReferences();
getContext()->refCountContext->clear();
}
return result;

return UR_RESULT_SUCCESS;
}

} // namespace ur_validation_layer