SWDEV-546287 - Implement hipLibrary load/unload (#975)
This commit is contained in:
@@ -482,6 +482,7 @@ typedef enum cudaSharedMemConfig hipSharedMemConfig;
|
||||
typedef CUfunc_cache hipFuncCache;
|
||||
typedef CUjitInputType hipJitInputType;
|
||||
typedef CUjit_option hipJitOption;
|
||||
typedef enum cudaLibraryOption hipLibraryOption;
|
||||
typedef CUdevice hipDevice_t;
|
||||
typedef enum cudaDeviceP2PAttr hipDeviceP2PAttr;
|
||||
#define hipDevP2PAttrPerformanceRank cudaDevP2PAttrPerformanceRank
|
||||
@@ -495,6 +496,8 @@ typedef CUlinkState hipLinkState_t;
|
||||
typedef CUmodule hipModule_t;
|
||||
typedef CUfunction hipFunction_t;
|
||||
typedef CUdeviceptr hipDeviceptr_t;
|
||||
typedef cudaLibrary_t hipLibrary_t;
|
||||
typedef cudaKernel_t hipKernel_t;
|
||||
typedef struct cudaArray* hipArray_t;
|
||||
typedef struct cudaArray* hipArray_const_t;
|
||||
typedef struct cudaFuncAttributes hipFuncAttributes;
|
||||
@@ -3624,6 +3627,41 @@ inline static hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* im
|
||||
cuModuleLoadDataEx(module, image, numOptions, options, optionValues));
|
||||
}
|
||||
|
||||
inline static hipError_t hipLibraryLoadData(hipLibrary_t* library, const void* code,
|
||||
hipJitOption** jitOptions, void** jitOptionsValues,
|
||||
unsigned int numJitOptions,
|
||||
hipLibraryOption** libraryOptions,
|
||||
void** libraryOptionValues,
|
||||
unsigned int numLibraryOptions) {
|
||||
return hipCUResultTohipError(cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues,
|
||||
numJitOptions, libraryOptions,
|
||||
libraryOptionValues, numLibraryOptions));
|
||||
}
|
||||
|
||||
inline static hipError_t hipLibraryLoadFromFile(hipLibrary_t* library, const char* fileName,
|
||||
hipJitOption** jitOptions, void** jitOptionsValues,
|
||||
unsigned int numJitOptions,
|
||||
hipLibraryOption** libraryOptions,
|
||||
void** libraryOptionValues,
|
||||
unsigned int numLibraryOptions) {
|
||||
return hipCUResultTohipError(
|
||||
cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions,
|
||||
libraryOptions, libraryOptionValues, numLibraryOptions));
|
||||
}
|
||||
|
||||
inline static hipError_t hipLibraryUnload(hipLibrary_t library) {
|
||||
return hipCUResultTohipError(cudaLibraryUnload(library));
|
||||
}
|
||||
|
||||
inline static hipError_t hipLibraryGetKernel(hipKernel_t* pKernel, hipLibrary_t library,
|
||||
const char* name) {
|
||||
return hipCUResultTohipError(cudaLibraryGetKernel(pKernel, library, name));
|
||||
}
|
||||
|
||||
inline static hipError_t hipLibraryGetKernelCount(unsigned int* count, hipLibrary_t library) {
|
||||
return hipCUResultTohipError(cudaLibraryGetKernelCount(count, library));
|
||||
}
|
||||
|
||||
inline static hipError_t hipLaunchKernel(const void* function_address, dim3 numBlocks,
|
||||
dim3 dimBlocks, void** args, size_t sharedMemBytes,
|
||||
hipStream_t stream) {
|
||||
|
||||
Reference in New Issue
Block a user