Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CUlibrary's and CUkernel's - CUDA driver low-level "library management" #565

Closed
eyalroz opened this issue Jan 1, 2024 · 0 comments

Comments

@eyalroz
Copy link
Owner

eyalroz commented Jan 1, 2024

Beginning with CUDA 12.0, we now have access to several functions for handling "libraries" of context-less "kernels":

https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__LIBRARY.html

One can get a context-associated module or kernel by calling cuKernelGetFunction() or cuLibraryGetModule().

Functions:

CUresult cuKernelGetAttribute ( int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev );
CUresult cuKernelGetFunction ( CUfunction* pFunc, CUkernel kernel );
CUresult cuKernelGetName ( const char** name, CUkernel hfunc );
CUresult cuKernelSetAttribute ( CUfunction_attribute attrib, int  val, CUkernel kernel, CUdevice dev );
CUresult cuKernelSetCacheConfig ( CUkernel kernel, CUfunc_cache config, CUdevice dev );
CUresult cuLibraryGetGlobal ( CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name );
CUresult cuLibraryGetKernel ( CUkernel* pKernel, CUlibrary library, const char* name );
CUresult cuLibraryGetManaged ( CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name );
CUresult cuLibraryGetModule ( CUmodule* pMod, CUlibrary library );
CUresult cuLibraryGetUnifiedFunction ( void** fptr, CUlibrary library, const char* symbol );
CUresult cuLibraryLoadData ( CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int  numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int  numLibraryOptions );
CUresult cuLibraryLoadFromFile ( CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int  numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int  numLibraryOptions );
CUresult cuLibraryUnload ( CUlibrary library );
@eyalroz eyalroz added the task label Jan 1, 2024
@eyalroz eyalroz added this to the Full CUDA 12 Support milestone Jan 1, 2024
eyalroz added a commit that referenced this issue Jan 8, 2024
Caveat: Not yet supporting library kernels as first-class citizens; they are currently only intermediate entities for obtaining context-associated kernels (CUfunction's)
eyalroz added a commit that referenced this issue Jan 14, 2024
Caveat: Not yet supporting library kernels as first-class citizens; they are currently only intermediate entities for obtaining context-associated kernels (CUfunction's)
eyalroz added a commit that referenced this issue Jan 27, 2024
Caveat: Not yet supporting library kernels as first-class citizens; they are currently only intermediate entities for obtaining context-associated kernels (CUfunction's)
eyalroz added a commit that referenced this issue Jan 27, 2024
Caveat: Not yet supporting library kernels as first-class citizens; they are currently only intermediate entities for obtaining context-associated kernels (CUfunction's)
eyalroz added a commit that referenced this issue Jan 27, 2024
…completing the support for libraries overall

CAVEAT: No example code to actually load and launch any cuLibraries
eyalroz added a commit that referenced this issue Jan 29, 2024
…completing the support for libraries overall

CAVEAT: No example code to actually load and launch any cuLibraries
eyalroz added a commit that referenced this issue Feb 29, 2024
…completing the support for libraries overall

CAVEAT: No example code to actually load and launch any cuLibraries
eyalroz added a commit that referenced this issue Mar 1, 2024
Caveat: Not yet supporting library kernels as first-class citizens; they are currently only intermediate entities for obtaining context-associated kernels (CUfunction's)
@eyalroz eyalroz closed this as completed in ed77753 Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant