File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
Optimizer/OpenCLPasses/PrivateMemory Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,12 @@ namespace IGC
508508 return CodeGenContext::getNumGRFPerThread ();
509509 }
510510
511+ bool OpenCLProgramContext::forceGlobalMemoryAllocation () const
512+ {
513+ return m_InternalOptions.IntelForceGlobalMemoryAllocation ;
514+ }
515+
516+
511517 void CodeGenContext::initLLVMContextWrapper (bool createResourceDimTypes)
512518 {
513519 llvmCtxWrapper = new LLVMContextWrapper (createResourceDimTypes);
@@ -669,6 +675,11 @@ namespace IGC
669675 return 128 ;
670676 }
671677
678+ bool CodeGenContext::forceGlobalMemoryAllocation () const
679+ {
680+ return false ;
681+ }
682+
672683 bool CodeGenContext::isPOSH () const
673684 {
674685 return this ->getModule ()->getModuleFlag (
Original file line number Diff line number Diff line change @@ -845,6 +845,7 @@ namespace IGC
845845 virtual void resetOnRetry ();
846846 virtual uint32_t getNumThreadsPerEU () const ;
847847 virtual uint32_t getNumGRFPerThread () const ;
848+ virtual bool forceGlobalMemoryAllocation () const ;
848849 bool isPOSH () const ;
849850
850851 CompilerStats& Stats ()
@@ -1073,6 +1074,10 @@ namespace IGC
10731074 {
10741075 EnableTakeGlobalAddress = true ;
10751076 }
1077+ if (strstr (options, " -cl-intel-force-global-mem-allocation" ))
1078+ {
1079+ IntelForceGlobalMemoryAllocation = true ;
1080+ }
10761081 }
10771082
10781083
@@ -1089,6 +1094,7 @@ namespace IGC
10891094 bool PromoteStatelessToBindless = false ;
10901095 bool PreferBindlessImages = false ;
10911096 bool EnableTakeGlobalAddress = false ;
1097+ bool IntelForceGlobalMemoryAllocation = false ;
10921098
10931099 };
10941100
@@ -1162,6 +1168,7 @@ namespace IGC
11621168 float getProfilingTimerResolution ();
11631169 uint32_t getNumGRFPerThread () const ;
11641170 uint32_t getNumThreadsPerEU () const ;
1171+ bool forceGlobalMemoryAllocation () const ;
11651172 private:
11661173 llvm::DenseMap<llvm::Function*, std::string> m_hashes_per_kernel;
11671174 };
Original file line number Diff line number Diff line change @@ -361,7 +361,8 @@ bool PrivateMemoryResolution::safeToUseScratchSpace(llvm::Module& M) const
361361 bool supportsStatelessSpacePrivateMemory = Ctx.m_DriverInfo .supportsStatelessSpacePrivateMemory ();
362362 bool bOCLLegacyStatelessCheck = true ;
363363
364- if ((modMD.compOpt .OptDisable && bOCLLegacyStatelessCheck) || !supportsScratchSpacePrivateMemory) {
364+ if ((modMD.compOpt .OptDisable && bOCLLegacyStatelessCheck) || !supportsScratchSpacePrivateMemory
365+ || Ctx.forceGlobalMemoryAllocation ()) {
365366 return false ;
366367 }
367368
You can’t perform that action at this time.
0 commit comments