Error in assignment to multidimensional arrays
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start at the [] indexing and assignment entry points in the .NET wrapper, then reproduce the supplied A1D, A2D, and A3D examples on both CPU and OpenCL backends. Trace whether single-index writes to multidimensional arrays are handled by the wrapper or ArrayFire implementation; done means the documented assignment cases behave consistently across both backends.
Written by the indexing model from the issue text.
Description
There's a problem with [] (indexing) operator. Indexing with with one number can be used to read value from the entire table, but it cannot be used to write to multidimensional table. While indexing with 2 or more numbers you can write to any table.
I am not sure, if it is the consequence of C implementation or problem with the wrapper, but this behavior is very unintuitive.
Checked on CPU and OpenCL Backend.
I'll try to fix it on my own
There's an example of the problem
ArrayFire.Array A1D = Data.CreateArray(new int[] { 1, 2, 4 });
A1D[1] = Data.CreateArray(new int[] { 100 });
Util.Print(A1D, "A1");
A2D[0, 0] = Data.CreateArray(new int[] { 11 });
A2D[1] = Data.CreateArray(new int[] { 100 });
Util.Print(A2D, "A");
A3D[1,1,1] = Data.CreateArray(new int[] { 100 });
A3D[0, 1] = Data.CreateArray(new int[] { 100 });
A3D[0] = Data.CreateArray(new int[] { 100 });
Util.Print(A3D[1,1], "A3D");
Generates the output
A1D
[3 1 1 1]
1
100
4
A2D
[3 3 1 1]
100 -1 4
2 2 2
4 0 3
A3D
[2 2 2 1]
1 100
2 -1
2 4
0 100
- Dominant language
- C#
- Stars
- 76
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arrayfire/arrayfire-dotnet
-
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
Error in ar_topk Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
af_index_t Openquestion
Difficulty 5/5 Over a week Newbie friendliness 20/100
arrayfire/arrayfire-dotnet#31 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
arrayfire/arrayfire-dotnet#29 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
arrayfire/arrayfire-dotnet#25 · 5 comments ·
All issues in arrayfire/arrayfire-dotnet
Similar issues
-
Status: Waiting triage Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nanoframework/Home#1857 ·
-
kind/bug kind/regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno.toolkit.ui#1646 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#1379 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
elastic/esql-dotnet#47 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100