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

Enable Compute Follows Data in Cython in fft, random, linalg #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
29 changes: 26 additions & 3 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,39 @@ jobs:
- name: List installed packages
run: conda list

- name: Smoke test
- name: Smoke test without envs
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"

- name: Smoke test with OCL_ICD_FILENAMES
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"
env:
OCL_ICD_FILENAMES: 'libintelocl.so'

- name: Smoke test with SYCL_ENABLE_HOST_DEVICE
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"
env:
SYCL_ENABLE_HOST_DEVICE: '1'

- name: Smoke test with both envs
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"
env:
OCL_ICD_FILENAMES: 'libintelocl.so'
SYCL_ENABLE_HOST_DEVICE: '1'

# TODO: run the whole scope once the issues on CPU are resolved
- name: Run tests
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_mathematical.py test_special.py
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_special.py
env:
OCL_ICD_FILENAMES: 'libintelocl.so'
SYCL_ENABLE_HOST_DEVICE: '1'
working-directory: ${{ env.tests-path }}

- name: Run tests without SYCL_ENABLE_HOST_DEVICE
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_special.py
env:
OCL_ICD_FILENAMES: 'libintelocl.so'
working-directory: ${{ env.tests-path }}

test_windows:
needs: build_windows

Expand Down Expand Up @@ -426,7 +449,7 @@ jobs:

# TODO: run the whole scope once the issues on CPU are resolved
- name: Run tests
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_mathematical.py test_special.py
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_special.py
working-directory: ${{ env.tests-path }}

upload_linux:
Expand Down
23 changes: 21 additions & 2 deletions dpnp/backend/kernels/dpnp_krnl_common.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//*****************************************************************************
// Copyright (c) 2016-2020, Intel Corporation
// Copyright (c) 2016-2022, Intel Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -97,6 +97,7 @@ void dpnp_astype_c(const void* array1_in, void* result1, const size_t size)
size,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);
DPCTLEvent_Delete(event_ref);
}

template <typename _DataType, typename _ResultType>
Expand Down Expand Up @@ -477,6 +478,7 @@ void dpnp_dot_c(void* result_out,
input2_strides,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);
DPCTLEvent_Delete(event_ref);
}

template <typename _DataType_output, typename _DataType_input1, typename _DataType_input2>
Expand Down Expand Up @@ -614,6 +616,7 @@ void dpnp_eig_c(const void* array_in, void* result1, void* result2, size_t size)
size,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);
DPCTLEvent_Delete(event_ref);
}

template <typename _DataType, typename _ResultType>
Expand Down Expand Up @@ -707,6 +710,7 @@ void dpnp_eigvals_c(const void* array_in, void* result1, size_t size)
size,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);
DPCTLEvent_Delete(event_ref);
}

template <typename _DataType, typename _ResultType>
Expand Down Expand Up @@ -774,7 +778,7 @@ void dpnp_initval_c(void* result1, void* value, size_t size)
size,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);

DPCTLEvent_Delete(event_ref);
}

template <typename _DataType>
Expand Down Expand Up @@ -941,6 +945,7 @@ void dpnp_matmul_c(void* result_out,
input2_strides,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);
DPCTLEvent_Delete(event_ref);
}

template <typename _DataType>
Expand Down Expand Up @@ -1112,11 +1117,25 @@ void func_map_init_linalg(func_map_t& fmap)
fmap[DPNPFuncName::DPNP_FN_EIG][eft_FLT][eft_FLT] = {eft_FLT, (void*)dpnp_eig_default_c<float, float>};
fmap[DPNPFuncName::DPNP_FN_EIG][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_eig_default_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_INT][eft_INT] = {eft_DBL, (void*)dpnp_eig_ext_c<int32_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_LNG][eft_LNG] = {eft_DBL, (void*)dpnp_eig_ext_c<int64_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_FLT][eft_FLT] = {eft_FLT, (void*)dpnp_eig_ext_c<float, float>};
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_eig_ext_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_INT][eft_INT] = {eft_DBL, (void*)dpnp_eigvals_default_c<int32_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_LNG][eft_LNG] = {eft_DBL, (void*)dpnp_eigvals_default_c<int64_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_FLT][eft_FLT] = {eft_FLT, (void*)dpnp_eigvals_default_c<float, float>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_eigvals_default_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_INT][eft_INT] = {eft_DBL,
(void*)dpnp_eigvals_ext_c<int32_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_LNG][eft_LNG] = {eft_DBL,
(void*)dpnp_eigvals_ext_c<int64_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_FLT][eft_FLT] = {eft_FLT,
(void*)dpnp_eigvals_ext_c<float, float>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_DBL][eft_DBL] = {eft_DBL,
(void*)dpnp_eigvals_ext_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_INITVAL][eft_BLN][eft_BLN] = {eft_BLN, (void*)dpnp_initval_default_c<bool>};
fmap[DPNPFuncName::DPNP_FN_INITVAL][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_initval_default_c<int32_t>};
fmap[DPNPFuncName::DPNP_FN_INITVAL][eft_LNG][eft_LNG] = {eft_LNG, (void*)dpnp_initval_default_c<int64_t>};
Expand Down
Loading