Giter Club home page Giter Club logo

Comments (10)

inducer avatar inducer commented on July 28, 2024

I'm not sure. For arithmetic, I think requiring thawing makes sense. For call_loopy, the array context is supplied (as the self argument to call_loopy), so it's less clear that it's needed.

from meshmode.

inducer avatar inducer commented on July 28, 2024

For the PyOpenCL array context, passing an un-thawed array is hypothetically fine: It's a constant array that doesn't have a queue.

For the lazy array context, we could define passing an un-thawed array as implicitly producing a DataWrapper, with similar semantics.

from meshmode.

inducer avatar inducer commented on July 28, 2024

@kaushikcfd, what do you think?

from meshmode.

kaushikcfd avatar kaushikcfd commented on July 28, 2024

Agree with the proposal that frozen read-only array inputs should be thawed inside call_loopy. It doesn't introduce any performance hits and provides a more convenient interface.

from meshmode.

inducer avatar inducer commented on July 28, 2024

frozen read-only array inputs should be thawed inside call_loopy

What is "thawing" to you anyway, in this instance? (Remember we're trying to define semantics here IMO: It's not a given what that means.) To me: thawing in CL means "add a queue", thawing in lazy means... hm... stick in a DataWrapper. Maybe thaw is what I wanted anyay. :)

from meshmode.

kaushikcfd avatar kaushikcfd commented on July 28, 2024

I thought the semantics for "thaw"-ing lazy arrays was already defined in #104. The same can be transmitted to the thawing in the context of call_loopy, which I believe is reasonable.

from meshmode.

inducer avatar inducer commented on July 28, 2024

Fair.

I guess the main question then is whether we'll require the user to explicitly thaw, or whether we'll implicitly do what's necessary in call_loopy. FWIW, IMO if we do anything implicitly, we should only do so for read-only arrays.

Upside of implicit treatment:

  • Convenience

Downside of implicit treatment:

  • We may wind up with a few separate DataWrappers for the same data. (that are, however, pretty straightforward to clean up)

from meshmode.

kaushikcfd avatar kaushikcfd commented on July 28, 2024

I vote for the implicit treatment. I think the benefits of a cleaner interface outweigh the downsides of a polluted pt.Namespace().

from meshmode.

inducer avatar inducer commented on July 28, 2024

OK, implicit is good by me. Ready to close?

from meshmode.

kaushikcfd avatar kaushikcfd commented on July 28, 2024

Yep, resolved from my end too.

from meshmode.

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.