Skip to content

Commit

Permalink
Fixes #466, fixes #467, fixes #468 :
Browse files Browse the repository at this point in the history
* Added a memory::type_t enum value, `non_cuda`, for memory not allocated by CUDA
* `memory::type_of()` will no longer fail for non-CUDA-allocated memory
* `copy_parameters_t<N>` is not out of `detail_`.
* The `endpoint_t` enum is now also out of `detail_`
* Beefed up `copy_parameters_t<N>` with additional convenience methods
*`copy_parameters_t<N>` now "recognizes" non-CUDA-allocated memory, treating it like CUDA host memory
* Our array-to-raw-mem copy function now determines the destination address' context
* Add an array-to-raw-mem copy function which takes the destination context explicitly
  • Loading branch information
eyalroz committed Feb 18, 2023
1 parent 84751be commit d11402a
Show file tree
Hide file tree
Showing 7 changed files with 695 additions and 229 deletions.
1 change: 1 addition & 0 deletions examples/by_runtime_api_module/unified_addressing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void wrapped_pointers_and_regions(const cuda::device_t& device)

switch (cuda::memory::type_of(ptr)) {
using namespace cuda::memory;
case non_cuda: die_("Pointer incorrectly reported to point into non-CUDA-allocated memory"); break;
case host_: die_("Pointer incorrectly reported to point into host memory"); break;
case array: die_("Pointer incorrectly reported to point to array memory"); break;
// case unregistered_memory: die_("Pointer incorrectly reported to point to \"unregistered\" memory"); break;
Expand Down
1 change: 1 addition & 0 deletions src/cuda/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <cuda/api/ipc.hpp>
#include <cuda/api/array.hpp>
#include <cuda/api/texture_view.hpp>
#include <cuda/api/copy_parameters.hpp>
#include <cuda/api/memory.hpp>
#include <cuda/api/unique_ptr.hpp>
#include <cuda/api/link_options.hpp>
Expand Down
1 change: 1 addition & 0 deletions src/cuda/api/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ constexpr flags_t inline make_flags(
| (keep_larger_local_mem_after_resize ? CU_CTX_LMEM_RESIZE_TO_MAX : 0) );
}

// consider renaming this: device_id_of
inline device::id_t get_device_id(handle_t context_handle)
{
auto needed_push = current::detail_::push_if_not_on_top(context_handle);
Expand Down
Loading

0 comments on commit d11402a

Please sign in to comment.