Created
December 22, 2020 00:33
-
-
Save tkf/81f674b14177abaf8f82229f23a10a77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine-generated - editing it directly is not advised | |
[[AbstractFFTs]] | |
deps = ["LinearAlgebra"] | |
git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "0.5.0" | |
[[Adapt]] | |
deps = ["LinearAlgebra"] | |
git-tree-sha1 = "42c42f2221906892ceb765dbcb1a51deeffd86d7" | |
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | |
version = "2.3.0" | |
[[ArgCheck]] | |
git-tree-sha1 = "dedbbb2ddb876f899585c4ec4433265e3017215a" | |
uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197" | |
version = "2.1.0" | |
[[BFloat16s]] | |
deps = ["LinearAlgebra", "Test"] | |
git-tree-sha1 = "4af69e205efc343068dc8722b8dfec1ade89254a" | |
uuid = "ab4f0b2a-ad5b-11e8-123f-65d77653426b" | |
version = "0.1.0" | |
[[BangBang]] | |
deps = ["Compat", "ConstructionBase", "Future", "InitialValues", "LinearAlgebra", "Requires", "Setfield", "Tables", "ZygoteRules"] | |
git-tree-sha1 = "f42321255afc37da855b6cd9f2a1fc36c017ceee" | |
uuid = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" | |
version = "0.3.29" | |
[[Base64]] | |
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" | |
[[Baselet]] | |
git-tree-sha1 = "aebf55e6d7795e02ca500a689d326ac979aaf89e" | |
uuid = "9718e550-a3fa-408a-8086-8db961cd8217" | |
version = "0.1.1" | |
[[CEnum]] | |
git-tree-sha1 = "215a9aa4a1f23fbd05b92769fdd62559488d70e9" | |
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" | |
version = "0.4.1" | |
[[CUDA]] | |
deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "DataStructures", "ExprTools", "GPUArrays", "GPUCompiler", "LLVM", "Libdl", "LinearAlgebra", "Logging", "MacroTools", "NNlib", "Pkg", "Printf", "Random", "Reexport", "Requires", "SparseArrays", "Statistics", "TimerOutputs"] | |
git-tree-sha1 = "7663b61782b569b03fba91d330a5ed2f86cd4cb8" | |
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba" | |
version = "2.3.0" | |
[[Compat]] | |
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] | |
git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b" | |
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" | |
version = "3.25.0" | |
[[CompositionsBase]] | |
git-tree-sha1 = "f3955eb38944e5dd0fabf8ca1e267d94941d34a5" | |
uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" | |
version = "0.1.0" | |
[[ConstructionBase]] | |
git-tree-sha1 = "a2a6a5fea4d6f730ec4c18a76d27ec10e8ec1c50" | |
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" | |
version = "1.0.0" | |
[[ContextVariablesX]] | |
deps = ["Compat", "Logging", "UUIDs"] | |
git-tree-sha1 = "fc81d9dd4ffdafb56680f01e6d9db464a6b3689d" | |
uuid = "6add18c4-b38d-439d-96f6-d6bc489c04c5" | |
version = "0.1.1" | |
[[DataAPI]] | |
git-tree-sha1 = "ad84f52c0b8f05aa20839484dbaf01690b41ff84" | |
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" | |
version = "1.4.0" | |
[[DataStructures]] | |
deps = ["Compat", "InteractiveUtils", "OrderedCollections"] | |
git-tree-sha1 = "fb0aa371da91c1ff9dc7fbed6122d3e411420b9c" | |
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" | |
version = "0.18.8" | |
[[DataValueInterfaces]] | |
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" | |
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" | |
version = "1.0.0" | |
[[Dates]] | |
deps = ["Printf"] | |
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" | |
[[DefineSingletons]] | |
git-tree-sha1 = "1a356f194281dff9ef1119faa9125a0d4e210729" | |
uuid = "244e2a9f-e319-4986-a169-4d1fe445cd52" | |
version = "0.1.0" | |
[[DelimitedFiles]] | |
deps = ["Mmap"] | |
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" | |
[[Distributed]] | |
deps = ["Random", "Serialization", "Sockets"] | |
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" | |
[[ExprTools]] | |
git-tree-sha1 = "10407a39b87f29d47ebaca8edbc75d7c302ff93e" | |
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" | |
version = "0.1.3" | |
[[FLoops]] | |
deps = ["Compat", "FLoopsBase", "JuliaVariables", "MLStyle", "Setfield", "Transducers"] | |
git-tree-sha1 = "6d0830bffc733b3e4d4d1a7e7109d0a51d68495d" | |
uuid = "cc61a311-1640-44b5-9fba-1b764f453329" | |
version = "0.1.4" | |
[[FLoopsBase]] | |
deps = ["ContextVariablesX"] | |
git-tree-sha1 = "cf3d8b2527be12d204d06aba922b30339a9653dd" | |
uuid = "b9860ae5-e623-471e-878b-f6a53c775ea6" | |
version = "0.1.0" | |
[[FoldsCUDA]] | |
deps = ["CUDA", "FLoops", "GPUArrays", "InitialValues", "SplittablesBase", "Transducers"] | |
git-tree-sha1 = "0508070d60a5ba2dcf6ecd6567888275c0288fe6" | |
uuid = "6cd66ae4-5932-4b96-926d-e73e578e42cc" | |
version = "0.1.1" | |
[[Future]] | |
deps = ["Random"] | |
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" | |
[[GPUArrays]] | |
deps = ["AbstractFFTs", "Adapt", "LinearAlgebra", "Printf", "Random", "Serialization"] | |
git-tree-sha1 = "2c1dd57bca7ba0b3b4bf81d9332aeb81b154ef4c" | |
uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" | |
version = "6.1.2" | |
[[GPUCompiler]] | |
deps = ["DataStructures", "InteractiveUtils", "LLVM", "Libdl", "Scratch", "Serialization", "TimerOutputs", "UUIDs"] | |
git-tree-sha1 = "c853c810b52a80f9aad79ab109207889e57f41ef" | |
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" | |
version = "0.8.3" | |
[[InitialValues]] | |
git-tree-sha1 = "26c8832afd63ac558b98a823265856670d898b6c" | |
uuid = "22cec73e-a1b8-11e9-2c92-598750a2cf9c" | |
version = "0.2.10" | |
[[InteractiveUtils]] | |
deps = ["Markdown"] | |
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | |
[[IteratorInterfaceExtensions]] | |
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" | |
uuid = "82899510-4779-5014-852e-03e436cf321d" | |
version = "1.0.0" | |
[[JuliaVariables]] | |
deps = ["MLStyle", "NameResolution"] | |
git-tree-sha1 = "e0fcfa0a2f6122fbe13603764c5310dde00c5593" | |
uuid = "b14d175d-62b4-44ba-8fb7-3064adc8c3ec" | |
version = "0.2.3" | |
[[LLVM]] | |
deps = ["CEnum", "Libdl", "Printf", "Unicode"] | |
git-tree-sha1 = "a2101830a761d592b113129887fda626387f68d4" | |
uuid = "929cbde3-209d-540e-8aea-75f648917ca0" | |
version = "3.5.1" | |
[[LibGit2]] | |
deps = ["Printf"] | |
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" | |
[[Libdl]] | |
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | |
[[LinearAlgebra]] | |
deps = ["Libdl"] | |
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | |
[[Logging]] | |
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" | |
[[MLStyle]] | |
git-tree-sha1 = "937eda9ce36fcce082a42edd7181c8d23f4eb550" | |
uuid = "d8e11817-5142-5d16-987a-aa16d5891078" | |
version = "0.4.6" | |
[[MacroTools]] | |
deps = ["Markdown", "Random"] | |
git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" | |
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" | |
version = "0.5.6" | |
[[Markdown]] | |
deps = ["Base64"] | |
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" | |
[[MicroCollections]] | |
deps = ["BangBang", "Setfield"] | |
git-tree-sha1 = "e991b6a9d38091c4a0d7cd051fcb57c05f98ac03" | |
uuid = "128add7d-3638-4c79-886c-908ea0c25c34" | |
version = "0.1.0" | |
[[Mmap]] | |
uuid = "a63ad114-7e13-5084-954f-fe012c677804" | |
[[NNlib]] | |
deps = ["Compat", "Libdl", "LinearAlgebra", "Pkg", "Requires", "Statistics"] | |
git-tree-sha1 = "2b7c3213ed4f2eed686f9f531f85d3ea2f75286f" | |
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" | |
version = "0.7.9" | |
[[NameResolution]] | |
deps = ["PrettyPrint"] | |
git-tree-sha1 = "1a0fa0e9613f46c9b8c11eee38ebb4f590013c5e" | |
uuid = "71a1bf82-56d0-4bbc-8a3c-48b961074391" | |
version = "0.1.5" | |
[[OrderedCollections]] | |
git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db" | |
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | |
version = "1.3.2" | |
[[Pkg]] | |
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] | |
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | |
[[PrettyPrint]] | |
git-tree-sha1 = "632eb4abab3449ab30c5e1afaa874f0b98b586e4" | |
uuid = "8162dcfd-2161-5ef2-ae6c-7681170c5f98" | |
version = "0.2.0" | |
[[Printf]] | |
deps = ["Unicode"] | |
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" | |
[[REPL]] | |
deps = ["InteractiveUtils", "Markdown", "Sockets"] | |
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" | |
[[Random]] | |
deps = ["Serialization"] | |
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | |
[[Reexport]] | |
deps = ["Pkg"] | |
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0" | |
uuid = "189a3867-3050-52da-a836-e630ba90ab69" | |
version = "0.2.0" | |
[[Requires]] | |
deps = ["UUIDs"] | |
git-tree-sha1 = "cfbac6c1ed70c002ec6361e7fd334f02820d6419" | |
uuid = "ae029012-a4dd-5104-9daa-d747884805df" | |
version = "1.1.2" | |
[[SHA]] | |
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" | |
[[Scratch]] | |
deps = ["Dates"] | |
git-tree-sha1 = "ad4b278adb62d185bbcb6864dc24959ab0627bf6" | |
uuid = "6c6a2e73-6563-6170-7368-637461726353" | |
version = "1.0.3" | |
[[Serialization]] | |
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" | |
[[Setfield]] | |
deps = ["ConstructionBase", "Future", "MacroTools", "Requires"] | |
git-tree-sha1 = "d5640fc570fb1b6c54512f0bd3853866bd298b3e" | |
uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" | |
version = "0.7.0" | |
[[SharedArrays]] | |
deps = ["Distributed", "Mmap", "Random", "Serialization"] | |
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" | |
[[Sockets]] | |
uuid = "6462fe0b-24de-5631-8697-dd941f90decc" | |
[[SparseArrays]] | |
deps = ["LinearAlgebra", "Random"] | |
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | |
[[SplittablesBase]] | |
deps = ["Setfield", "Test"] | |
git-tree-sha1 = "ab80edcbd61a44a4dc489d06ead964a863c0a898" | |
uuid = "171d559e-b47b-412a-8079-5efa626c420e" | |
version = "0.1.10" | |
[[Statistics]] | |
deps = ["LinearAlgebra", "SparseArrays"] | |
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | |
[[TableTraits]] | |
deps = ["IteratorInterfaceExtensions"] | |
git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" | |
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" | |
version = "1.0.0" | |
[[Tables]] | |
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] | |
git-tree-sha1 = "240d19b8762006ff04b967bdd833269ad642d550" | |
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | |
version = "1.2.2" | |
[[Test]] | |
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] | |
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | |
[[TimerOutputs]] | |
deps = ["Printf"] | |
git-tree-sha1 = "3318281dd4121ecf9713ce1383b9ace7d7476fdd" | |
uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" | |
version = "0.5.7" | |
[[Transducers]] | |
deps = ["ArgCheck", "BangBang", "CompositionsBase", "DefineSingletons", "Distributed", "InitialValues", "Logging", "Markdown", "MicroCollections", "Requires", "Setfield", "SplittablesBase", "Tables"] | |
git-tree-sha1 = "80f9fad2026c304f391198d391a0c698b666b201" | |
uuid = "28d57a85-8fef-5791-bfe6-a80928e7c999" | |
version = "0.4.53" | |
[[UUIDs]] | |
deps = ["Random", "SHA"] | |
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | |
[[Unicode]] | |
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" | |
[[ZygoteRules]] | |
deps = ["MacroTools"] | |
git-tree-sha1 = "9e7a1e8ca60b742e508a315c17eef5211e7fbfd7" | |
uuid = "700de1a5-db45-46bc-99cf-38207098b444" | |
version = "0.2.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Baselet | |
using CUDA | |
using FLoops | |
using FoldsCUDA | |
function findmax2_floop(xs; ex = CUDAEx()) | |
init0 = (firstindex(xs) - 1 => typemin(eltype(xs))) | |
init = (init0, init0) | |
@floop ex for (x, i) in zip(xs, eachindex(xs)) | |
b = tuple(i => x) | |
@reduce() do (a = init; b) | |
x, y = Baselet.sort((a..., b...); by = last, rev = true) | |
a = (x, y) | |
end | |
end | |
return a | |
end | |
function merge_max2(a, b) | |
x, y = Baselet.sort((a..., b...); by = last, rev = true) | |
return (x, y) | |
end | |
singleton_max2(x, i) = ((i => x),) | |
function findmax2_cuda(xs) | |
init0 = (firstindex(xs) - 1 => typemin(eltype(xs))) | |
return mapreduce(singleton_max2, merge_max2, xs, eachindex(xs); init = (init0, init0)) | |
end | |
using Test | |
@testset "(4 => 6, 3 => 5)" begin | |
xs = CuArray([3, 0, 5, 6, 1]) | |
@test findmax2_floop(xs) == (4 => 6, 3 => 5) | |
@test findmax2_cuda(xs) == (4 => 6, 3 => 5) | |
end | |
@testset "(300 => 3, 200 => 2)" begin | |
xs = CUDA.rand(1000_0000) | |
xs[200] = 2 | |
xs[300] = 3 | |
@test findmax2_floop(xs) == (300 => 3, 200 => 2) | |
@test findmax2_cuda(xs) == (300 => 3, 200 => 2) | |
end | |
@testset "(1 => 1.0f0, 262144 => 0.5f0)" begin | |
xs = CUDA.zeros(512, 512) | |
xs[1] = 1 | |
xs[end] = 0.5 | |
@test findmax2_floop(xs) == (1 => 1.0f0, 262144 => 0.5f0) | |
@test findmax2_cuda(xs) == (1 => 1.0f0, 262144 => 0.5f0) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[deps] | |
Baselet = "9718e550-a3fa-408a-8086-8db961cd8217" | |
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | |
FLoops = "cc61a311-1640-44b5-9fba-1b764f453329" | |
FoldsCUDA = "6cd66ae4-5932-4b96-926d-e73e578e42cc" | |
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment