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

Fix up type inference and other issues for the new DFT API #12202

Merged
merged 4 commits into from
Jul 20, 2015

Conversation

yuyichao
Copy link
Contributor

The type instability/inference issue is mentioned in #12087 (comment) and #12087 (comment).

The code can probably be cleaned up a little to make the type inference more effective without the type assertion but the current version should be good enough.

This also fixes a deprecation warning for int64.

Close #9772

CC. @stevengj

@stevengj
Copy link
Member

Looks good, thanks for working on this; sorry it's taken me so long to get back to you on this.

stevengj added a commit that referenced this pull request Jul 20, 2015
Fix up type inference and other issues for the new DFT API
@stevengj stevengj merged commit cf17fee into master Jul 20, 2015
@yuyichao
Copy link
Contributor Author

I'm also trying to implement some other tweaks that I think can probably make this more compiler/type inference friendly. I guess I'll just do a separate PR when I'm ready.

@stevengj
Copy link
Member

Sorry, it looked ready to merge to me.

@yuyichao yuyichao deleted the yyc/dftnew_api branch July 20, 2015 19:39
@stevengj
Copy link
Member

With the latest version it seems there is still a little allocation:

A = rand(Complex128, 300,300,50);
X = similar(A)
p = plan_fft(A)
@time A_mul_B!(X, p, A);
@time A_mul_B!(X, p, A);

gives 137.505 milliseconds (4 allocations: 144 bytes).

@yuyichao
Copy link
Contributor Author

the 4 allocations: 144 bytes comes from @time

@yuyichao
Copy link
Contributor Author

In global scope

@yuyichao
Copy link
Contributor Author

julia> function f()
       A = rand(Complex128, 300,300,50);
       X = similar(A)
       p = plan_fft(A)
       @time A_mul_B!(X, p, A);
       @time A_mul_B!(X, p, A);
       end
f (generic function with 1 method)

julia> f();
 119.674 milliseconds
 105.739 milliseconds

@stevengj
Copy link
Member

Ah, right. (cc: @HomerReid)

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.

Type stability issue in rfft
2 participants