2
0

SWDEV-533237 Add hipOccupancyAvailableDynamicSMemPerBlock API (#899)

* SWDEV-533237 Add initial support for hipOccupancyAvailableDynamicSMemPerBlock API

* SWDEV-533237 Add hipOccupancyAvailableDynamicSMemPerBlock wrapper for nvidia

* SWDEV-533237 Add implementation of hipOccupancyAvailableDynamicSMemPerBlock API

* SWDEV-533237 Add LDSAlignment field in Isa table

---------

Co-authored-by: Rahul Manocha <rmanocha@amd.com>
Este cometimento está contido em:
dsicarov-amd
2025-10-29 10:58:42 +01:00
cometido por GitHub
ascendente 197f73dac9
cometimento 4915496bf9
13 ficheiros modificados com 279 adições e 125 eliminações
+7 -2
Ver ficheiro
@@ -879,6 +879,8 @@ hipError_t hipLibraryEnumerateKernels(hipKernel_t* kernels, unsigned int numKern
hipLibrary_t library);
hipError_t hipKernelGetLibrary(hipLibrary_t* library, hipKernel_t kernel);
hipError_t hipKernelGetName(const char** name, hipKernel_t kernel);
hipError_t hipOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* f,
int numBlocks, int blockSize);
} // namespace hip
namespace hip {
@@ -1423,6 +1425,7 @@ void UpdateDispatchTable(HipDispatchTable* ptrDispatchTable) {
ptrDispatchTable->hipLibraryEnumerateKernels_fn = hip::hipLibraryEnumerateKernels;
ptrDispatchTable->hipKernelGetLibrary_fn = hip::hipKernelGetLibrary;
ptrDispatchTable->hipKernelGetName_fn = hip::hipKernelGetName;
ptrDispatchTable->hipOccupancyAvailableDynamicSMemPerBlock_fn = hip::hipOccupancyAvailableDynamicSMemPerBlock;
}
#if HIP_ROCPROFILER_REGISTER > 0
@@ -2099,15 +2102,17 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipStreamCopyAttributes_fn, 501);
HIP_ENFORCE_ABI(HipDispatchTable, hipLibraryEnumerateKernels_fn, 502);
HIP_ENFORCE_ABI(HipDispatchTable, hipKernelGetLibrary_fn, 503);
HIP_ENFORCE_ABI(HipDispatchTable, hipKernelGetName_fn, 504);
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 18
HIP_ENFORCE_ABI(HipDispatchTable, hipOccupancyAvailableDynamicSMemPerBlock_fn, 505);
// if HIP_ENFORCE_ABI entries are added for each new function pointer in the table, the number below
// will be +1 of the number in the last HIP_ENFORCE_ABI line. E.g.:
//
// HIP_ENFORCE_ABI(<table>, <functor>, 8)
//
// HIP_ENFORCE_ABI_VERSIONING(<table>, 9) <- 8 + 1 = 9
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 505)
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 506)
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 17,
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 18,
"If you get this error, add new HIP_ENFORCE_ABI(...) code for the new function "
"pointers and then update this check so it is true");
#endif