Git Product home page Git Product logo

Comments (1)

matthewturk avatar matthewturk commented on September 21, 2024

Thanks for reporting this! I think this is likely due to the way we set up padding in these arrays. Internally, we have the GridTreeNode objects, and then in the grid arrays we expose them as GridTreePadded:

cdef struct GridTreeNode:
    np.int32_t num_children
    np.int32_t level
    np.int64_t index
    np.float64_t left_edge[3]
    np.float64_t right_edge[3]
    GridTreeNode **children
    np.int64_t start_index[3]
    np.int32_t dims[3]
    np.float64_t dds[3]

cdef struct GridTreeNodePadded:
    np.int32_t num_children
    np.int32_t level
    np.int64_t index
    np.float64_t left_edge_x
    np.float64_t left_edge_y
    np.float64_t left_edge_z
    np.float64_t right_edge_x
    np.float64_t right_edge_y
    np.float64_t right_edge_z
    np.int_t children_pointers
    np.int64_t start_index_x
    np.int64_t start_index_y
    np.int64_t start_index_z
    np.int32_t dims_x
    np.int32_t dims_y
    np.int32_t dims_z
    np.float64_t dds_x
    np.float64_t dds_y
    np.float64_t dds_z

So I would guess either the np.int is wrong for the pointer values (and that would need to be fixed somehow to get it to work via numpy) or there's an alignment issue that I didn't take into account.

One possible solution -- which would break ABI but that's not so bad -- would be to move the children pointers to the end of the struct, and then remove them from the numpy array views. There we'd need to make sure our strides were still correct in the view.

from yt.

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.