OpenCL interoperability does not work on 64-bit OS
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Los puntos de entrada afectados están en arrayfire/opencl.py alrededor de las líneas 88 y 156, además de los otros usos de c_int_t en ese archivo. Lee primero esas declaraciones de ctypes y luego reproduce la configuración de OpenCL/PyOpenCL en Windows de 64 bits; se considera terminado cuando los ID de dispositivo y los valores compartidos de dispositivo, contexto y cola ya no se desbordan y la interoperabilidad funciona.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Currently the OpenCL interoperability does not work on 64-bit Windows machine. The reason for this is the use of c_int_t which defaults to long on Windows (which on the other hand is 32-bit). This can be problematic with things like device IDs as they can easily go over 2^32/2-1. For example https://github.com/arrayfire/arrayfire-python/blob/master/arrayfire/opencl.py#L88 uses c_int_t, as well as a few other functions in the same file. This can be fixed by replacing the c_int_t with, for example, c_void_ptr_t as it is used with the context. Is there by the way some specific reason why context is treated differently?
There is also another issue. When the context is created by PyOpenCL, the input device, context and queue values are input as python ints in order to use the same context and queue, but on Windows you get <class 'OverflowError'>: int too long to convert errors then. These can be avoided by casting them to, for example, c_int64-types. For example in https://github.com/arrayfire/arrayfire-python/blob/master/arrayfire/opencl.py#L156, replace safe_call(backend.get().afcl_add_device_context(dev, ctx, que)) with safe_call(backend.get().afcl_add_device_context(ct.c_int64(dev), ct.c_int64(ctx), ct.c_int64(que))) (using c_void_p seems to work too).
I haven't tested these changes extensively, but they do seem to get things working on 64-bit Windows. I can provide a PR if needed.
- Lenguaje dominante
- Python
- Estrellas
- 422
- Forks
- 63
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de arrayfire/arrayfire-python
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
arrayfire/arrayfire-python#271 ·
-
Unwrap phase function Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
arrayfire/arrayfire-python#270 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
arrayfire/arrayfire-python#269 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
arrayfire/arrayfire-python#268 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
arrayfire/arrayfire-python#267 · 1 comentario · 1 reacción ·
Todos los issues de arrayfire/arrayfire-python
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
learningequality/ricecooker#747 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
run-llama/llama_index#23199 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
KhronosGroup/glTF-Blender-IO#2769 ·