@@ -1820,53 +1820,18 @@ ProgramManager::kernelImplicitLocalArgPos(KernelNameStrRefT KernelName) const {
18201820 return {};
18211821}
18221822
1823- template <typename OtherTy>
1824- inline constexpr bool operator ==(const CompileTimeKernelInfoTy &LHS,
1825- const OtherTy &RHS) {
1826- // This header states STL includes aren't allowed here, so can't use
1827- // `std::tie(...) == std::tie(...)` idiom, and no C++20 for
1828- // `operator==(...) = default`.
1829- return std::string_view{LHS.Name } == std::string_view{RHS.Name } &&
1830- LHS.NumParams == RHS.NumParams && LHS.IsESIMD == RHS.IsESIMD &&
1831- std::string_view{LHS.FileName } == std::string_view{RHS.FileName } &&
1832- std::string_view{LHS.FunctionName } ==
1833- std::string_view{RHS.FunctionName } &&
1834- LHS.LineNumber == RHS.LineNumber &&
1835- LHS.ColumnNumber == RHS.ColumnNumber &&
1836- LHS.KernelSize == RHS.KernelSize &&
1837- LHS.ParamDescGetter == RHS.ParamDescGetter &&
1838- LHS.HasSpecialCaptures == RHS.HasSpecialCaptures ;
1839- }
1840- template <typename OtherTy>
1841- inline constexpr bool operator !=(const CompileTimeKernelInfoTy &LHS,
1842- const OtherTy &RHS) {
1843- return !(LHS == RHS);
1844- }
1845- template <typename InfoTy> inline void print (const InfoTy &Info) {
1846- std::cout << " CompileTimeKernelInfoTy:"
1847- << " \n Name: " << Info.Name << " \n NumParams: " << Info.NumParams
1848- << " \n IsESIMD: " << Info.IsESIMD
1849- << " \n FileName: " << Info.FileName
1850- << " \n FunctionName: " << Info.FunctionName
1851- << " \n LineNumber: " << Info.LineNumber
1852- << " \n ColumnNumber: " << Info.ColumnNumber
1853- << " \n KernelSize: " << Info.KernelSize
1854- << " \n ParamDescGetter: " << Info.ParamDescGetter
1855- << " \n HasSpecialCaptures: " << Info.HasSpecialCaptures
1856- << std::endl;
1857- }
18581823DeviceKernelInfo &ProgramManager::getOrCreateDeviceKernelInfo (
18591824 const CompileTimeKernelInfoTy &Info) {
18601825 auto Result =
1861- m_DeviceKernelInfoMap.try_emplace (KernelNameStrT{Info.Name }, Info);
1862- if (Info != Result.first ->second ) {
1863- std::cout << " Info: " << std::endl ;
1864- print (Info);
1865- std::cout << " Result: " << std::endl;
1866- print (Result. first -> second );
1867- }
1868- assert (Info == Result. first -> second ||
1869- Info == CompileTimeKernelInfoTy{Info. Name });
1826+ m_DeviceKernelInfoMap.try_emplace (KernelNameStrT{Info.Name . data () }, Info);
1827+ Result.first ->second . setCompileTimeInfoIfNeeded (Info);
1828+ return Result. first -> second ;
1829+ }
1830+
1831+ DeviceKernelInfo &
1832+ ProgramManager::getOrCreateDeviceKernelInfo (KernelNameStrRefT KernelName) {
1833+ auto Result = m_DeviceKernelInfoMap. try_emplace (
1834+ KernelName, CompileTimeKernelInfoTy{std::string_view (KernelName) });
18701835 return Result.first ->second ;
18711836}
18721837
0 commit comments