diff options
| author | Anders Leino <aleino@nvidia.com> | 2025-02-28 08:12:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-27 22:12:27 -0800 |
| commit | 4872eebaa26dad7809fb6c58f5569ec64099e0c1 (patch) | |
| tree | a9e3c31e350c0a63f6cdaac14d35624898b123c7 /source | |
| parent | 33706fd7712082a8472b50c74c6219c397a3c552 (diff) | |
Don't add multiple matrix layout options when creating a session (#6476)
The default matrix layout mode was applied in addition to any related options, and this
caused the wrong matrix layout mode to be used.
For example, tests/compute/column-major was failing when attempting to migrate to the new
compilation API.
This helps to address issue #4760
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index cd8cabfe5..fe7ecc4e9 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -816,8 +816,6 @@ Session::createSession(slang::SessionDesc const& inDesc, slang::ISession** outSe new TypeCheckingCache(*static_cast<TypeCheckingCache*>(m_typeCheckingCache.get())); } - linkage->setMatrixLayoutMode(desc.defaultMatrixLayoutMode); - Int searchPathCount = desc.searchPathCount; for (Int ii = 0; ii < searchPathCount; ++ii) { @@ -845,6 +843,10 @@ Session::createSession(slang::SessionDesc const& inDesc, slang::ISession** outSe linkage->m_optionSet.load(desc.compilerOptionEntryCount, desc.compilerOptionEntries); + if (!linkage->m_optionSet.hasOption(CompilerOptionName::MatrixLayoutColumn) && + !linkage->m_optionSet.hasOption(CompilerOptionName::MatrixLayoutRow)) + linkage->setMatrixLayoutMode(desc.defaultMatrixLayoutMode); + { const Int targetCount = desc.targetCount; const uint8_t* targetDescPtr = reinterpret_cast<const uint8_t*>(desc.targets); |
