Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 328
Memory refactor#1205
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
Uh oh!
There was an error while loading. Please reload this page.
Memory refactor #1205
Changes from all commits
37849a3ac8a69c123aa24fe4b67ece77d44c5179bce192748729c9008735455b2517f6a61317a0e2d1d853876297fa38caf357abd89057f900b60ebecc9405228936b9a86bdec7f6cde216b4fb6a30a39229ddc60fd3ca9076d7b444f75877c97d220fac8000d5f08b567ea2c7315e28cf4dc9d19e4b8f743b8a3cce7f6cff3820fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,16 +6,14 @@ cimport cpython | ||
| from libc.stdint cimport uintptr_t | ||
| from cuda.bindings cimport cydriver | ||
| from cuda.core.experimental._utils.cuda_utils cimport HANDLE_RETURN | ||
| import threading | ||
| from typing import Union | ||
| from typing import Union, TYPE_CHECKING | ||
| from cuda.core.experimental._context import Context, ContextOptions | ||
| from cuda.core.experimental._event import Event, EventOptions | ||
| from cuda.core.experimental._graph import GraphBuilder | ||
| from cuda.core.experimental._memory import Buffer, DeviceMemoryResource, MemoryResource, _SynchronousMemoryResource | ||
| from cuda.core.experimental._stream import IsStreamT, Stream, StreamOptions | ||
| from cuda.core.experimental._utils.clear_error_support import assert_type | ||
| from cuda.core.experimental._utils.cuda_utils import ( | ||
| @@ -27,7 +25,8 @@ from cuda.core.experimental._utils.cuda_utils import ( | ||
| ) | ||
| from cuda.core.experimental._stream cimport default_stream | ||
| if TYPE_CHECKING: | ||
| from cuda.core.experimental._memory import Buffer, MemoryResource | ||
| # TODO: I prefer to type these as "cdef object" and avoid accessing them from within Python, | ||
| # but it seems it is very convenient to expose them for testing purposes... | ||
| @@ -996,8 +995,10 @@ class Device: | ||
| ) | ||
| ) | ||
| if attr == 1: | ||
| from cuda.core.experimental._memory import DeviceMemoryResource | ||
leofang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| device._mr = DeviceMemoryResource(dev_id) | ||
| else: | ||
| from cuda.core.experimental._memory import _SynchronousMemoryResource | ||
leofang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| device._mr = _SynchronousMemoryResource(dev_id) | ||
| device._has_inited = False | ||
| @@ -1131,6 +1132,7 @@ class Device: | ||
| @memory_resource.setter | ||
| def memory_resource(self, mr): | ||
| from cuda.core.experimental._memory import MemoryResource | ||
leofang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| assert_type(mr, MemoryResource) | ||
| self._mr = mr | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.