From the Python side, we expect a 2D Numpy array containing the image data. For the cuFFT we need a 1D C array. After reconstructing the image, matplot expects a 2D Numpy array again.
The test is to check if we can correctly convert the 2D Numpy array into a 1D C array, send it to the GPU and back, and generate a 2D Numpy array from it again. Since we are working with pure C pointers, we need to make sure that the data has the right structure. For example, numpy could introduce padding into the 2D numpy array.
def test_binding_input_output():
input = imageio.imread('b.png', as_gray=True)
output = binding(input) # CUDA C++ code
# attention, I'm not sure, if numpy array do a element wise comparison
assert input == output
From the Python side, we expect a 2D Numpy array containing the image data. For the cuFFT we need a 1D C array. After reconstructing the image, matplot expects a 2D Numpy array again. The test is to check if we can correctly convert the 2D Numpy array into a 1D C array, send it to the GPU and back, and generate a 2D Numpy array from it again. Since we are working with pure C pointers, we need to make sure that the data has the right structure. For example, numpy could introduce padding into the 2D numpy array.
To write the test, I would suggest pytest.
Possible pseudo test implementation