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

Do not suggest using foreach in Burst compiled jobs #1378

Closed
UnknownDude1 opened this issue Oct 27, 2019 · 5 comments
Closed

Do not suggest using foreach in Burst compiled jobs #1378

UnknownDude1 opened this issue Oct 27, 2019 · 5 comments
Assignees

Comments

@UnknownDude1
Copy link

Hello,

I've been having this issue that Rider keeps suggesting me to use features in Burst-compiled jobs that are unsupported. The best example is the suggestion to replace a for loop with foreach, which is unsupported by Burst. Another example would be the usage of Linq, which is also unsupported.

So far I've been dealing with this issue by simply adding the Resharper disable comments, but this is something that I think should not be necessary.

Cheers

@Lattyware
Copy link

Lattyware commented Oct 31, 2019

Yeah. Ideally full support would include showing errors in burst compiled code where such features are used. Other examples:

  • Showing errors when using try/catch or using.
  • Showing errors when using instances of managed types.
  • Showing errors when writing to static fields.
  • Showing errors when using StructLayout Auto types in burst compiled code (most common case is ValueTuple).
  • Suggest using Unity.Mathematics for mathematics where possible.

The full restrictions can be found at https://docs.unity3d.com/Packages/com.unity.burst@1.2/manual/index.html#cnet-language-support.

@krasnotsvetov krasnotsvetov self-assigned this Nov 3, 2019
@krasnotsvetov
Copy link
Collaborator

Thank you for your feedback. We have big internal task to support Burst compiler

Please share any feature requst for Burst support here :)

@Domonion Domonion assigned Domonion and unassigned krasnotsvetov Aug 24, 2020
@Domonion Domonion added this to the Rider 2020.3 milestone Aug 24, 2020
@Domonion
Copy link

Hello @Lattyware and @UnknownSoldier1!
Thank you for your feedback, as you might have already seen we have added some support for the Burst compiler. From the next EAP, there will be code vision that will show if the function is in the Burst context or not.

Here is an example:
java_CwdOZoSEyS

Also, there is context action and quick fix to place the BurstDiscard attribute.
burstCodeVision
burstQuickFix

If you have further suggestions on what to support at Burst - feel free to post it at YouTrack or add here at repo as an issue.

@Domonion
Copy link

@Lattyware I created issues based on your suggestions, it would be great you would provide a code example to support for each suggestion. #1900 #1901

@Domonion Domonion removed this from the Rider 2020.3 milestone Nov 17, 2020
@Domonion
Copy link

Domonion commented Feb 3, 2021

#2015 from now foreach is allowed in burst compiled code, closing issue

@Domonion Domonion closed this as completed Feb 3, 2021
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

4 participants