File tree 3 files changed +20
-1
lines changed
Optimizer/OpenCLPasses/PrivateMemory
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,12 @@ namespace IGC
508
508
return CodeGenContext::getNumGRFPerThread ();
509
509
}
510
510
511
+ bool OpenCLProgramContext::forceGlobalMemoryAllocation () const
512
+ {
513
+ return m_InternalOptions.IntelForceGlobalMemoryAllocation ;
514
+ }
515
+
516
+
511
517
void CodeGenContext::initLLVMContextWrapper (bool createResourceDimTypes)
512
518
{
513
519
llvmCtxWrapper = new LLVMContextWrapper (createResourceDimTypes);
@@ -669,6 +675,11 @@ namespace IGC
669
675
return 128 ;
670
676
}
671
677
678
+ bool CodeGenContext::forceGlobalMemoryAllocation () const
679
+ {
680
+ return false ;
681
+ }
682
+
672
683
bool CodeGenContext::isPOSH () const
673
684
{
674
685
return this ->getModule ()->getModuleFlag (
Original file line number Diff line number Diff line change @@ -845,6 +845,7 @@ namespace IGC
845
845
virtual void resetOnRetry ();
846
846
virtual uint32_t getNumThreadsPerEU () const ;
847
847
virtual uint32_t getNumGRFPerThread () const ;
848
+ virtual bool forceGlobalMemoryAllocation () const ;
848
849
bool isPOSH () const ;
849
850
850
851
CompilerStats& Stats ()
@@ -1073,6 +1074,10 @@ namespace IGC
1073
1074
{
1074
1075
EnableTakeGlobalAddress = true ;
1075
1076
}
1077
+ if (strstr (options, " -cl-intel-force-global-mem-allocation" ))
1078
+ {
1079
+ IntelForceGlobalMemoryAllocation = true ;
1080
+ }
1076
1081
}
1077
1082
1078
1083
@@ -1089,6 +1094,7 @@ namespace IGC
1089
1094
bool PromoteStatelessToBindless = false ;
1090
1095
bool PreferBindlessImages = false ;
1091
1096
bool EnableTakeGlobalAddress = false ;
1097
+ bool IntelForceGlobalMemoryAllocation = false ;
1092
1098
1093
1099
};
1094
1100
@@ -1162,6 +1168,7 @@ namespace IGC
1162
1168
float getProfilingTimerResolution ();
1163
1169
uint32_t getNumGRFPerThread () const ;
1164
1170
uint32_t getNumThreadsPerEU () const ;
1171
+ bool forceGlobalMemoryAllocation () const ;
1165
1172
private:
1166
1173
llvm::DenseMap<llvm::Function*, std::string> m_hashes_per_kernel;
1167
1174
};
Original file line number Diff line number Diff line change @@ -361,7 +361,8 @@ bool PrivateMemoryResolution::safeToUseScratchSpace(llvm::Module& M) const
361
361
bool supportsStatelessSpacePrivateMemory = Ctx.m_DriverInfo .supportsStatelessSpacePrivateMemory ();
362
362
bool bOCLLegacyStatelessCheck = true ;
363
363
364
- if ((modMD.compOpt .OptDisable && bOCLLegacyStatelessCheck) || !supportsScratchSpacePrivateMemory) {
364
+ if ((modMD.compOpt .OptDisable && bOCLLegacyStatelessCheck) || !supportsScratchSpacePrivateMemory
365
+ || Ctx.forceGlobalMemoryAllocation ()) {
365
366
return false ;
366
367
}
367
368
You can’t perform that action at this time.
0 commit comments