GithubHelp home page GithubHelp logo

Comments (3)

Guillaume-Helbecque avatar Guillaume-Helbecque commented on June 16, 2024 1

Hello, I'm not a Chapel expert but I think I could help you to workaround this issue.

In my understanding, dot calls the private _matmatMult method, itself calling hasNonStridedIndices(Adom). The compiler error you get is due to a mismatch in hasNonStridedIndices argument (Adom). It must be a domain(2), but matA[1, .., ..].domain.type is an ArrayViewRankChangeDom (due to an internal conversion I guess).

One workaround that could help you is to use temporary variables/constants and explicitly specify their domain (otherwise it is assigned to ArrayViewRankChangeDom also):

use LinearAlgebra;

var matA : [1..3, 1..3, 1..3] real;
var matB : [1..3, 1..3, 1..3] real;

const matC : [1..3, 1..3] real = matA[1, .., ..];
const matD : [1..3, 1..3] real = matB[1, .., ..];

writeln(dot(matC, matD));

Note for potential fix: One solution could be to check the type of Adom in hasNonStridedIndices, and if not domain(2), perform the explicit cast ArrayViewRankChangeDom:domain(2).

from chapel.

bradcray avatar bradcray commented on June 16, 2024

@redhatturtle : Thanks for filing this, and sorry for the lack of responses from the Chapel dev team until now. We were working on getting 1.32 release notes out the door and fell behind on user issues a bit as a result. And thanks to @Guillaume-Helbecque for helping out while we were distracted.

I've got a modest fix to the hasNonStridedIndices() utility being used in this code path to make it rank-neutral, which seems as though it gets the cases in the OP working as expected, and I believe should enable other cases as well (such as multiplying rank-preserving slice operations). I do need to do more testing on it still before merging, but if you want to give it a look and see whether it works for you, I'd be curious for any feedback: #23737

from chapel.

bradcray avatar bradcray commented on June 16, 2024

@redhatturtle : Just noting that this has now been merged. Thanks again for reporting it, and please let me know if it does not resolve the original problem in your own code (rather than just this reproducer).

from chapel.

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.