Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enoki::packet() does not work with Matrix<DynamicArray, 1> #92

Open
anadodik opened this issue Jun 4, 2020 · 0 comments
Open

enoki::packet() does not work with Matrix<DynamicArray, 1> #92

anadodik opened this issue Jun 4, 2020 · 0 comments

Comments

@anadodik
Copy link

anadodik commented Jun 4, 2020

Code necessary for reproducing the bug:

#include <enoki/array.h>
#include <enoki/matrix.h>
#include <enoki/dynamic.h>

int main() {
    using Packet = enoki::Packet<float, 4>;
    using Value = enoki::DynamicArray<Packet>;
    using Matrix1 = enoki::Matrix<Value, 1>;
    using Matrix2 = enoki::Matrix<Value, 2>;

    auto matrix1 = enoki::zero<Matrix1>(2);
    auto matrix2 = enoki::zero<Matrix2>(2);

    enoki::packet(matrix1, 0) = 1;
    enoki::packet(matrix2, 0) = 1;

    std::cout << "matrix1=\n" << matrix1 << "\n";
    std::cout << "matrix2=\n" << matrix2 << "\n";

    return 0;
}

This produces the following output:

matrix1=
[[[0]],
 [[0]]]
matrix2=
[[[1, 1],
  [1, 1]],
 [[1, 1],
  [1, 1]]]

As you can see, matrix2 works fine, while matrix1 never gets assigned the value 1. This seems to be a bug to me as I don't see a reason why Enoki should not generalize to 1x1 matrices.

I tried debugging the issue myself, but wasn't able to find the cause. Please let me know if there is any way I can help to get this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant