Skip to content

Commit fa0a8ab

Browse files
houjenkosys_zuul
authored andcommitted
[IGC Feature][IGC] Verify staged compilation in parallel
Change-Id: I3bc38439b3be7f2cd59e6900208efecf920817c6
1 parent 50ea5d8 commit fa0a8ab

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

IGC/common/Stats.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,16 @@ void TimeStats::sumWith( const TimeStats* pOther )
649649
}
650650
}
651651

652-
void TimeStats::printTime( ShaderType type, ShaderHash hash ) const
652+
void TimeStats::printTime( ShaderType type, ShaderHash hash) const
653+
{
654+
printTime(type, hash, nullptr);
655+
}
656+
657+
void TimeStats::printTime( ShaderType type, ShaderHash hash, void* context ) const
653658
{
654659
TimeStats pp = postProcess();
655660

656-
std::string shaderName = IGC::Debug::DumpName(IGC::Debug::GetShaderOutputName()).Type(type).Hash(hash).str().c_str();
661+
std::string shaderName = IGC::Debug::DumpName(IGC::Debug::GetShaderOutputName()).Type(type).Hash(hash).StagedInfo(context).str().c_str();
657662
if (shaderName.find_last_of("\\") != std::string::npos)
658663
{
659664
shaderName = shaderName.substr(shaderName.find_last_of("\\") + 1, shaderName.size());

IGC/common/Stats.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ class TimeStats
244244
uint64_t getCompileHit( COMPILE_TIME_INTERVALS compileInterval ) const;
245245

246246
/// Print the accumulated times for a single shader
247+
void printTime( ShaderType type, ShaderHash hash, void* context) const;
247248
void printTime( ShaderType type, ShaderHash hash ) const;
248249
/// Print the aggregated times for multiple shaders
249250
void printSumTime() const;
@@ -392,15 +393,15 @@ class TimeStats
392393
(pointer)->statName = nullptr; \
393394
} while (0)
394395

395-
#define COMPILER_TIME_PRINT( pointer, shaderType, shaderHash ) \
396+
#define COMPILER_TIME_PRINT( pointer, ...) \
396397
do \
397398
{ \
398399
if( (pointer) && (pointer)->m_compilerTimeStats ) \
399400
{ \
400401
if ( IGC::Debug::GetDebugFlag( IGC::Debug::DebugFlag::TIME_STATS_PER_SHADER ) ) \
401402
{ \
402403
(pointer)->m_compilerTimeStats->printTime( \
403-
shaderType, shaderHash ); \
404+
__VA_ARGS__ ); \
404405
} \
405406
} \
406407
} while (0)

IGC/common/debug/Dump.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,16 @@ DumpName DumpName::Extension(std::string const& extension) const
114114
return copy;
115115
}
116116

117-
DumpName DumpName::StagedInfo(IGC::CodeGenContext const* context) const
117+
DumpName DumpName::StagedInfo(void const* context) const
118118
{
119119
DumpName copy(*this);
120-
if (!IsStage2RestSIMDs(context->m_StagingCtx) &&
121-
context->m_CgFlag != FLAG_CG_ALL_SIMDS)
120+
IGC::CodeGenContext const* ctx = (IGC::CodeGenContext const*) context;
121+
if (!IsStage2RestSIMDs(ctx->m_StagingCtx) &&
122+
ctx->m_CgFlag != FLAG_CG_ALL_SIMDS)
122123
{
123-
copy.m_cgFlag = context->m_CgFlag;
124+
copy.m_cgFlag = ctx->m_CgFlag;
124125
}
125-
else if (IsStage2RestSIMDs(context->m_StagingCtx))
126+
else if (IsStage2RestSIMDs(ctx->m_StagingCtx))
126127
{
127128
copy.m_cgFlag = FLAG_CG_ALL_SIMDS;
128129
}

IGC/common/debug/Dump.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class DumpName
7979
DumpName ShaderName(std::string const& name) const;
8080
DumpName Type(ShaderType type) const;
8181
DumpName Extension(std::string const& extension) const;
82-
DumpName StagedInfo(IGC::CodeGenContext const* context) const;
82+
DumpName StagedInfo(void const* context) const;
8383
DumpName SIMDSize(SIMDMode width) const;
8484
DumpName DispatchMode(ShaderDispatchMode mode) const;
8585
DumpName Hash(ShaderHash hash) const;

0 commit comments

Comments
 (0)