Skip to content

Feature/asarray #646

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
merged 5 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Next Release] - TBD

### Added
- `dpctl.tensor.asarray`, `dpctl.tensor.empty` implemented (#646).

### Changed
- dpctl-capi is now renamed to `libsyclinterface` (#666).

## [0.11.1] - 11/10/2021
Expand Down
3 changes: 3 additions & 0 deletions dpctl/tensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
from dpctl.tensor._copy_utils import copy_from_numpy as from_numpy
from dpctl.tensor._copy_utils import copy_to_numpy as asnumpy
from dpctl.tensor._copy_utils import copy_to_numpy as to_numpy
from dpctl.tensor._ctors import asarray, empty
from dpctl.tensor._reshape import reshape
from dpctl.tensor._usmarray import usm_ndarray

__all__ = [
"usm_ndarray",
"asarray",
"astype",
"copy",
"empty",
"reshape",
"from_numpy",
"to_numpy",
Expand Down
6 changes: 3 additions & 3 deletions dpctl/tensor/_copy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def copy_to_numpy(ary):
)


def copy_from_numpy(np_ary, usm_type="device", queue=None):
def copy_from_numpy(np_ary, usm_type="device", sycl_queue=None):
"Copies numpy array `np_ary` into a new usm_ndarray"
# This may peform a copy to meet stated requirements
Xnp = np.require(np_ary, requirements=["A", "O", "C", "E"])
if queue:
ctor_kwargs = {"queue": queue}
if sycl_queue:
ctor_kwargs = {"queue": sycl_queue}
else:
ctor_kwargs = dict()
Xusm = dpt.usm_ndarray(
Expand Down
Loading