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

Have memory::type_of treat non-CUDA-allocated memory as a non-error #468

Closed
eyalroz opened this issue Feb 18, 2023 · 0 comments
Closed

Have memory::type_of treat non-CUDA-allocated memory as a non-error #468

eyalroz opened this issue Feb 18, 2023 · 0 comments

Comments

@eyalroz
Copy link
Owner

eyalroz commented Feb 18, 2023

If we call cuPointerGetAttribute() with CU_POINTER_ATTRIBUTE_MEMORY_TYPE, and pass a non-CUDA-allocated pointer, we get an error status: CUDA_ERROR_INVALID_VALUE. But actually - that is a perfectly reasonable thing to do, given an arbitrary pointer and wanting to check what CUDA has to say about it.

So, let's add support for doing this:

  • Added a memory type enum value for non-CUDA memory
  • Have type_of() detect this error and return the non-CUDA memory type instead of passing on an error.
@eyalroz eyalroz self-assigned this Feb 18, 2023
eyalroz added a commit that referenced this issue Feb 18, 2023
* 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
eyalroz added a commit that referenced this issue Feb 18, 2023
* 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
eyalroz added a commit that referenced this issue Mar 9, 2023
* 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
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