SWDEV-520384 - Improve Fat Binary loading latency (#390)

Init and fini kernel needs to be launched when we load and unload code object. Avoid looping through all kernels within a code object just to run the init and fini kernels. Compiler currently only generates 1 init and fini kernel.
このコミットが含まれているのは:
Xie, Pengda
2025-08-05 14:02:05 -07:00
committed by GitHub
コミット cd46294b31
5個のファイルの変更、72行の追加、54行の削除
+7 -2
ファイルの表示
@@ -115,8 +115,10 @@ class Program : public amd::HeapObject {
kernels_t kernels_; //!< The kernel entry points this binary.
type_t type_; //!< type of this program
typedef enum { InitKernel = 0, FiniKernel } kernel_kind_t; //!< Kernel kind
bool runInitFiniKernel(kernel_kind_t) const;
std::vector<const Kernel*> initKernels_; //!< Init kernels
std::vector<const Kernel*> finiKernels_; //!< Fini kernels
bool runInitFiniKernel(const std::vector<const Kernel*>& kernels) const;
#if defined(WITH_COMPILER_LIB)
static amd::Monitor buildLock_; //!< Global build lock for HSAIL which isn't thread-safe
@@ -224,6 +226,9 @@ class Program : public amd::HeapObject {
const kernels_t& kernels() const { return kernels_; }
kernels_t& kernels() { return kernels_; }
//! Add kernel to the map and init fini kernel vector.
void addKernel(Kernel* k);
//! Return the binary image.
inline const binary_t binary() const;
inline binary_t binary();