Comments (7)
Hi,
Thanks for the bug report, surprising that no one else reported this before.
I am currently in vacation, only equipped with an tablet, so I have to
guess. In line 14 of gpyfft.pyx try to change the typedef of voidptr from
long int to long long.
Rationale: on Windows a long int is only 32 bit, not enough to hold a
pointer.
Hope that helps
Gregor
Shaylin Chetty [email protected] schrieb am Fr., 19. Aug. 2016 um
16:18:
Hello,
I'm using Visual Studio 2015, Python 3.5(Anaconda) and Windows 10 (64-bit).
gpyfft seems to build and install correctly but running simple_test.py
reveals some errors.This is the output upon running gpyfft.test.run():
ERROR: test_simple (gpyfft.test.test_simple.TestSimple)
Traceback (most recent call last):
File
"C:\Anaconda3\lib\site-packages\gpyfft-0.2.2-py3.5-win-amd64.egg\gpyfft\test\test_simple.py",
line 28, in test_simple
self.simple(ctx)
File
"C:\Anaconda3\lib\site-packages\gpyfft-0.2.2-py3.5-win-amd64.egg\gpyfft\test\test_simple.py",
line 46, in simple
plan = self.G.create_plan(context, cl_data.shape)
File "gpyfft\gpyfftlib.pyx", line 117, in
gpyfft.gpyfftlib.GpyFFT.create_plan (gpyfft\gpyfftlib.c:2441)
File "gpyfft\gpyfftlib.pyx", line 186, in gpyfft.gpyfftlib.Plan.init
(gpyfft\gpyfftlib.c:2751)
OverflowError: Python int too large to convert to C longAny assistance would be greatly appreciated.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#24, or mute the thread
https://github.com/notifications/unsubscribe-auth/AA7Gs3on2oBB72hrvJ9AI0UT6pmVcq_Qks5qhbs7gaJpZM4JohG6
.
from gpyfft.
Hello,
Thanks so much for responding .
I must apologize for something I didn't spot earlier. There were warnings generated when I ran "python setup.py build". I don't want to make this post too large so I'll only include the section of the build log which shows the warnings:
gpyfft\gpyfftlib.c(2753): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_context' of greater size
gpyfft\gpyfftlib.c(5428): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
gpyfft\gpyfftlib.c(5497): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_command_queue' of greater size
gpyfft\gpyfftlib.c(5935): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(6332): warning C4311: 'type cast': pointer truncation from 'cl_event' to 'long'
gpyfft\gpyfftlib.c(6622): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_command_queue' of greater size
gpyfft\gpyfftlib.c(6782): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_event' of greater size
gpyfft\gpyfftlib.c(6965): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(7159): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(7243): warning C4312: 'type cast': conversion from '__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(7270): warning C4244: 'function': conversion from 'Py_ssize_t' to 'cl_uint', possible loss of data
I've also changed the line of code you suggested. This seems to have changed things. The warnings I receive when building are now reduced to :
gpyfft\gpyfftlib.c(5431): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
gpyfft\gpyfftlib.c(6335): warning C4311: 'type cast': pointer truncation from 'cl_event' to 'long'
gpyfft\gpyfftlib.c(7273): warning C4244: 'function': conversion from 'Py_ssize_t' to 'cl_uint', possible loss of data
When I run gpyfft.test.run() this time, the program crashes with the windows message "Python has stopped working".
from gpyfft.
Hi,
Thanks, reporting the warnings is helpful to track down the problem.
Again just guessing: changing line 14 fixed one bug, but there are more to
locate. Next, try changing in line 598 the explicit cast from to <
long long>. This should make the second remaining warning go away. The
first and last warning I cannot assign. Please look up in gpyfftlib.c to
which source line of gpyfftlib.c.pyx the warnings belong.
Gregor
Shaylin Chetty [email protected] schrieb am So., 21. Aug. 2016 um
21:15:
Hello,
Thanks so much for responding .I must apologize for something I didn't spot earlier. There were warnings
generated when I ran "python setup.py build". I don't want to make this
post too large so I'll only include the section of the build log which
shows the warnings:gpyfft\gpyfftlib.c(2753): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_context' of greater size
gpyfft\gpyfftlib.c(5428): warning C4244: '=': conversion from 'Py_ssize_t'
to 'int', possible loss of data
gpyfft\gpyfftlib.c(5497): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_command_queue' of greater size
gpyfft\gpyfftlib.c(5935): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(6332): warning C4311: 'type cast': pointer truncation
from 'cl_event' to 'long'
gpyfft\gpyfftlib.c(6622): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_command_queue' of greater size
gpyfft\gpyfftlib.c(6782): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_event' of greater size
gpyfft\gpyfftlib.c(6965): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(7159): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(7243): warning C4312: 'type cast': conversion from
'__pyx_t_6gpyfft_9gpyfftlib_voidptr_t' to 'cl_mem' of greater size
gpyfft\gpyfftlib.c(7270): warning C4244: 'function': conversion from
'Py_ssize_t' to 'cl_uint', possible loss of dataI've also changed the line of code you suggested. This seems to have
changed things. The warnings I receive when building are now reduced to :gpyfft\gpyfftlib.c(5431): warning C4244: '=': conversion from 'Py_ssize_t'
to 'int', possible loss of data
gpyfft\gpyfftlib.c(6335): warning C4311: 'type cast': pointer truncation
from 'cl_event' to 'long'
gpyfft\gpyfftlib.c(7273): warning C4244: 'function': conversion from
'Py_ssize_t' to 'cl_uint', possible loss of dataWhen I run gpyfft.test.run() this time, the program crashes with the
windows message "Python has stopped working".—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#24 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7Gs10EtjqbN8qohPfxt6_Z_1pf-jZUks5qiKPWgaJpZM4JohG6
.
from gpyfft.
Hello,
So after changing line 598, the only two build warnings remaining are :
gpyfft\gpyfftlib.c(5434): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
gpyfft\gpyfftlib.c(7276): warning C4244: 'function': conversion from 'Py_ssize_t' to 'cl_uint', possible loss of data
When running gpyfft.test.run(), this is the output:
ERROR: test_callback (gpyfft.test.test_callback.TestCallback)
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\gpyfft-0.2.2-py3.5-win-amd64.egg\gpyfft\test\test_callback.py", line 41, in test_callback
self.simple(ctx)
File "C:\Anaconda3\lib\site-packages\gpyfft-0.2.2-py3.5-win-amd64.egg\gpyfft\test\test_callback.py", line 91, in simple
user_data=user_data_device.data)
File "gpyfft\gpyfftlib.pyx", line 472, in gpyfft.gpyfftlib.Plan.set_callback (gpyfft\gpyfftlib.c:5979)
TypeError: expected bytes, str found
I'm not sure if any of this will help, but I'll look up the lines of code that these warnings correspond to as you suggested.
from gpyfft.
Hi,
Am I right this are good news that gpyfft now essentially works for your
configuration?
The remaining test failure should be easy to fix, set callback requires
bytes, not string arguments. This is even documented ;-) Can you try to
decorate the string literals in test_callback that end up as arguments as
bytes, i.e. b'some string'
Have fun
Gregor
Shaylin Chetty [email protected] schrieb am Mo., 22. Aug. 2016 um
17:13:
Hello,
So after changing line 598, the only two build warnings remaining are :
gpyfft\gpyfftlib.c(5434): warning C4244: '=': conversion from 'Py_ssize_t'
to 'int', possible loss of data
gpyfft\gpyfftlib.c(7276): warning C4244: 'function': conversion from
'Py_ssize_t' to 'cl_uint', possible loss of dataWhen running gpyfft.test.run(), this is the output:
ERROR: test_callback (gpyfft.test.test_callback.TestCallback)
Traceback (most recent call last):
File
"C:\Anaconda3\lib\site-packages\gpyfft-0.2.2-py3.5-win-amd64.egg\gpyfft\test\test_callback.py",
line 41, in test_callback
self.simple(ctx)
File
"C:\Anaconda3\lib\site-packages\gpyfft-0.2.2-py3.5-win-amd64.egg\gpyfft\test\test_callback.py",
line 91, in simple
user_data=user_data_device.data)
File "gpyfft\gpyfftlib.pyx", line 472, in
gpyfft.gpyfftlib.Plan.set_callback (gpyfft\gpyfftlib.c:5979)
TypeError: expected bytes, str foundI'm not sure if any of this will help, but I'll look up the lines of code
that these warnings correspond to as you suggested.—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#24 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7Gs5d-2YNtrp-kTrtXSMzpwW4GQqqlks5qibyogaJpZM4JohG6
.
from gpyfft.
Hello,
You were right about it being an easy fix.
In line 89 of test_callback.py:
I changed
plan.set_callback('mulval', self.callback_kernel,'pre',
to
plan.set_callback(b'mulval', self.callback_kernel.encode('utf-8'),'pre',
It was the first two arguments that needed to be bytes instead of strings.
And now everything is working correctly.
Thanks for all your help.
from gpyfft.
Closing issue, changes have been applied.
from gpyfft.
Related Issues (20)
- No examples in documentation HOT 9
- gpyfft working on macOS 10.11.6, but not for CPU HOT 3
- simple_example.py broken HOT 16
- Cython errors in setup.py on Ubuntu HOT 7
- License file HOT 2
- [debian] test error during the build process HOT 7
- [doc] errors during the sphinx doc generation HOT 2
- could you integrate the benchmark in the gpyfft module HOT 1
- Installation when clFFT has been installed using conda ? HOT 14
- Batched FFT buggy
- Real->complex and complex->real HOT 3
- PyPI HOT 2
- Benchmark fails to run on ARM Mali platform HOT 1
- ImportError: DLL load failed HOT 15
- When rinning simple_example.py - OverflowError: can't convert negative value to size_t HOT 3
- Cannot open include file: 'clFFT.h' HOT 1
- How to install this package on Windows? HOT 1
- callback argument for the FFT class HOT 5
- Complains about _clfftBakePlan not found when importing HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpyfft.