Skip to content

Commit

Permalink
Enable Compute Follows Data in Cython in fft, random, linalg
Browse files Browse the repository at this point in the history
Add q_ref as parametr to dpnp_memory_free_c and some fixies

Cancel changes in random module

Modify cython layer for rfft

Skip test_eig on CPU and change test_qr

Rollback updates in random

Finalize CFD support in fft

Finalize CFD support in linalg
  • Loading branch information
LukichevaPolina authored and antonwolfy committed Oct 13, 2022
1 parent 42ec3a2 commit b176d54
Show file tree
Hide file tree
Showing 15 changed files with 1,068 additions and 391 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,38 @@ 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()"
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 +448,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

0 comments on commit b176d54

Please sign in to comment.