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

[bug] Fix test_fibonacci #1414

Merged
merged 1 commit into from
Jul 5, 2020
Merged

[bug] Fix test_fibonacci #1414

merged 1 commit into from
Jul 5, 2020

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Jul 5, 2020

This is probably more of a workaround. I don't think the IR optimizer should change the semantics of the for loop. That means we need to preserve the top-level if if the compile time condition is true, or transform it to a serial kernel, like this PR does..

Maybe we should also have a dedicated method to instruct that the for loop is meant to be executed inside a serial kernel. Right now this for _ in range(1): seems hacky..

Related issue = #1393 (comment)

[Click here for the format server]


@k-ye k-ye requested a review from xumingkuan July 5, 2020 08:04
Copy link
Collaborator

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool hack.. Btw I'm wondering once we come to real function support, i.e. non-inline, will the for loop inside function being parallelized?

@k-ye
Copy link
Member Author

k-ye commented Jul 5, 2020

will the for loop inside function being parallelized?

Hmm, i don't think so? Why?

BTW, did this also break on OpenGL?

@archibate
Copy link
Collaborator

Hmm, i don't think so? Why?

Just to confirm...

BTW, did this also break on OpenGL?

Don't know, my laptop is of OpenGL 3.3 which doesn't support compute shader..

@codecov
Copy link

codecov bot commented Jul 5, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@b709fb6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1414   +/-   ##
=========================================
  Coverage          ?   66.76%           
=========================================
  Files             ?       37           
  Lines             ?     5206           
  Branches          ?      934           
=========================================
  Hits              ?     3476           
  Misses            ?     1570           
  Partials          ?      160           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b709fb6...1dd441e. Read the comment docs.

@k-ye k-ye merged commit 9e6bd3c into taichi-dev:master Jul 5, 2020
@k-ye k-ye deleted the fix branch July 5, 2020 11:41
@xumingkuan
Copy link
Contributor

IIRC some other unit tests also use for _ in range(1): to make the loop serial. It makes sense to me using only for (but not if) to make the loop serial for now.

@FantasyVR FantasyVR mentioned this pull request Jul 8, 2020
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

Successfully merging this pull request may close these issues.

3 participants