Skip to content

The example in README.md not work #118

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

Closed
kongdd opened this issue Oct 17, 2019 · 1 comment
Closed

The example in README.md not work #118

kongdd opened this issue Oct 17, 2019 · 1 comment

Comments

@kongdd
Copy link

kongdd commented Oct 17, 2019

function profile_test(n)
    for i = 1:n
        A = randn(100,100,20)
        m = maximum(A)
        Am = mapslices(sum, A; dims=2)
        B = A[:,:,5]
        Bsort = mapslices(sort, B; dims=1)
        b = rand(100)
        C = B.*b
    end
end

profile_test(1)  # run once to trigger compilation
using Profile
using ProfileView

Profile.clear()  # in case we have any previous profiling data
@profile profile_test(10)
ProfileView.view()
ProfileView.view()
ERROR: MethodError: no method matching view()
Closest candidates are:
  view(::AbstractArray, ::Any...) where N at subarray.jl:155
Stacktrace:
 [1] top-level scope at REPL[348]:1
versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)    
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Xeon(R) W-2145 CPU @ 3.70GHz
  WORD_SIZE: 64    
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
@kongdd
Copy link
Author

kongdd commented Oct 17, 2019

works after rebuild

@kongdd kongdd closed this as completed Oct 17, 2019
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

1 participant