Conversation
…ue (#1199) When CHIP_BE is unset or set to "default", BackendType::str() returns "default". Both CHIPQueueOpenCL and CHIPQueueLevel0 used this value for NativeHandles[0] in hipGetBackendNativeHandles(). Interop callers such as libMKLShim compare this string against "opencl"/"level0" and abort on any other value, causing "Unsupported backend: default" + exit 134. Fix: - CHIPQueueOpenCL::getBackendHandles: hard-code NativeHandles[0] = "opencl" - CHIPQueueLevel0::getBackendHandles: hard-code NativeHandles[0] = "level0" - BackendType(string): accept "default" as a valid value (same as "") mapping to BackendType::Default for auto-selection in CHIPInitializeCallOnce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
hipGetBackendNativeHandles()was returning the value ofCHIP_BE(e.g."default") as the backend name string inNativeHandles[0]. WhenCHIP_BEis unset,BackendType::str()returns"default"— the requested backend selector, not the actual running backend.Callers such as
libMKLShim.socompare this string against"opencl"and"level0"and callstd::abort()on any other value, producing:Closes #1199
Fix
CHIPBackendOpenCL.cc: hard-codeNativeInfo[0] = (uintptr_t)"opencl"CHIPBackendLevel0.cc: hard-codeNativeInfo[0] = (uintptr_t)"level0"CHIPDriver.hh: accept"default"as a validCHIP_BEvalue (maps toBackendType::Defaultfor auto-selection, same as empty string)Test
Added
tests/runtime/TestNativeHandlesBackendName.cpp: callshipGetBackendNativeHandles()and assertsNativeHandles[0]is"opencl"or"level0", never"default". Includes a_NoBEvariant that runs withCHIP_BEunset.Results
Unit_printf_*failures unrelated to this change