Add Python translation support for pyccel.cuda.host_empty
and pyccel.cuda.device_empty
#58
Labels
pyccel.cuda.host_empty
and pyccel.cuda.device_empty
#58
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 or GPU. After #56 and #57 the Python code that describes this should be working. In this issue we want to add syntactic/semantic. In order to test this we will ensure that we can translate from Python to Python.
Test Code
Provide code which does not currently work but which should do when this issue is fixed:
Proposed Solution
A class
PyccelCudaEmpty
should be created inpyccel.ast.cudaext
. It should describe the objectscuda.host_empty
andcuda.device_empty
. The implementation of this type is left to the developer. It will either be similar toNumpyEmpty
or may be able to inherit fromNumpyEmpty
.A
Module
should be created to describepyccel.cuda
and should maphost_empty
anddevice_empty
to this class or to subclasses (subclasses may be useful to ensure the correct prototype).The class type of
a
andb
will need to be defined. This should be done in a filepyccel.ast.cudatypes
. The new type must satisfy the following criteria:ContainerType
The
__add__
and__and__
operators should ensure that it is not possible to mix CPU and GPU memory in the same operation (e.g. not possible to dodevice_array[i] + host_array[i]
)Additional Information
This issue is blocked by #56 and #57
The text was updated successfully, but these errors were encountered: