arrayfire / arrayfire/arrayfire-dotnet

Error in assignment to multidimensional arrays

Abierto
#27 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C#
Estrellas
76
Forks
19
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
api, backend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.