Skip to content

Commit 69e5a51

Browse files
pratikasharigcbot
authored andcommitted
Fix assert when not compiling compute input
Fix assert when not compiling compute input
1 parent c3870c8 commit 69e5a51

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

IGC/Compiler/DebugInfo/ScalarVISAModule.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ class ScalarVisaModule final : public IGC::VISAModule {
9898

9999
bool usesSlot1ScratchSpill() const override;
100100

101+
virtual std::optional<enum ShaderType> getShaderType() const override {
102+
if (!m_pShader)
103+
return std::nullopt;
104+
return m_pShader->GetShaderType();
105+
}
106+
101107
private:
102108
/// @brief Constructor.
103109
/// @param m_pShader holds the Shader object that provides information

IGC/DebugInfo/VISADebugEmitter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,9 @@ void DebugEmitter::prepareElfForZeBinary(bool is64Bit, char *pElfBuffer, size_t
442442
}
443443
}
444444
} else {
445-
IGC_ASSERT_MESSAGE(is64Bit, "64-bit ELF file only supported");
445+
auto ST = m_pVISAModule->getShaderType();
446+
if (ST && (ST == ShaderType::COMPUTE_SHADER || ST == ShaderType::OPENCL_SHADER))
447+
IGC_ASSERT_MESSAGE(is64Bit, "64-bit ELF file only supported");
446448
}
447449
}
448450

IGC/DebugInfo/VISAModule.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ SPDX-License-Identifier: MIT
2020

2121
#include "LexicalScopes.hpp"
2222
#include "VISAIDebugEmitter.hpp"
23+
#include "IGC/common/Types.hpp"
2324

2425
#include <map>
26+
#include <optional>
2527
#include <string>
2628
#include <vector>
2729

@@ -542,6 +544,8 @@ class VISAModule {
542544

543545
virtual llvm::StringRef GetVISAFuncName() const = 0;
544546

547+
virtual std::optional<enum ShaderType> getShaderType() const { return std::nullopt; }
548+
545549
const InstInfoMap *GetInstInfoMap() { return &m_instInfoMap; }
546550

547551
VISAModule &operator=(VISAModule &other) = delete;

0 commit comments

Comments
 (0)