Skip to content

gpuarray copy, strides are discarded #154

Closed
@mrader1248

Description

@mrader1248

The method copy of GPUArray behaves like the strides of the associated object were in C-order. However, if I set the strides explicitly afterwards, everything is fine. For details see the code snippet below.

import pycuda.autoinit
import pycuda.gpuarray as gpuarray
import numpy as np

a = np.arange(4.).reshape(2, 2, order="F")
print a
print a.strides

a_gpu = gpuarray.to_gpu(a)
print a_gpu
print a_gpu.strides

a_gpu_cp = a_gpu.copy()
print a_gpu_cp
print a_gpu_cp.strides

a_gpu_cp.strides = a_gpu.strides
print a_gpu_cp
print a_gpu_cp.strides

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions