ITADN

`Base.FastMath.pow_fast` fails to compile with integer exponent

#3065OpenMikolaj-A-Kowalski 创建于 2026-03-27
bug
**Describe the bug** `CUDA.jl` fails to properly resolve a call to `Base.FastMath.pow_fast(x,y)` where y is an integer. The LLVM error `Undefined external symbol "__powidf2" ` is raised instead. **To reproduce** ```julia using CUDA function apply_fast_pow(A,y) i = threadIdx().x @inbounds @fastmath A[i] = A[i]^y nothing end A_64 = CUDA.ones(Float64, 10) .+ 0.3 A_32 = CUDA.ones(Float32, 10) .+ 0.3 # Either of the following lines causes the LLVM error # @cuda threads=length(A_64) apply_f(A_64, 2) # @cuda threads=length(A_32) apply_f(A_32, 2) # @cuda threads=length(A_32) apply_f(A_64, Int32(2)) # @cuda threads=length(A_32) apply_f(A_32, Int32(2)) ``` <details><summary>Manifest.toml</summary> <p> ``` # This file is machine-generated - editing it directly is not advised julia_version = "1.11.4" manifest_format = "2.0" project_hash = "4d6f52122ea9741175c8c71d00021be0a921f3ad" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" version = "1.5.0" [deps.AbstractFFTs.extensions] AbstractFFTsChainRulesCoreExt = "ChainRulesCore" AbstractFFTsTestExt = "Test" [deps.AbstractFFTs.weakdeps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] git-tree-sha1 = "35ea197a51ce46fcd01c4a44befce0578a1aaeca" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" version = "4.5.0" weakdeps = ["SparseArrays", "StaticArrays"] [deps.Adapt.extensions] AdaptSparseArraysExt = "SparseArrays" AdaptStaticArraysExt = "StaticArrays" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" version = "1.1.2" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" version = "1.11.0" [[deps.Atomix]] deps = ["UnsafeAtomics"] git-tree-sha1 = "b8651b2eb5796a386b0398a20b519a6a6150f75c" uuid = "a9b6321e-bd34-4604-b9c9-b65b8de01458" version = "1.1.3" [deps.Atomix.extensions] AtomixCUDAExt = "CUDA" AtomixMetalExt = "Metal" AtomixOpenCLExt = "OpenCL" AtomixoneAPIExt = "oneAPI" [deps.Atomix.weakdeps] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" Metal = "dde4c033-4e86-420c-a63e-0dd931031962" OpenCL = "08131aa3-fb12-5dee-8b74-c09406e224a2" oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b" [[deps.BFloat16s]] deps = ["LinearAlgebra", "Printf", "Random"] git-tree-sha1 = "e386db8b4753b42caac75ac81d0a4fe161a68a97" uuid = "ab4f0b2a-ad5b-11e8-123f-65d77653426b" version = "0.6.1" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" version = "1.11.0" [[deps.CEnum]] git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc" uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" version = "0.5.0" [[deps.CUDA]] deps = ["CUDACore", "CUDATools", "Reexport", "cuBLAS", "cuFFT", "cuRAND", "cuSOLVER", "cuSPARSE"] path = "dev/CUDA" uuid = "052768ef-5323-5732-b1bb-66c8b64840ba" version = "6.0.0" [[deps.CUDACore]] deps = ["Adapt", "BFloat16s", "CEnum", "CUDA_Compiler_jll", "CUDA_Driver_jll", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "ExprTools", "GPUArrays", "GPUCompiler", "GPUToolbox", "KernelAbstractions", "LLVM", "LLVMLoopInfo", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Preferences", "Printf", "Random", "Random123", "RandomNumbers", "StaticArrays"] path = "dev/CUDA/CUDACore" uuid = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2" version = "6.0.0" [deps.CUDACore.extensions] ChainRulesCoreExt = "ChainRulesCore" EnzymeCoreExt = "EnzymeCore" SpecialFunctionsExt = "SpecialFunctions" [deps.CUDACore.weakdeps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [[deps.CUDATools]] deps = ["CUDACore", "CUDA_Compiler_jll", "CUPTI", "Crayons", "GPUCompiler", "LLVM", "NVML", "NVTX", "Preferences", "PrettyTables", "Printf", "Statistics", "demumble_jll"] path = "dev/CUDA/CUDATools" uuid = "9ec180c6-1c07-47c7-9e6e-ebefa4d1f6d0" version = "6.0.0" [[deps.CUDA_Compiler_jll]] deps = ["Artifacts", "CUDA_Driver_jll", "CUDA_Runtime_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] git-tree-sha1 = "8c19e97de5b7574672e4a7a3abd55714ad66d59a" uuid = "d1e2174e-dfdc-576e-b43e-73b79eb1aca8" version = "0.4.2+0" [[deps.CUDA_Driver_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "TOML"] git-tree-sha1 = "061f39cc84e99928830aa1005d79f7e99097ba28" uuid = "4ee394cb-3365-5eb0-8335-949819d2adfc" version = "13.2.0+0" [[deps.CUDA_Runtime_Discovery]] deps = ["Libdl"] git-tree-sha1 = "f9a521f52d236fe49f1028d69e549e7f2644bb72" uuid = "1af6417a-86b4-443c-805f-a4643ffb695f" version = "1.0.0" [[deps.CUDA_Runtime_jll]] deps = ["Artifacts", "CUDA_Driver_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] git-tree-sha1 = "af17d37b5b8b4d7525f8902eba1ef6141a9a7d3b" uuid = "76a88914-d11a-5bdc-97e0-2f5a05c973a2" version = "0.21.0+0" [[deps.CUPTI]] deps = ["CEnum", "CUDACore", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "GPUToolbox"] path = "dev/CUDA/lib/cupti" uuid = "9e67e8f6-ba02-4b6c-a7db-3b11ae1e7ab7" version = "6.0.0" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.1.1+0" [[deps.Crayons]] git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" version = "4.1.1" [[deps.DataAPI]] git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" version = "1.16.0" [[deps.DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" version = "1.0.0" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" version = "1.11.0" [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" [[deps.ExprTools]] git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" version = "0.1.10" [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" version = "1.11.0" [[deps.GPUArrays]] deps = ["Adapt", "GPUArraysCore", "KernelAbstractions", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "ScopedValues", "Serialization", "SparseArrays", "Statistics"] git-tree-sha1 = "6487601563e4a1d1dab796e88b4548bf5544209e" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" version = "11.4.1" [deps.GPUArrays.extensions] JLD2Ext = "JLD2" [deps.GPUArrays.weakdeps] JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" [[deps.GPUArraysCore]] deps = ["Adapt"] git-tree-sha1 = "83cf05ab16a73219e5f6bd1bdfa9848fa24ac627" uuid = "46192b85-c4d5-4398-a991-12ede77f4527" version = "0.2.0" [[deps.GPUCompiler]] deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "PrecompileTools", "Preferences", "Scratch", "Serialization", "TOML", "Tracy", "UUIDs"] git-tree-sha1 = "966946d226e8b676ca6409454718accb18c34c54" uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" version = "1.8.2" [[deps.GPUToolbox]] deps = ["LLVM"] git-tree-sha1 = "a589b6c1a0eff953571f5d8b0474f5020831114d" uuid = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc" version = "1.1.1" [[deps.HashArrayMappedTries]] git-tree-sha1 = "2eaa69a7cab70a52b9687c8bf950a5a93ec895ae" uuid = "076d061b-32b6-4027-95e0-9a2c6f6d7e74" version = "0.2.0" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" version = "1.11.0" [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" uuid = "82899510-4779-5014-852e-03e436cf321d" version = "1.0.0" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] git-tree-sha1 = "0533e564aae234aff59ab625543145446d8b6ec2" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" version = "1.7.1" [[deps.JuliaNVTXCallbacks_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "af433a10f3942e882d3c671aacb203e006a5808f" uuid = "9c1d0b0a-7046-5b2e-a33f-ea22f176ac7e" version = "0.2.1+0" [[deps.KernelAbstractions]] deps = ["Adapt", "Atomix", "InteractiveUtils", "MacroTools", "PrecompileTools", "Requires", "StaticArrays", "UUIDs"] git-tree-sha1 = "f2e76d3ced51a2a9e185abc0b97494c7273f649f" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" version = "0.9.41" [deps.KernelAbstractions.extensions] EnzymeExt = "EnzymeCore" LinearAlgebraExt = "LinearAlgebra" SparseArraysExt = "SparseArrays" [deps.KernelAbstractions.weakdeps] EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.LLVM]] deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Unicode"] git-tree-sha1 = "69e4739502b7ab5176117e97e1664ed181c35036" uuid = "929cbde3-209d-540e-8aea-75f648917ca0" version = "9.4.6" weakdeps = ["BFloat16s"] [deps.LLVM.extensions] BFloat16sExt = "BFloat16s" [[deps.LLVMExtra_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] git-tree-sha1 = "8e76807afb59ebb833e9b131ebf1a8c006510f33" uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab" version = "0.0.38+0" [[deps.LLVMLoopInfo]] git-tree-sha1 = "2e5c102cfc41f48ae4740c7eca7743cc7e7b75ea" uuid = "8b046642-f1f6-4319-8d3c-209ddc03c586" version = "1.0.0" [[deps.LaTeXStrings]] git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" version = "1.4.0" [[deps.LazyArtifacts]] deps = ["Artifacts", "Pkg"] uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" version = "1.11.0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" version = "0.6.4" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" version = "8.6.0+0" [[deps.LibGit2]] deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" version = "1.11.0" [[deps.LibGit2_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" version = "1.7.2+0" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" version = "1.11.0+1" [[deps.LibTracyClient_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "d4e20500d210247322901841d4eafc7a0c52642d" uuid = "ad6e5548-8b26-5c9f-8ef3-ef0ad883f3a5" version = "0.13.1+0" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" version = "1.11.0" [[deps.LinearAlgebra]] deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" version = "1.11.0" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" version = "1.11.0" [[deps.MacroTools]] git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" version = "0.5.16" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" version = "1.11.0" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" version = "2.28.6+0" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" version = "2023.12.12" [[deps.NVML]] deps = ["CEnum", "CUDACore", "GPUToolbox", "Libdl"] path = "dev/CUDA/lib/nvml" uuid = "611af6d1-644e-4c5d-bd58-854d7d1254b9" version = "6.0.0" [[deps.NVTX]] deps = ["JuliaNVTXCallbacks_jll", "Libdl", "NVTX_jll"] git-tree-sha1 = "a9083c3e469e63cca454d1fc3b19472d9d92c14a" uuid = "5da4648a-3479-48b8-97b9-01cb529c0a1f" version = "1.0.3" [deps.NVTX.extensions] NVTXColorsExt = "Colors" [deps.NVTX.weakdeps] Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" [[deps.NVTX_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "af2232f69447494514c25742ba1503ec7e9877fe" uuid = "e98f9f5b-d649-5603-91fd-7774390e6439" version = "3.2.2+0" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" version = "0.3.27+1" [[deps.OrderedCollections]] git-tree-sha1 = "05868e21324cede2207c6f0f466b4bfef6d5e7ee" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" version = "1.8.1" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "Random", "SHA", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" version = "1.11.0" weakdeps = ["REPL"] [deps.Pkg.extensions] REPLExt = "REPL" [[deps.PrecompileTools]] deps = ["Preferences"] git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" version = "1.2.1" [[deps.Preferences]] deps = ["TOML"] git-tree-sha1 = "8b770b60760d4451834fe79dd483e318eee709c4" uuid = "21216c6a-2e73-6563-6e65-726566657250" version = "1.5.2" [[deps.PrettyTables]] deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"] git-tree-sha1 = "624de6279ab7d94fc9f672f0068107eb6619732c" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" version = "3.3.2" [deps.PrettyTables.extensions] PrettyTablesTypstryExt = "Typstry" [deps.PrettyTables.weakdeps] Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" version = "1.11.0" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "StyledStrings", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" version = "1.11.0" [[deps.Random]] deps = ["SHA"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" version = "1.11.0" [[deps.Random123]] deps = ["Random", "RandomNumbers"] git-tree-sha1 = "dbe5fd0b334694e905cb9fda73cd8554333c46e2" uuid = "74087812-796a-5b5d-8853-05524746bad3" version = "1.7.1" [[deps.RandomNumbers]] deps = ["Random"] git-tree-sha1 = "c6ec94d2aaba1ab2ff983052cf6a606ca5985902" uuid = "e6cf234a-135c-5ec9-84dd-332b85af5143" version = "1.6.0" [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" version = "1.2.2" [[deps.Requires]] deps = ["UUIDs"] git-tree-sha1 = "62389eeff14780bfe55195b7204c0d8738436d64" uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.1" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" version = "0.7.0" [[deps.ScopedValues]] deps = ["HashArrayMappedTries", "Logging"] git-tree-sha1 = "ac4b837d89a58c848e85e698e2a2514e9d59d8f6" uuid = "7e506255-f358-4e82-b7e4-beb19740aa63" version = "1.6.0" [[deps.Scratch]] deps = ["Dates"] git-tree-sha1 = "9b81b8393e50b7d4e6d0a9f14e192294d3b7c109" uuid = "6c6a2e73-6563-6170-7368-637461726353" version = "1.3.0" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" version = "1.11.0" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" version = "1.11.0" [[deps.SparseArrays]] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" version = "1.11.0" [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] git-tree-sha1 = "246a8bb2e6667f832eea063c3a56aef96429a3db" uuid = "90137ffa-7385-5640-81b9-e52037218182" version = "1.9.18" [deps.StaticArrays.extensions] StaticArraysChainRulesCoreExt = "ChainRulesCore" StaticArraysStatisticsExt = "Statistics" [deps.StaticArrays.weakdeps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [[deps.StaticArraysCore]] git-tree-sha1 = "6ab403037779dae8c514bad259f32a447262455a" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" version = "1.4.4" [[deps.Statistics]] deps = ["LinearAlgebra"] git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0" uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" version = "1.11.1" weakdeps = ["SparseArrays"] [deps.Statistics.extensions] SparseArraysExt = ["SparseArrays"] [[deps.StringManipulation]] deps = ["PrecompileTools"] git-tree-sha1 = "d05693d339e37d6ab134c5ab53c29fce5ee5d7d5" uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e" version = "0.4.4" [[deps.StyledStrings]] uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b" version = "1.11.0" [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" version = "7.7.0+0" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" version = "1.0.3" [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" version = "1.0.1" [[deps.Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] git-tree-sha1 = "f2c1efbc8f3a609aadf318094f8fc5204bdaf344" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" version = "1.12.1" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" version = "1.10.0" [[deps.Tracy]] deps = ["ExprTools", "LibTracyClient_jll", "Libdl"] git-tree-sha1 = "73e3ff50fd3990874c59fef0f35d10644a1487bc" uuid = "e689c965-62c8-4b79-b2c5-8359227902fd" version = "0.1.6" [deps.Tracy.extensions] TracyProfilerExt = "TracyProfiler_jll" [deps.Tracy.weakdeps] TracyProfiler_jll = "0c351ed6-8a68-550e-8b79-de6f926da83c" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" version = "1.11.0" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" version = "1.11.0" [[deps.UnsafeAtomics]] git-tree-sha1 = "0f30765c32d66d58e41f4cb5624d4fc8a82ec13b" uuid = "013be700-e6cd-48c3-b4a1-df204f14c38f" version = "0.3.1" weakdeps = ["LLVM"] [deps.UnsafeAtomics.extensions] UnsafeAtomicsLLVM = ["LLVM"] [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" version = "1.2.13+1" [[deps.cuBLAS]] deps = ["Adapt", "BFloat16s", "CEnum", "CUDACore", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "GPUArrays", "GPUToolbox", "LLVM", "LinearAlgebra"] path = "dev/CUDA/lib/cublas" uuid = "182d3088-87b7-4494-8cad-fc6afaa545bc" version = "6.0.0" [deps.cuBLAS.extensions] EnzymeCoreExt = "EnzymeCore" [deps.cuBLAS.weakdeps] EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" [[deps.cuFFT]] deps = ["AbstractFFTs", "CEnum", "CUDACore", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "GPUToolbox", "LinearAlgebra", "Reexport"] path = "dev/CUDA/lib/cufft" uuid = "533571aa-0936-420e-b4be-9c66f5f626ca" version = "6.0.0" [[deps.cuRAND]] deps = ["CEnum", "CUDACore", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "GPUToolbox", "Random", "Random123", "RandomNumbers"] path = "dev/CUDA/lib/curand" uuid = "20fd9a0b-12d5-4c2f-a8af-7c34e9e60431" version = "6.0.0" [[deps.cuSOLVER]] deps = ["CEnum", "CUDACore", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "GPUToolbox", "LinearAlgebra", "SparseArrays", "cuBLAS", "cuSPARSE"] path = "dev/CUDA/lib/cusolver" uuid = "887afef0-6a32-4de5-add4-7827692ba8fc" version = "6.0.0" [[deps.cuSPARSE]] deps = ["Adapt", "CEnum", "CUDACore", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "GPUArrays", "GPUToolbox", "KernelAbstractions", "LinearAlgebra", "SparseArrays"] path = "dev/CUDA/lib/cusparse" uuid = "b26da814-b3bc-49ef-b0ee-c816305aa060" version = "6.0.0" [deps.cuSPARSE.extensions] SparseMatricesCSRExt = "SparseMatricesCSR" [deps.cuSPARSE.weakdeps] SparseMatricesCSR = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1" [[deps.demumble_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "6498e3581023f8e530f34760d18f75a69e3a4ea8" uuid = "1e29f10c-031c-5a83-9565-69cddfc27673" version = "1.3.0+0" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" version = "5.11.0+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" version = "1.59.0+0" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" version = "17.4.0+2" ``` </p> </details> **Expected behavior** The example kernel should execute. Either fallback to the orginary `Base.:^` or have extra overloads to handle the case with integer exponent **Version info** Details on Julia: ``` Julia Version 1.11.4 Commit 8561cc3d68d (2025-03-10 11:36 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 64 × Intel(R) Xeon(R) Platinum 8362 CPU @ 2.80GHz WORD_SIZE: 64 LLVM: libLLVM-16.0.6 (ORCJIT, icelake-server) Threads: 1 default, 0 interactive, 1 GC (on 64 virtual cores) ``` Details on CUDA: ``` CUDA toolchain: - runtime 13.2, artifact installation - driver 570.211.1 for 13.2 - compiler 13.2 CUDA libraries: - cuBLAS: 13.3.0 - cuSPARSE: 12.7.9 - cuSOLVER: 12.1.0 - cuFFT: 12.2.0 - cuRAND: 10.4.2 - CUPTI: 2026.1.0 (API 13.2.0) - NVML: 12.0.0+570.211.1 Julia packages: - CUDACore: 6.0.0 - GPUArrays: 11.4.1 - GPUCompiler: 1.8.2 - KernelAbstractions: 0.9.41 - CUDA_Driver_jll: 13.2.0+0 - CUDA_Compiler_jll: 0.4.2+0 - CUDA_Runtime_jll: 0.21.0+0 Toolchain: - Julia: 1.11.4 - LLVM: 16.0.6 4 devices: 0: NVIDIA L40 (sm_89, 43.806 GiB / 44.988 GiB available) 1: NVIDIA L40 (sm_89, 44.258 GiB / 44.988 GiB available) 2: NVIDIA L40 (sm_89, 44.258 GiB / 44.988 GiB available) 3: NVIDIA L40 (sm_89, 44.258 GiB / 44.988 GiB available) ``` **Additional context** I think this is just a case of a missing overload. Trying it out locally adding a fall-back: ```julia @device_override FastMath.pow_fast(x, y) = Base.:(^)(x, y) ``` fixes the problem. I imagine though that the proper solution would include some "fast" fallback when possible e.g.: ```julia @device_override FastMath.pow_fast(x, y) = Base.:(^)(x, y) @device_override @inline function FastMath.pow_fast(x::Float32, y::Integer) y == -1 && return inv(x) y == 0 && return one(x) y == 1 && return x y == 2 && return x*x y == 3 && return x*x*x Base.FastMath.pow_fast(x, Float32(y)) end ```
1 条评论