Wrappers for working with modules of compiled CUDA code.
More...
#include "context.hpp"
#include "primary_context.hpp"
#include "kernel.hpp"
#include "memory.hpp"
#include "array.hpp"
#include "link_options.hpp"
#include <array>
Go to the source code of this file.
|
| cuda |
| All definitions and functionality wrapping the CUDA Runtime API.
|
|
|
using | cuda::module::handle_t = CUmodule |
|
|
|
template<typename Locus , typename ContiguousContainer , cuda::detail_::enable_if_t< cuda::detail_::is_kinda_like_contiguous_container< ContiguousContainer >::value, bool > = true> |
module_t | cuda::module::create (Locus &&locus, ContiguousContainer module_data, const link::options_t &link_options) |
| Create a CUDA driver module from raw module image data. More...
|
|
template<typename Locus , typename ContiguousContainer , cuda::detail_::enable_if_t< cuda::detail_::is_kinda_like_contiguous_container< ContiguousContainer >::value, bool > = true> |
module_t | cuda::module::create (Locus &&locus, ContiguousContainer module_data) |
|
|
module_t | cuda::module::load_from_file (const context_t &context, const char *path) |
| Load a module from an appropriate compiled or semi-compiled file, allocating all relevant resources for it. More...
|
|
module_t | cuda::module::load_from_file (const context_t &context, const ::std::string &path) |
|
module_t | cuda::module::load_from_file (const device_t &device, const char *path) |
|
module_t | cuda::module::load_from_file (const device_t &device, const ::std::string &path) |
|
module_t | cuda::module::load_from_file (const char *path) |
|
module_t | cuda::module::load_from_file (const ::std::string &path) |
|
Wrappers for working with modules of compiled CUDA code.
◆ create()
template<typename Locus , typename ContiguousContainer , cuda::detail_::enable_if_t< cuda::detail_::is_kinda_like_contiguous_container< ContiguousContainer >::value, bool > = true>
module_t cuda::module::create |
( |
Locus && |
locus, |
|
|
ContiguousContainer |
module_data, |
|
|
const link::options_t & |
link_options |
|
) |
| |
Create a CUDA driver module from raw module image data.
- Parameters
-
[in] | locus | either a context_t or a device_t - an entity for which one can obtain a CUDA context. This is the context into which the module data is to be loaded (and in which the module contents may be used) |
[in] | module_data | the opaque, raw binary data for the module - in a contiguous container such as a span, a cuda::dynarray etc.. |
◆ load_from_file()
module_t cuda::module::load_from_file |
( |
const context_t & |
context, |
|
|
const char * |
path |
|
) |
| |
|
inline |
Load a module from an appropriate compiled or semi-compiled file, allocating all relevant resources for it.
- Parameters
-
path | of a cubin, PTX, or fatbin file constituting the module to be loaded. |
- Returns
- the loaded module
- Note
- this covers cuModuleLoadFatBinary() even though that's not directly used
- Todo:
: consider adding load_module methods to context_t
: When switching to the C++17 standard, use string_view's instead of the const char* and ::std::string reference