Skip to content

Commit

Permalink
Fixes #654 context_t::create_module() will now indeed act like `mod…
Browse files Browse the repository at this point in the history
…ule::create()`
  • Loading branch information
eyalroz authored and Eyal Rozenberg committed Jul 9, 2024
1 parent fc263c5 commit 58d5b31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ bool runTest(int device_id) {
auto context = device.create_context();
auto stream = context.create_stream(cuda::stream::async);
auto fatbin = get_file_contents(kernel::fatbin_filename);
auto module = cuda::module::create(context, fatbin);
auto module = context.create_module(fatbin);
auto kernel = module.get_kernel(kernel::name);

auto image = sdkLoadPGM_<float>(image_filename);
Expand Down
5 changes: 2 additions & 3 deletions src/cuda/api/multi_wrapper_impls/module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ template <typename ContiguousContainer,
cuda::detail_::enable_if_t<detail_::is_kinda_like_contiguous_container<ContiguousContainer>::value, bool>>
module_t context_t::create_module(ContiguousContainer module_data) const
{
return module::create<ContiguousContainer>(*this, module_data);
return module::create<context_t const &>(*this, module_data);
}

template <typename ContiguousContainer,
cuda::detail_::enable_if_t<detail_::is_kinda_like_contiguous_container<ContiguousContainer>::value, bool>>
module_t context_t::create_module(ContiguousContainer module_data, const link::options_t& link_options) const
{
return module::create<ContiguousContainer>(*this, module_data, link_options);
return module::create<context_t const &>(*this, module_data, link_options);
}


// These API calls are not really the way you want to work.
inline cuda::kernel_t module_t::get_kernel(const char* name) const
{
Expand Down

0 comments on commit 58d5b31

Please sign in to comment.