OpenCL interoperability does not work on 64-bit OS
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Die betroffenen Einstiegspunkte befinden sich in arrayfire/opencl.py ungefähr bei den Zeilen 88 und 156 sowie bei den anderen c_int_t-Verwendungen in dieser Datei. Lies zuerst diese ctypes-Deklarationen und stelle dann das 64-bit-Windows-OpenCL/PyOpenCL-Setup nach; abgeschlossen ist die Arbeit, wenn Geräte-IDs sowie gemeinsam verwendete Geräte-, Kontext- und Queue-Werte nicht mehr überlaufen und die Interoperabilität funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 422
- Forks
- 63
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus arrayfire/arrayfire-python
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
arrayfire/arrayfire-python#271 ·
-
Unwrap phase function Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
arrayfire/arrayfire-python#270 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
arrayfire/arrayfire-python#269 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
arrayfire/arrayfire-python#268 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
arrayfire/arrayfire-python#267 · 1 Kommentar · 1 Reaktion ·
Alle Issues in arrayfire/arrayfire-python
Ähnliche Issues
-
Add: hunch Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
DiamondLightSource/dodal#2211 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
openml/openml-python#1749 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
sipyourdrink-ltd/bernstein#6191 ·