Code Monkey home page Code Monkey logo

Comments (10)

inducer avatar inducer commented on August 17, 2024

Which implementation are you using? Have you tried others?

from pyopencl.

cancan101 avatar cancan101 commented on August 17, 2024

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.

cancan101 avatar cancan101 commented on August 17, 2024

These seem relevant but they don't provide answers:

from pyopencl.

inducer avatar inducer commented on August 17, 2024

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.

cancan101 avatar cancan101 commented on August 17, 2024

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.

cancan101 avatar cancan101 commented on August 17, 2024

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.

cancan101 avatar cancan101 commented on August 17, 2024

@inducer Did you have a chance to test this out?

from pyopencl.

inducer avatar inducer commented on August 17, 2024

Appears to work as documented for me, with a few fixes to your code.

https://gist.github.com/inducer/c83d58aa1ea3640b16ee

from pyopencl.

cancan101 avatar cancan101 commented on August 17, 2024

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.

inducer avatar inducer commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.