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
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 functionAbierto
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
-
Status: Triage Suggestion
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
Los mantenedores suelen responder en 1 día
-
changelog investigate
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
ramnes/notion-sdk-py#522 ·
-
top `--file` with a non-UTF-8 CSV gives a raw codec error and "Check the arguments."Posiblemente ocupada @Beehtrix la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
laaielichter/Gulliver#263 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
LearningCircuit/local-deep-research#10161 ·
Los mantenedores suelen responder en 1 día