2
0

SWDEV-546287 - Implement hipLibrary load/unload (#975)

Este cometimento está contido em:
Jatin Chaudhary
2025-09-19 22:23:49 +01:00
cometido por GitHub
ascendente 775ac73d25
cometimento e79eaaa8a5
26 ficheiros modificados com 1175 adições e 16 eliminações
@@ -974,6 +974,13 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipMemPrefetchAsync_v2)
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipMemAdvise_v2)
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipStreamGetId)
#endif
#if HIP_RUNTIME_API_TABLE_STEP_VERSION >= 15
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryLoadData)
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryLoadFromFile)
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryUnload)
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryGetKernel)
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryGetKernelCount)
#endif
#if HIP_RUNTIME_API_TABLE_STEP_VERSION == 0
static_assert(ROCPROFILER_HIP_RUNTIME_API_ID_LAST == 442);
#elif HIP_RUNTIME_API_TABLE_STEP_VERSION == 1
@@ -1004,6 +1011,8 @@ static_assert(ROCPROFILER_HIP_RUNTIME_API_ID_LAST == 477);
static_assert(ROCPROFILER_HIP_RUNTIME_API_ID_LAST == 477);
#elif HIP_RUNTIME_API_TABLE_STEP_VERSION == 14
static_assert(ROCPROFILER_HIP_RUNTIME_API_ID_LAST == 496);
#elif HIP_RUNTIME_API_TABLE_STEP_VERSION == 15
static_assert(ROCPROFILER_HIP_RUNTIME_API_ID_LAST == 501);
#else
# if !defined(ROCPROFILER_UNSAFE_NO_VERSION_CHECK) && \
(defined(ROCPROFILER_CI) && ROCPROFILER_CI > 0)
@@ -3285,6 +3285,45 @@ typedef union rocprofiler_hip_api_args_t
unsigned long long* streamId;
} hipStreamGetId;
#endif
#if HIP_RUNTIME_API_TABLE_STEP_VERSION >= 15
struct
{
hipLibrary_t* library;
const void* code;
hipJitOption** jitOptions;
void** jitOptionsValues;
unsigned int numJitOptions;
hipLibraryOption** libraryOptions;
void** libraryOptionValues;
unsigned int numLibraryOptions;
} hipLibraryLoadData;
struct
{
hipLibrary_t* library;
const char* fileName;
hipJitOption** jitOptions;
void** jitOptionsValues;
unsigned int numJitOptions;
hipLibraryOption** libraryOptions;
void** libraryOptionValues;
unsigned int numLibraryOptions;
} hipLibraryLoadFromFile;
struct
{
hipLibrary_t library;
} hipLibraryUnload;
struct
{
hipKernel_t* pKernel;
hipLibrary_t library;
const char* name;
} hipLibraryGetKernel;
struct
{
unsigned int* count;
hipLibrary_t library;
} hipLibraryGetKernelCount;
#endif
} rocprofiler_hip_api_args_t;
ROCPROFILER_EXTERN_C_FINI
@@ -551,6 +551,13 @@ typedef enum rocprofiler_hip_runtime_api_id_t // NOLINT(performance-enum-size)
ROCPROFILER_HIP_RUNTIME_API_ID_hipMemPrefetchAsync_v2,
ROCPROFILER_HIP_RUNTIME_API_ID_hipMemAdvise_v2,
ROCPROFILER_HIP_RUNTIME_API_ID_hipStreamGetId,
#endif
#if HIP_RUNTIME_API_TABLE_STEP_VERSION >= 15
ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryLoadData,
ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryLoadFromFile,
ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryUnload,
ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryGetKernel,
ROCPROFILER_HIP_RUNTIME_API_ID_hipLibraryGetKernelCount,
#endif
ROCPROFILER_HIP_RUNTIME_API_ID_LAST,
} rocprofiler_hip_runtime_api_id_t;