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

Add Python code to spoof a host_empty function #56

Open
EmilyBourne opened this issue Jun 13, 2024 · 0 comments · May be fixed by #67
Open

Add Python code to spoof a host_empty function #56

EmilyBourne opened this issue Jun 13, 2024 · 0 comments · May be fixed by #67
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@EmilyBourne
Copy link
Member

Relevant Discussion

#55 and discussion in the meeting on 13/6/2024

Describe the feature

I would like to be able to explicitly allocate memory on the CPU. In order to support this in pyccel-cuda we will create spoof functions which ensure that the code that the user writes runs correctly in Python

Test Code

Provide code which does not currently work but which should do when this issue is fixed:

import pyccel.cuda as cuda

if __name__ == '__main__':
     n = 100
     a = cuda.host_empty(n)
     for i in range(n):
        a[i] = i
     print(a)

Proposed Solution

A function host_empty should be created in pyccel.cuda.array_allocation. It should be possible to import this function using the syntax import pyccel.cuda as cuda. The function should work like numpy.empty. For this issue it is not necessary for the translation to work

@EmilyBourne EmilyBourne added the enhancement New feature or request label Jun 13, 2024
@EmilyBourne EmilyBourne added the good first issue Good for newcomers label Jun 13, 2024
@smazouz42 smazouz42 linked a pull request Jul 19, 2024 that will close this issue
@smazouz42 smazouz42 linked a pull request Jul 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants