Skip to content

lazy copy bug with af::write<T> #2431

Description

@WilliamTambellini

Hi, using AF master, afcuda backend via af unified :

af::array left(0,0);
af::array right(2,1,2);
std::vector<float> d = { 1,1,2,2 };
right.write<float>(&d[0], sizeof(float) * 2 * 2);
left = right;
af_print(left);
d = { 10,10,20,20 };
right.write<float>(&d[0], sizeof(float) * 2 * 2);
af_print(left);

output:
left
[2 1 2 1]
1.0000
1.0000
2.0000
2.0000

left
[2 1 2 1]
10.0000
10.0000
20.0000
20.0000

I would expect left to keep the original values.
Is it the expected behavior ?

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions