Skip to content

Documentation remove gpu dependency #398

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

Merged
13 changes: 7 additions & 6 deletions cuda_core/cuda/core/experimental/_memoryview.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ cdef class StridedMemoryView:
----------
ptr : int
Pointer to the tensor buffer (as a Python `int`).
shape: tuple
shape : tuple
Shape of the tensor.
strides: tuple
strides : tuple
Strides of the tensor (in **counts**, not bytes).
dtype: numpy.dtype
Data type of the tensor.
device_id: int
device_id : int
The device ID for where the tensor is located. It is -1 for CPU tensors
(meaning those only accessible from the host).
is_device_accessible: bool
is_device_accessible : bool
Whether the tensor data can be accessed on the GPU.
readonly: bool
Whether the tensor data can be modified in place.
exporting_obj: Any
exporting_obj : Any
A reference to the original tensor object that is being viewed.

Parameters
Expand Down Expand Up @@ -334,7 +334,8 @@ cdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None):


def args_viewable_as_strided_memory(tuple arg_indices):
"""Decorator to create proxy objects to :obj:`StridedMemoryView` for the
"""
Decorator to create proxy objects to :obj:`StridedMemoryView` for the
specified positional arguments.

This allows array/tensor attributes to be accessed inside the function
Expand Down
23 changes: 22 additions & 1 deletion cuda_core/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
from unittest.mock import MagicMock

from cuda.core.experimental._system import System

# import sys
# sys.path.insert(0, os.path.abspath('.'))


Expand Down Expand Up @@ -102,6 +105,24 @@
napoleon_numpy_docstring = True


# Mock the System class and its methods
class MockSystem:
def __init__(self, *args, **kwargs):
pass

driver_version = MagicMock()
driver_version.__doc__ = System.driver_version.__doc__
num_devices = MagicMock()
num_devices.__doc__ = System.num_devices.__doc__
devices = MagicMock()
devices.__doc__ = System.devices.__doc__


sys.modules["cuda.core.experimental._system.System"] = MagicMock(System=MockSystem)

# Add 'cuda.core.experimental.system' to autodoc_mock_imports
autodoc_mock_imports = ["cuda.core.experimental.system"]

section_titles = ["Returns"]


Expand Down
Loading