OpenCL interoperability does not work on 64-bit OS
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Các entry point bị ảnh hưởng nằm trong arrayfire/opencl.py, xung quanh dòng 88 và 156, cùng với các chỗ sử dụng c_int_t khác trong tệp đó. Trước tiên hãy đọc các khai báo ctypes này, sau đó tái hiện thiết lập OpenCL/PyOpenCL trên Windows 64-bit; hoàn tất khi các ID thiết bị và các giá trị dùng chung của thiết bị, context và queue không còn bị overflow, đồng thời khả năng tương tác hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 422
- Fork
- 63
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của arrayfire/arrayfire-python
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
arrayfire/arrayfire-python#271 ·
-
Unwrap phase function Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
arrayfire/arrayfire-python#270 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
arrayfire/arrayfire-python#269 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
arrayfire/arrayfire-python#268 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
arrayfire/arrayfire-python#267 · 1 bình luận · 1 reaction ·
Tất cả issue của arrayfire/arrayfire-python
Issue tương tự
-
Add: hunch Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DiamondLightSource/dodal#2211 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openml/openml-python#1749 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sipyourdrink-ltd/bernstein#6191 ·