Skip to content

Muladd fallback #21

@ChrisRackauckas

Description

@ChrisRackauckas
u0 = GPUArray(rand(Float32, 32, 32))
k1 = similar(u0)
uprev = similar(u0)
muladd.(2,k1,uprev)
MethodError: no method matching clintrinsic(::Tuple{Expr,DataType})
Closest candidates are:
  clintrinsic(!Matched::Base.#getindex, !Matched::Type{Tuple{Tuple{Vararg{T,N}},I<:Integer}}) where {N, T, I<:Integer} at C:\Users\Chris\.julia\v0.6\Transpiler\src\clike/opencl\intrinsics.jl:172
  clintrinsic(!Matched::Base.#getindex, !Matched::Type{Tuple{T,I<:Union{Int32, Int64, UInt64}}}) where {T, I<:Union{Int32, Int64, UInt64}} at C:\Users\Chris\.julia\v0.6\Transpiler\src\clike/opencl\intrinsics.jl:178
  clintrinsic(!Matched::Base.#setindex!, !Matched::Type{Tuple{T<:Union{Transpiler.CLTranspiler.CLIntrinsics.CLArray, Transpiler.CLTranspiler.CLIntrinsics.LocalMemory},Val,I<:Integer}}) where {T<:Union{Transpiler.CLTranspiler.CLIntrinsics.CLArray, Transpiler.CLTranspiler.CLIntrinsics.LocalMemory}, Val, I<:Integer} at C:\Users\Chris\.julia\v0.6\Transpiler\src\clike/opencl\intrinsics.jl:183
  ...
isintrinsic(::Sugar.LazyMethod{:CL}) at intrinsics.jl:157
_dependencies!(::DataStructures.OrderedSet{Sugar.LazyMethod}, ::Sugar.LazyMethod{:CL}) at methods.jl:330
_dependencies!(::Sugar.LazyMethod{:CL}, ::Sugar.LazyMethod{:CL}) at methods.jl:323
_dependencies!(::DataStructures.OrderedSet{Sugar.LazyMethod}, ::Sugar.LazyMethod{:CL}) at methods.jl:331
_dependencies!(::Sugar.LazyMethod{:CL}, ::Sugar.LazyMethod{:CL}) at methods.jl:323
_dependencies!(::DataStructures.OrderedSet{Sugar.LazyMethod}, ::Sugar.LazyMethod{:CL}) at methods.jl:331
_dependencies!(::Sugar.LazyMethod{:CL}, ::Sugar.LazyMethod{:CL}) at methods.jl:323
_dependencies!(::DataStructures.OrderedSet{Sugar.LazyMethod}, ::Sugar.LazyMethod{:CL}) at methods.jl:331
dependencies!(::Sugar.LazyMethod{:CL}, ::Bool) at methods.jl:310
(::Transpiler.CLTranspiler.##27#28{Tuple{GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},##13#14,Tuple{Int32,Int32},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}},GPUArrays.CLBackend.#broadcast_kernel,OpenCL.cl.CmdQueue,OpenCL.cl.Context,NTuple{5,DataType}})() at compilation.jl:84
get!(::Transpiler.CLTranspiler.##27#28{Tuple{GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},##13#14,Tuple{Int32,Int32},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}},GPUArrays.CLBackend.#broadcast_kernel,OpenCL.cl.CmdQueue,OpenCL.cl.Context,NTuple{5,DataType}}, ::Dict{Any,Transpiler.CLTranspiler.CLFunction}, ::Tuple{GPUArrays.CLBackend.#broadcast_kernel,NTuple{5,DataType}}) at dict.jl:449
Transpiler.CLTranspiler.CLFunction(::Function, ::Tuple{GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},##13#14,Tuple{Int32,Int32},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}}, ::OpenCL.cl.CmdQueue) at compilation.jl:79
acc_broadcast!(::##13#14, ::GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}, ::Tuple{GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext},GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}}) at opencl.jl:168
broadcast(::Function, ::GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}, ::GPUArrays.GPUArray{Float32,2,OpenCL.cl.Buffer{Float32},GPUArrays.CLBackend.CLContext}) at abstractarray.jl:196
include_string(::String, ::String) at loading.jl:515
eval(::Module, ::Any) at boot.jl:235
(::Atom.##61#64)() at eval.jl:102
withpath(::Atom.##61#64, ::Void) at utils.jl:30
withpath(::Function, ::Void) at eval.jl:38
macro expansion at eval.jl:101 [inlined]
(::Atom.##60#63{Dict{String,Any}})() at task.jl:80

Would a simple fallback would be fine?

uprev .+ 2.*k1

That works. If it can FMA, that's better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions