Giter Site home page Giter Site logo

Comments (6)

sbacchio avatar sbacchio commented on August 24, 2024

So yes, I cannot make so much sense of these outputs and I cannot say if some of them are expected and/or are known to not be working like for int***.
Would be great if you can have a look when you have some time!

from cppyy.

wlav avatar wlav commented on August 24, 2024

The assignments and passing should work fine per se (I have a whole set of tests that do just that, up to 3D, see here: https://github.com/wlav/cppyy/blob/master/test/test_lowlevel.py#L506). The problem appears wholly with bar = ll.malloc[dtype](4), as for the first twobar thinks it's an integer array and for the last one a long array (hence the type mismatch; the long most obviously b/c it represents the pointer).

Must be something obvious missing as the generated malloc funcs aren't any different than the ones I use in the test ...

from cppyy.

wlav avatar wlav commented on August 24, 2024

The problem is the reshaping. For the result to know that it is of length 4, the ll.malloc call fixes up the size after the fact, by reshaping to (4,). And that turns each multi-dim array into a 1D array. That's an easy fix, at least for the int** case, which seems to have the proper shape before the reshaping (is in repo; change is in ll.py, so easy to apply locally). The int*** case, however, does not. Still digging for that one.

from cppyy.

wlav avatar wlav commented on August 24, 2024

Okay, done. I had to refactor the executors same way as the converters to support any-dimensional pointer returns.

from cppyy.

sbacchio avatar sbacchio commented on August 24, 2024

Wow that was super efficient! Thanks a lot!
So yes, in my case I wasn't using ll.malloc, but I was doing the same mistake with the reshaping.

from cppyy.

wlav avatar wlav commented on August 24, 2024

Released with cppyy 2.2.0 and its dependencies.

from cppyy.

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.