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.

[ROCm/clr commit: cd46294b31]
Этот коммит содержится в:
Xie, Pengda authored and GitHub committed 2025-08-05 14:02:05 -07:00
1 родитель 213623506f
Коммит 9cbbee4d6e
5 files changed
+72 -54

No files matched your search

+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();