-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix allocation mishandling in CUDA array creation #1328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me. I assume there are already tests which test this part of the code? Do you have any idea what additional test might have caught this earlier (e.g. we use valgrind for ndarrays, I don't know if that is possible for cuda)?
Please can you expand the PR description to explain the changes that you made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should start populating a new test file that can run locally for now so we do not have the same problem of run time errors that slips by between commits.
can you create a file that does the same as what in the file below just for the array creation tests.
https://github.com/pyccel/pyccel/blob/master/tests/ndarrays/test_ndarrays.c
There were no tests that covered this part of the code previously. I believe the tests I've added now ensure that the changes I made do not introduce any new bugs. |
@framdani The tests look good, but I think you are missing something so that they are compiled and run in the CI. Ie. the equivalent of this file: https://github.com/pyccel/pyccel/blob/master/tests/ndarrays/conftest.py and/or this file : https://github.com/pyccel/pyccel/blob/cuda_devel/.github/actions/valgrind_run/action.yml |
@EmilyBourne you're right , the tests I added were intended to be run locally for now. I'll do some research and ensure that the necessary configuration are added so that they can run in the CI. |
@framdani Ok. No need to reinvent the wheel, I think it should be as simple as copying this file into your folder : https://github.com/pyccel/pyccel/blob/master/tests/ndarrays/conftest.py and:
|
that should work but we should ignore them in GitHub action for now as we can not run them. |
Oh yes! I keep forgetting that we still can't run these tests. In that case I wonder if it's possible to split it into 2 tests?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there was some confusion when fixing the collisions. Please can you fix this
Fixes pyccel-cuda#2 ? |
This PR fixes a bug where the allocation of the CUDA array was not being properly handled. Fixes pyccel-cuda#2.
Changes Made: