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

Initial commit: Pyccel Cuda #12

Draft
wants to merge 232 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 184 commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
85eca03
added kernel class and cudaext.py
bauom Aug 17, 2022
42d695a
added kernel class and cudaext.py
bauom Aug 17, 2022
fdddcc3
remove prints
bauom Aug 17, 2022
f07761b
added printers for arraycreation and thread indexing && added memory_…
bauom Aug 18, 2022
e5432f1
fixed a cwarapper problem for cuda
bauom Aug 18, 2022
c6116f5
fixed cudadevicesynchronize call
bauom Aug 23, 2022
a9d61c9
activate github action test
bauom Aug 25, 2022
8290b60
remove unnecessary lines
bauom Aug 25, 2022
a3f1634
Merge branch 'master' of https://github.com/pyccel/pyccel into cuda_00
bauom Aug 25, 2022
7a32fe5
Revert "remove unnecessary lines"
bauom Aug 25, 2022
74b4ae5
fixed conflicts after merge with master
bauom Aug 25, 2022
39d5652
fixed cudanameclashchecker
bauom Aug 25, 2022
cc94707
fixed cudanameclasher typo
bauom Aug 25, 2022
9943622
Cuda tests
bauom Sep 6, 2022
bc737a4
added cuda_install action
bauom Sep 6, 2022
80c6831
using local installer
bauom Sep 6, 2022
5797580
use docker container
bauom Sep 6, 2022
ea2657a
use docker container
bauom Sep 6, 2022
4cd6e86
use docker container devel
bauom Sep 6, 2022
b371358
use docker container devel
bauom Sep 6, 2022
6376c38
removed sudo from linux_install
bauom Sep 6, 2022
a26546d
added y option to apt-get install cmd
bauom Sep 6, 2022
1830de9
tzdata waiting for input
bauom Sep 6, 2022
902cb36
added TIMEZONE
bauom Sep 6, 2022
6ee6984
installing python3 in container
bauom Sep 6, 2022
e43a920
python-is-python3
bauom Sep 6, 2022
59211fc
python-is-python3
bauom Sep 6, 2022
0cac77c
python-is-python3
bauom Sep 6, 2022
2446b45
python-is-python3
bauom Sep 6, 2022
24dd528
python-is-python3
bauom Sep 6, 2022
75eba42
Merge branch 'master' of https://github.com/pyccel/pyccel into cuda_00
bauom Sep 11, 2022
975732d
added cupy support
bauom Sep 11, 2022
75d0e36
fixed type of cuda_ndaarays funcs
bauom Sep 16, 2022
f6b8d60
temp branch waiting for cuda_main to be merged
bauom Sep 20, 2022
52f4bdc
extern "C" to function_signature added
framdani Sep 20, 2022
17f4d36
fixed types in array_fill funcs
bauom Sep 20, 2022
3363001
updated CudaArray process shape
bauom Sep 20, 2022
37d4d8f
removed linker options as they don't work with nvcc
bauom Sep 20, 2022
c757181
fixed typo
bauom Sep 20, 2022
eedc616
updated test for array_fill
bauom Sep 20, 2022
dff7a9f
added cuda tests
bauom Sep 20, 2022
6dc0be4
eq in place of is
bauom Sep 20, 2022
f668acd
capitalized first char of ccuda
bauom Sep 20, 2022
7ce1199
fixed trailing type for array_fill functions
bauom Sep 20, 2022
bf9d7d5
fixed trailing types
bauom Sep 20, 2022
740ff35
specify only fortran test instead of not c or python
bauom Sep 20, 2022
b2a719c
fixed trailing type for functions in header file
bauom Sep 20, 2022
61a3d71
testing Cuda tests alone
bauom Sep 21, 2022
842171a
fixed trailing types
bauom Sep 21, 2022
bc0862c
test github action working dir
bauom Sep 21, 2022
3a70b55
test github action working dir
bauom Sep 21, 2022
d9aba15
removed debug and changed working dir to tests
bauom Sep 21, 2022
e2c9155
verbose True
bauom Sep 21, 2022
452d2e3
changing working dir to root
bauom Sep 21, 2022
2aca8e7
removed outdated code
bauom Sep 21, 2022
d76a61b
Cuda_internal_var can only be used in kernels and device funcs
Pinkyboi Oct 4, 2022
4eec542
reactivate normal pyccel tests
bauom Oct 4, 2022
0238432
Check type of passed parameter to Kernel Block number and Thread per …
Pinkyboi Oct 4, 2022
9804d3b
Check for stackarray variables in kernel call
Pinkyboi Oct 4, 2022
bad4f7a
update clash class name for cuda
framdani Oct 7, 2022
df8fb17
activate tests
framdani Oct 7, 2022
455ed0f
fix linter
framdani Oct 7, 2022
c81420c
define the memory location for cuda array
framdani Oct 8, 2022
400a662
remove trailing whitespace
framdani Oct 8, 2022
249de6d
fix linux failing test
framdani Oct 10, 2022
92a46e0
update clash class name for cuda #1203
bauom Oct 10, 2022
fd1c533
Merge remote-tracking branch 'origin/cuda_main_temp' into cuda_array
framdani Oct 12, 2022
cab397d
call the appropriate memory management function
framdani Oct 12, 2022
307e613
add missing ;
framdani Oct 12, 2022
f76f788
update memory management functions name and memory_locations enum
framdani Oct 17, 2022
e9c9ff9
Add device to the check for Cuda_internal_var
Pinkyboi Oct 17, 2022
688a2bc
Check for number of passed argument to kernel call
Pinkyboi Oct 17, 2022
7ce252c
Remove check for none argument variables
Pinkyboi Oct 17, 2022
b3a2657
Revert back to previous check on passed argument
Pinkyboi Oct 17, 2022
6182501
Remove support for tuple and varibale number of block and number of t…
Pinkyboi Oct 17, 2022
960d8a7
Split check for thread per block and block number
Pinkyboi Oct 17, 2022
7b76f59
add ccuda to test languages and add the new error messages
Pinkyboi Oct 17, 2022
13b08b8
Add tests
Pinkyboi Oct 17, 2022
214a2f6
Specify test parameter inside the test file instead
Pinkyboi Oct 17, 2022
aede95b
Make tests run only with ccuda
Pinkyboi Oct 18, 2022
dbff2d7
update create_cuda_array() and add tests
framdani Oct 19, 2022
e20dcfa
Merge pull request #1199 from pyccel/cuda_devel_003
bauom Oct 19, 2022
fd0bf9a
Add tests for each memory_location
framdani Oct 20, 2022
a011e44
update test for managedMemory
framdani Oct 20, 2022
cd4b53e
Initial issue fix
Pinkyboi Oct 22, 2022
8bd840e
Handle case of one dimensional call
Pinkyboi Oct 22, 2022
abdac0a
remove unnecessary comments
framdani Oct 24, 2022
32959a6
Add test for cuda_grid
Pinkyboi Oct 25, 2022
a0dcf12
Call other kernels in test
Pinkyboi Oct 26, 2022
3c603a4
remove unnecessary commented lines
framdani Oct 26, 2022
27b103d
adding multiple memory locations
bauom Oct 27, 2022
bb7cb0c
add class CudaCopy
framdani Oct 27, 2022
40dbf9c
add printer and tests for cuda.copy
framdani Oct 28, 2022
4ec6b7f
Comment calls to func_2d func_3d
Pinkyboi Oct 28, 2022
592f909
add support for asynchronous copy
framdani Oct 31, 2022
aaad8b8
Merge pull request #1221 from pyccel/cuda_grid
Pinkyboi Nov 3, 2022
e543938
Initial addition of memcopy_kind
Pinkyboi Nov 8, 2022
2823e74
Raise error when allocating to host from device function
Pinkyboi Nov 11, 2022
aa5e773
Change error message for creating host array form device
Pinkyboi Nov 16, 2022
e3e13f1
Change memcpy_kind variable name for readability
Pinkyboi Nov 16, 2022
2220491
Merge pull request #1228 from pyccel/cuda_memcopy
Pinkyboi Nov 16, 2022
7a62301
Revert "Addition of valid cudaMemcpyKind to cudaMemcpy"
bauom Nov 17, 2022
3ea37a5
Merge pull request #1233 from pyccel/revert-1228-cuda_memcopy
bauom Nov 17, 2022
fab605f
Merge branch 'cuda_main_temp' into cuda_copy
bauom Nov 18, 2022
28f3ecf
support copy only from cuda arrays
framdani Nov 20, 2022
55ac741
access attributes by getters
framdani Nov 21, 2022
3b6c82f
add 'managed' as valid memory location arg for cuda.copy()
framdani Nov 28, 2022
04a9a7f
Add cuda.copy function
bauom Nov 30, 2022
d1a8d5b
Change call to cudaDeviceSynchronize to cuda.synchronize() (#1274)
Pinkyboi Dec 21, 2022
c368f2d
merged with master
bauom Jan 3, 2023
c2dd0b7
Temporarily deactivate most recent numpy
bauom Jan 4, 2023
4335a52
Put tests back on branch
EmilyBourne Jan 6, 2023
aa4786c
Fix CI tools
EmilyBourne Jan 6, 2023
2440d2a
Add coverage to cuda tests
EmilyBourne Jan 6, 2023
61dc630
Trigger
EmilyBourne Jan 6, 2023
7ce2df6
Add missing condition
EmilyBourne Jan 6, 2023
7893893
Add missing setup
EmilyBourne Jan 6, 2023
47382ce
Correct name
EmilyBourne Jan 6, 2023
665baff
Install source
EmilyBourne Jan 6, 2023
ef8f762
Add sensible condition
EmilyBourne Jan 6, 2023
c7f354f
Install sudo
EmilyBourne Jan 6, 2023
3485879
Trigger for cuda_main and cuda_main_temp
EmilyBourne Jan 6, 2023
f519036
Don't run after failure
EmilyBourne Jan 6, 2023
01fe982
Configure tzdata
EmilyBourne Jan 6, 2023
213e970
Remove ENV
EmilyBourne Jan 6, 2023
053858b
Require success
EmilyBourne Jan 6, 2023
f6ded85
install tzdata
EmilyBourne Jan 6, 2023
8f51b28
Try alternative definition
EmilyBourne Jan 6, 2023
8beef7c
Add check
EmilyBourne Jan 6, 2023
0c24cf5
Remove debug info
EmilyBourne Jan 6, 2023
a6082c3
Save xml file
EmilyBourne Jan 6, 2023
5656ed2
Save to correct xml file
EmilyBourne Jan 6, 2023
0430ec0
Don't run if failure
EmilyBourne Jan 6, 2023
f6f9f57
Merge remote-tracking branch 'origin/master' into cuda_main_temp
EmilyBourne Jan 9, 2023
80197fa
Remove restriction
EmilyBourne Jan 9, 2023
631fd9b
Fix type inference for Cupy array functions (#1300)
Pinkyboi Jan 11, 2023
b227b77
Merge branch 'master' of github.com:pyccel/pyccel into cuda_main_temp
bauom Jan 11, 2023
10172a9
Merge remote-tracking branch 'origin/cuda_main_temp' into cuda_coverage
EmilyBourne Jan 11, 2023
81bd653
Turn on tests for cuda
EmilyBourne Jan 11, 2023
ef45c74
Turn on tests for cuda
EmilyBourne Jan 11, 2023
30750a3
Fix kernel launch configuration errors (#1279)
framdani Jan 11, 2023
68a3b11
cleaning compile stage Cuda tests. (#1301)
bauom Jan 11, 2023
9af4c27
Merge remote-tracking branch 'origin/cuda_main_temp' into cuda_coverage
EmilyBourne Jan 11, 2023
96996bc
Merge pull request #1291 from pyccel/cuda_coverage
EmilyBourne Jan 11, 2023
f6ee2bb
Ensure master tests are triggered on cuda_main (#1305)
EmilyBourne Jan 12, 2023
cfe23d8
Merge remote-tracking branch 'other/master' into cuda_main
EmilyBourne Mar 14, 2023
6a11942
Fix commit
EmilyBourne Mar 14, 2023
e52035d
pip_installation no longer exists
EmilyBourne Mar 14, 2023
4f538e2
Add Code owners to protect merges
EmilyBourne Mar 14, 2023
7dd51f3
Debug coverage problem
EmilyBourne Mar 14, 2023
d1f61c5
Remove debugging
EmilyBourne Mar 14, 2023
b8e7b8c
Trigger codacy
EmilyBourne Mar 15, 2023
a7c3fc9
Trigger codacy
EmilyBourne Mar 16, 2023
79c2293
Correct folder
EmilyBourne Mar 17, 2023
2dbf5f9
Include cuda files in MANIFEST
EmilyBourne Mar 17, 2023
92155b4
Update checkout version
EmilyBourne Mar 17, 2023
e83d007
Import coverage fixes
EmilyBourne Mar 17, 2023
0c63927
Remove unnecessary echo
EmilyBourne Mar 17, 2023
8fc7fe0
Ensure cuda files are installed with pyccel (#1345)
EmilyBourne Mar 20, 2023
6e066fe
Make faster as done in cuda_main_temp
EmilyBourne Mar 20, 2023
82d8577
Trigger codacy
EmilyBourne Mar 20, 2023
beb44ad
Try with coverage secret
EmilyBourne Mar 20, 2023
7638bc6
Add first commit to provide codacy baseline
EmilyBourne Mar 20, 2023
b0ad674
Only run benchmarks in Pyccel repo
EmilyBourne Mar 20, 2023
7d2fdb3
Merge remote-tracking branch 'cuda/master' into cuda_main
EmilyBourne Mar 20, 2023
70a9590
Trigger codacy with correct branch name
EmilyBourne Mar 21, 2023
58141cb
Merge pull request #1 from pyccel/cuda_main
EmilyBourne Mar 21, 2023
1e4db4b
merged pyccel-cuda/developement into cuda_main_temp
bauom Apr 2, 2023
b0104bd
complex not supported in cuda
bauom Apr 2, 2023
79a2407
fixing cuda free
bauom Apr 2, 2023
cdfff5b
fixed cuda_arange internal function
bauom Apr 2, 2023
db7b3e9
fixed white spaces
bauom Apr 2, 2023
53725c3
activate tests for developement branch
bauom Apr 2, 2023
35d4b3d
typo in branch name
bauom Apr 2, 2023
251c5c1
updated ccuda codegen signature_function method
bauom Apr 2, 2023
be495a9
merged with cuda:development
bauom Apr 3, 2023
58ba91a
Fix allocation mishandling in CUDA array creation (#1328)
framdani Apr 3, 2023
d454109
merged pyccel:#1328
bauom Apr 3, 2023
2430db4
remove unnecesasry comment
bauom Apr 3, 2023
c39934d
removed debug print
bauom Apr 3, 2023
5e10cc7
fixed alignement
bauom Apr 3, 2023
b60d731
fix pytest cuda action
bauom Apr 3, 2023
abf004b
Fix triggers
EmilyBourne Apr 3, 2023
ba35a69
Merge branch 'development' into cuda_main_temp
EmilyBourne Apr 3, 2023
4d46374
Merge branch 'pyccel:master' into master
EmilyBourne Apr 12, 2023
c2538e5
Merge branch 'master' into cuda_master
EmilyBourne Apr 13, 2023
713ee6b
Set up bot for cuda
EmilyBourne Apr 13, 2023
e406bc5
Correct double if
EmilyBourne Apr 13, 2023
7f4b669
Wrong file
EmilyBourne Apr 13, 2023
1d7aac2
Merge branch 'pyccel:master' into master
EmilyBourne Apr 13, 2023
03e42a1
Merge remote-tracking branch 'origin/master' into cuda_master
EmilyBourne Apr 16, 2023
d77057c
Correct typo
EmilyBourne Apr 16, 2023
935e903
Use rpath with nvidia (#14)
EmilyBourne Apr 17, 2023
207cafe
Merge branch 'development' into cuda_main_temp
bauom Apr 17, 2023
1a2542d
Missing bot output
EmilyBourne Apr 17, 2023
2586923
Merge branch 'development' into cuda_main_temp
bauom Apr 17, 2023
3ab2ec5
Merge branch 'pyccel:master' into master
EmilyBourne Apr 18, 2023
bdc76f5
Merge branch 'development' into cuda_main_temp
bauom Apr 18, 2023
d84d430
changed how we choose default compiler family
bauom Apr 18, 2023
d854a0a
removed dead code
bauom Apr 19, 2023
0a8272c
removed unnecessary property func
bauom Apr 19, 2023
a2dd793
added missed change to tests
bauom Apr 19, 2023
9190df9
remove unnecessary code in kernelcall class
bauom Apr 19, 2023
33e3439
made CudaNewArray inherit from NumpyNewArray
bauom Apr 19, 2023
0bbad8f
Fix deallocate printer (#1266)
framdani Apr 19, 2023
0d7075c
fixing merge
bauom Apr 19, 2023
9720723
fixed basename issue && a test case
bauom Apr 19, 2023
09b3533
changed attributes in CudaInternalVar, CudaSynchronize to class varia…
bauom Apr 19, 2023
0553846
fixed docs string capitalisation
bauom Apr 19, 2023
9f989ff
removed cuda_constants empty dict
bauom Apr 19, 2023
c7222ff
removed unnecessary Asname call
bauom Apr 19, 2023
4f9b7b9
removed useless change
bauom Apr 19, 2023
8e318c5
updated epyccel docs string
bauom Apr 19, 2023
9a12a0e
Update pyccel/decorators.py only importing array from numpy
bauom Apr 19, 2023
d83b696
added doc string to kernel decorator
bauom Apr 19, 2023
e9f9da9
added kernel docs to tutorial/decorators.md
bauom Apr 19, 2023
ff72d7f
improved doc string of kernel decorator
bauom Apr 19, 2023
d20c130
Merge branch 'pyccel:master' into master
EmilyBourne Apr 21, 2023
e3f7c00
Merge remote-tracking branch 'origin/master' into cuda_master
EmilyBourne Apr 26, 2023
1460194
Merge branch 'pyccel:master' into master
EmilyBourne Apr 27, 2023
843338b
Merge branch 'pyccel:master' into master
EmilyBourne Apr 28, 2023
fc06e37
Merge branch 'pyccel:devel' into main
EmilyBourne May 3, 2023
6a8a7ed
removed unnecessary pass
bauom May 8, 2023
e640648
removed unused imports
bauom May 8, 2023
57e11e2
used f-string
bauom May 8, 2023
859e3e4
removed unused imports
bauom May 8, 2023
1e512e9
removed unused imports ccudacode
bauom May 8, 2023
c6e526c
fixed typo ??
bauom May 8, 2023
d2c2730
fixed indent
bauom May 8, 2023
b390863
using f-strings
bauom May 8, 2023
9041f73
Merge remote-tracking branch 'origin/devel' into cuda_main
EmilyBourne May 24, 2023
91dbd27
Merge branch 'devel' into cuda_main_temp
EmilyBourne May 24, 2023
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
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @EmilyBourne @bauom

1 change: 0 additions & 1 deletion .github/actions/coverage_collection/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ runs:
- name: Coverage collection
run: |
coverage combine
coverage xml
rm ${SITE_DIR}/pyccel_cov.pth
shell: bash

2 changes: 1 addition & 1 deletion .github/actions/coverage_install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
- name: Directory Creation
run: |
INSTALL_DIR=$(cd tests; python -c "import pyccel; print(pyccel.__path__[0])")
SITE_DIR=$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')
SITE_DIR=$(dirname ${INSTALL_DIR})
echo -e "import coverage; coverage.process_startup()" > ${SITE_DIR}/pyccel_cov.pth
echo -e "[run]\nparallel = True\nsource = ${INSTALL_DIR}\ndata_file = $(pwd)/.coverage\n[report]\ninclude = ${INSTALL_DIR}/*\n[xml]\noutput = cobertura.xml" > .coveragerc
echo "SITE_DIR=${SITE_DIR}" >> $GITHUB_ENV
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/linux_install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ runs:
shell: bash
- name: Install fortran
run:
sudo apt-get install gfortran
sudo apt-get install -y gfortran
shell: bash
- name: Install LaPack
run:
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install -y libblas-dev liblapack-dev
shell: bash
- name: Install MPI
run: |
sudo apt-get install libopenmpi-dev openmpi-bin
sudo apt-get install -y libopenmpi-dev openmpi-bin
echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV
shell: bash
- name: Install OpenMP
run:
sudo apt-get install libomp-dev libomp5
sudo apt-get install -y libomp-dev libomp5
shell: bash
- name: Install Valgrind
run:
sudo apt-get install valgrind
sudo apt-get install -y valgrind
shell: bash
8 changes: 4 additions & 4 deletions .github/actions/pytest_run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ runs:
- name: Test with pytest
run: |
which python
python -m pytest -n auto -rXx -v -m "not (parallel or xdist_incompatible) and c" --ignore=symbolic --ignore=ndarrays
python -m pytest -n auto -rXx -v -m "not (parallel or xdist_incompatible) and c" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays
if [ -n "${SITE_DIR}" ]; then
echo "Touching"
# Test ndarray folder update (requires parallel tests to avoid clean)
touch ${SITE_DIR}/pyccel/stdlib/cwrapper/cwrapper.h
python -m pytest -n auto -rXx -v -m c -k test_array_int32_1d_scalar epyccel/test_arrays.py
fi
python -m pytest -rXx -m "xdist_incompatible and not parallel and c" --ignore=symbolic --ignore=ndarrays
python -m pytest -rXx -m "xdist_incompatible and not parallel and c" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays
pyccel-clean
python -m pytest -n auto -rXx -m "not (parallel or xdist_incompatible) and not (c or python)" --ignore=symbolic --ignore=ndarrays
python -m pytest -rXx -m "xdist_incompatible and not parallel and not (c or python)" --ignore=symbolic --ignore=ndarrays
python -m pytest -n auto -rXx -m "not (parallel or xdist_incompatible) and not (c or python or ccuda)" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays
python -m pytest -rXx -m "xdist_incompatible and not parallel and not (c or python or ccuda)" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays
pyccel-clean
python -m pytest ndarrays/ -rXx
pyccel-clean
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/pytest_run_cuda/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Pyccel pytest commands generating Ccuda'
inputs:
shell_cmd:
description: 'Specifies the shell command (different for anaconda)'
required: false
default: "bash"

runs:
using: "composite"
steps:
- name: Ccuda tests with pytest
run: |
# Catch exit 5 (no tests found)
sh -c 'python -m pytest -n auto -rx -m "not (parallel or xdist_incompatible) and ccuda" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret'
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
4 changes: 2 additions & 2 deletions .github/actions/pytest_run_python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ runs:
steps:
- name: Python tests with pytest
run: |
python -m pytest -n auto -rXx -m "not (parallel or xdist_incompatible) and python" --ignore=symbolic --ignore=ndarrays
python -m pytest -rXx -m "xdist_incompatible and not parallel and python" --ignore=symbolic --ignore=ndarrays
python -m pytest -n auto -rXx -m "not (parallel or xdist_incompatible) and python" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays
python -m pytest -rXx -m "xdist_incompatible and not parallel and python" --ignore=symbolic --ignore=ndarrays --ignore=cuda_ndarrays
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
17 changes: 17 additions & 0 deletions .github/actions/python_install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Python installation commands'

runs:
using: "composite"
steps:
- name: Install python
run:
sudo apt-get -y install python3-dev
shell: bash
- name: python as python3
run:
sudo apt-get -y install python-is-python3
shell: bash
- name: Install Pip
run:
sudo apt-get -y install python3-pip
shell: bash
107 changes: 97 additions & 10 deletions .github/workflows/Github_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pyccel tests

on:
pull_request:
branches: [ master ]
branches: [ master, development ]

jobs:
Linux:
Expand Down Expand Up @@ -35,17 +35,11 @@ jobs:
- name: Collect coverage information
continue-on-error: True
uses: ./.github/actions/coverage_collection
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
continue-on-error: True
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: cobertura.xml
- name: Save code coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-artifact
path: cobertura.xml
path: .coverage
retention-days: 1

Windows:
Expand Down Expand Up @@ -104,10 +98,103 @@ jobs:
- name: Parallel tests with pytest
uses: ./.github/actions/pytest_parallel

Cuda:

runs-on: ubuntu-20.04
container: nvidia/cuda:11.7.1-devel-ubuntu20.04
if: github.event.pull_request.base.ref != 'master'
steps:
- uses: actions/checkout@v3
- name: Prepare docker
run: |
apt update && apt install sudo
TZ=Europe/France
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
shell: bash
- name: CUDA Version
run: nvcc --version # cuda install check
- name: Install dependencies
uses: ./.github/actions/linux_install
- name: Install python (setup-python action doesn't work with containers)
uses: ./.github/actions/python_install
- name: Install Pyccel with tests
run: |
PATH=${PATH}:$HOME/.local/bin
echo "PATH=${PATH}" >> $GITHUB_ENV
python -m pip install --upgrade pip
python -m pip install --user .[test]
shell: bash
- name: Coverage install
uses: ./.github/actions/coverage_install
- name: Ccuda tests with pytest
uses: ./.github/actions/pytest_run_cuda
- name: Collect coverage information
continue-on-error: True
uses: ./.github/actions/coverage_collection
- name: Save code coverage report
uses: actions/upload-artifact@v3
with:
name: cuda-coverage-artifact
path: .coverage
retention-days: 1

CoverageCollection:

runs-on: ubuntu-latest
needs: [Linux, Cuda]
if: ${{ always() && needs.Linux.result == 'success' && needs.Cuda.result != 'failure' }}

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
uses: ./.github/actions/linux_install
- name: Install coverage
run: |
python -m pip install --upgrade pip
python -m pip install coverage
shell: bash
- name: Collect coverage information
uses: actions/download-artifact@v3
with:
name: coverage-artifact
- name: Rename coverage file
run: mv .coverage .coverage.linux
- name: Collect coverage information
uses: actions/download-artifact@v3
if: needs.Cuda.result == 'success'
with:
name: cuda-coverage-artifact
- name: Rename coverage file
if: needs.Cuda.result == 'success'
run: mv .coverage .coverage.cuda
- name: Generate coverage report
run: |
echo -e "[paths]\nsource =\n $(pwd)/pyccel\n */site-packages/pyccel\n[xml]\noutput = cobertura.xml" > .coveragerc
coverage combine
coverage xml
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
continue-on-error: True
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: cobertura.xml
- name: Save code coverage xml report
uses: actions/upload-artifact@v3
with:
name: coverage-artifact-xml
path: cobertura.xml
retention-days: 1

CoverageChecker:

runs-on: ubuntu-latest
needs: Linux
needs: [CoverageCollection]
if: ${{ always() && needs.CoverageCollection.result == 'success' && needs.Cuda.result != 'failure' }}

steps:
- uses: actions/checkout@v3
Expand All @@ -123,7 +210,7 @@ jobs:
- name: Collect coverage information
uses: actions/download-artifact@v3
with:
name: coverage-artifact
name: coverage-artifact-xml
- name: Collect diff information
run: |
BASE_BRANCH=$GITHUB_BASE_REF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Benchmarks

on:
push:
branches: [ master ]
branches: [ pyccel/master ]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Doc Coverage Action

on:
pull_request:
branches: [ master ]
branches: [ master, development ]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Python Linting
on:
pull_request:
branches: [ master ]
branches: [ master, development ]

jobs:
Linter:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pyccel_lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Pyccel Linting
on:
pull_request:
branches: [ master ]
branches: [ master, development ]

jobs:
Pyccel-Linter:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Spellcheck Action
on:
pull_request:
branches: [ master ]
branches: [ master, development ]

jobs:
Spelling:
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include README.md
recursive-include pyccel *.tx
recursive-include pyccel *.pyh
recursive-include pyccel *.c
recursive-include pyccel *.cu
recursive-include pyccel *.f90
recursive-include pyccel *.h
recursive-include pyccel *.pyccel
Expand Down
7 changes: 7 additions & 0 deletions pyccel/ast/class_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@

#=======================================================================================

CudaArrayClass = ClassDef('cuda.ndarray',
methods=[
FunctionDef('shape',[],[],body=[],
decorators={'property':'property', 'numpy_wrapper':Shape})])

#=======================================================================================

literal_classes = {
NativeBool() : BooleanClass,
NativeInteger() : IntegerClass,
Expand Down
Loading