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

Regent: Unable to assign ispace to declaration of variable type ispace #785

Open
syamajala opened this issue Mar 26, 2020 · 1 comment
Open
Assignees
Labels
backlog Feature/fix that is desirable, but not currently planned enhancement Regent Issues pertaining to Regent S3D

Comments

@syamajala
Copy link
Contributor

import "regent"
local c = regentlib.c

task main()
  var colors : ispace(int3d)
  var dim = 0

  if dim == 0 then
    colors = ispace(int3d, int3d{2, 1, 1})
  elseif dim == 1 then
    colors = ispace(int3d, int3d{1, 2, 1})
  elseif dim == 2 then
    colors = ispace(int3d, int3d{1, 1, 2})
  end
end

regentlib.start(main)

The above example results in the following:

/home/seshu/dev/legion/language/src/regent/type_check.t:4235: Errors reported during typechecking.
index_space_bug.rg:9: type mismatch in assignment: expected ispace(int3d) but got ispace(int3d)
    colors = ispace(int3d, int3d{2, 1, 1})
         ^

stack traceback:
        [C]: in function 'error'
        /home/seshu/dev/terra/src/terralib.lua:388: in function 'finishandabortiferrors'
        /home/seshu/dev/legion/language/src/common/report.t:56: in function 'error'
        /home/seshu/dev/legion/language/src/regent/type_check.t:4235: in function 'fn'
        /home/seshu/dev/terra/src/asdl.lua:16: in function 'map'
        /home/seshu/dev/legion/language/src/regent/type_check.t:3884: in function 'block'
        /home/seshu/dev/legion/language/src/regent/type_check.t:3902: in function 'fn'
        /home/seshu/dev/terra/src/asdl.lua:16: in function 'map'
        /home/seshu/dev/legion/language/src/regent/type_check.t:3884: in function 'block'
        /home/seshu/dev/legion/language/src/regent/type_check.t:4612: in function </home/seshu/dev/legion/language/src/regent/type_check.t:4545>
        /home/seshu/dev/legion/language/src/regent/passes.t:69: in function </home/seshu/dev/legion/language/src/regent/passes.t:57>
        index_space_bug.rg:4: in main chunk

If this is in fact invalid code the error message should probably be fixed because right now it is nonsensical to a user.

@syamajala syamajala added the S3D label Mar 26, 2020
@elliottslaughter
Copy link
Contributor

The error message is an instance of #491. It may be fixed by #583 but there are still some blocking issues around that one.

For now, you have to do this by making the dims conditional. Assignment on "special" types such as ispaces and regions isn't supported (until #583 merges).

@elliottslaughter elliottslaughter self-assigned this Mar 26, 2020
@elliottslaughter elliottslaughter added backlog Feature/fix that is desirable, but not currently planned enhancement Regent Issues pertaining to Regent labels Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Feature/fix that is desirable, but not currently planned enhancement Regent Issues pertaining to Regent S3D
Projects
None yet
Development

No branches or pull requests

2 participants