Skip to content

Commit

Permalink
Fixes #494: Avoid using library functionality with variadic template-…
Browse files Browse the repository at this point in the history
…template parameters when compiling with MSVC
  • Loading branch information
eyalroz committed Apr 17, 2023
1 parent 8d10c1c commit 836bcbb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,17 @@ setup_virtual_memory(cuda::size_t desired_region_size,
}
);

#ifndef _MSC_VER
virtual_mem::set_access_mode(reserved_range.region(), mapping_devices,
cuda::memory::access_permissions_t::read_and_write());
#else
// MSVC, at least as of 2019, can't handle template-template parameters with variadcs properly;
// so let's go manual:
for(const auto& mapping_device : mapping_devices) {
virtual_mem::set_access_mode(reserved_range.region(), mapping_device,
cuda::memory::access_permissions_t::read_and_write());
}
#endif

return { std::move(reserved_range), std::move(mappings) };
}
Expand Down

0 comments on commit 836bcbb

Please sign in to comment.