NumPower / numpower

PHP extension for efficient scientific computing and array manipulation with GPU support
https://numpower.org
Other
185 stars 4 forks source link

GD Image loading and save fix, GPU allocation improvement and GPU slicing fixes #34

Closed henrique-borba closed 1 year ago

henrique-borba commented 1 year ago

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

fix: Missing pixel values when opening a GD image fix: Missing pixel values when saving a GD image

When using AVX2 hardware, converted GD images to NDArray were missing some pixels values because both NDArray_ToGD and NDArray_FromGD were not handling the remainings of the AVX operation.

fix: Remove unnecessary CUDA device sync from gpu_alloc

There is no need to resynchronize the CUDA device for every operation, this was also causing the cuBLAS calls to hang.

fix: Fix column strides when slicing NDArrays stored on GPU

Slicing with GPU was broken, this fix the behaviour.

fix: Prevent memory leak when NDArray_Slice fails with too many indices

When NDArray_Slice failed, the preallocated variables were not freed properly.