Comments (10)
Which implementation are you using? Have you tried others?
from pyopencl.
I tried on Apple with Iris Pro and Nvidia and on Windows with HD Graphics. I get the same results so I assume that It is no drivers or hardware.
from pyopencl.
These seem relevant but they don't provide answers:
- http://stackoverflow.com/questions/20017990/opencl-image3d-linear-sampling
- http://stackoverflow.com/questions/20027292/precision-when-reading-image-with-clk-filter-linear-in-opencl
from pyopencl.
Have you tried a CPU implemnetation? How is the accuracy there? Alternatively, post a full working script, and i'd be happy to try on a few machines.
from pyopencl.
http://nbviewer.ipython.org/gist/cancan101/654c070ef7b4bf34aac1
I changed the offset so it goes 0,1,2 rather than 10,11,12 but the issue is the same,
from pyopencl.
Not a perfect test of CPU, but:
In [57]:
a = (0.5+0.1*np.arange(10, dtype=np.float32))-0.5
In [52]:
a[1] * test[1]
Out[52]:
1.0000002
from pyopencl.
@inducer Did you have a chance to test this out?
from pyopencl.
Appears to work as documented for me, with a few fixes to your code.
https://gist.github.com/inducer/c83d58aa1ea3640b16ee
from pyopencl.
Interesting. When I run the same script, I get the following output in the last cell:
[ 0. 0.1 0.2 0.30000001 0.40000001 0.5
0.60000002 0.69999999 0.80000001 0.90000004]
[ 0. 0.1015625 0.19921875 0.30078125 0.3984375 0.5
0.6015625 0.69921875 0.80078125 0.8984375 ]
from pyopencl.
As far as I know, image sampling does not come with any particular accuracy guarantees. ("Visual accuracy"?) In CUDA, it appears you get about two digits, which is about what you're seeing: https://stackoverflow.com/questions/14460514/accuracy-of-1d-linear-interpolation-by-cuda-texture-interpolation?rq=1
from pyopencl.
Related Issues (20)
- test_clmath.py::test_fmod fails on i386 using pocl 3.1 built with llvm 15 HOT 2
- Disable kernel caching from within pyopencl code HOT 1
- Expose create_buffer_gc in a header HOT 4
- Binary operations with Arrays of different memory layout HOT 2
- Windows Intel CL Github CI fails HOT 2
- Fails to build with OpenCL 3.0 headers HOT 3
- UHD Graphics 600 | Calling kernel + enqueue_copy more than once, results in OUT_OF_RESOURCES error or freeze HOT 4
- Compatibility with `numpy2` HOT 3
- move away from deprecated appdirs
- `build program` times increasing with rank count on Mac when caching is enabled HOT 7
- Pocl Mac crashing again HOT 4
- `CMakeLists.txt` file missing in PyPI source dist HOT 2
- `pip install .` causes messy directory layout HOT 3
- Non-empty compiler output HOT 9
- Nanobind leak warnings HOT 9
- Kernel evaluation throws exception for SVM objects HOT 1
- pyopencl.compyte missing in pyopencl-2024.2.4.tar.gz HOT 3
- 2024.2.5 is Broken HOT 5
- Wheels built with numpy2 HOT 3
- Invoker cache created and written to even when PYOPENCL_NO_CACHE=1 HOT 2
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 pyopencl.