Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Add optimized implementation of fill for types supported by memset. #178

Merged
merged 1 commit into from
Nov 6, 2018

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Oct 31, 2018

Before: our broadcasting fill! is slower than a memory copy...

julia> @btime cuzeros(Float32,10,10)
  6.552 μs (47 allocations: 1.61 KiB)

julia> @btime CuArray(zeros(Float32,10,10))
  4.616 μs (18 allocations: 1.94 KiB)

After:

julia> @btime cuzeros(Float32,10,10)
  2.162 μs (15 allocations: 352 bytes)

Would be nice if we could dispatch on haskey(MemsetTypes, sizeof(T)) instead of enumerating like now.

@codecov-io
Copy link

codecov-io commented Oct 31, 2018

Codecov Report

Merging #178 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
+ Coverage   43.47%   43.55%   +0.07%     
==========================================
  Files          34       34              
  Lines        2123     2126       +3     
==========================================
+ Hits          923      926       +3     
  Misses       1200     1200
Impacted Files Coverage Δ
src/array.jl 51.35% <100%> (+2.05%) ⬆️

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 599942e...832db73. Read the comment docs.

@maleadt
Copy link
Member Author

maleadt commented Oct 31, 2018

Probably should implement this with a constructor instead of cuzeros, ref. JuliaLang/julia#11557 ?

@maleadt
Copy link
Member Author

maleadt commented Nov 6, 2018

Let's merge this since it's a strict improvement.

@maleadt maleadt merged commit f5f35c1 into master Nov 6, 2018
@maleadt maleadt deleted the tb/cuzeros branch November 6, 2018 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants