From 9cfd2495591ef6eb069755d4cd902e6fbaaaa276 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Fri, 14 Apr 2023 14:10:50 +0200 Subject: [PATCH] Work around SciML bug. --- src/compiler/compilation.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl index b454cd06d8..6b4984dd47 100644 --- a/src/compiler/compilation.jl +++ b/src/compiler/compilation.jl @@ -406,7 +406,10 @@ end end # device-side call to an opaque closure -function (oc::OpaqueClosure{F,E,A,R})(args...) where {F,E,A,R} +(oc::OpaqueClosure)(args...) = call(oc, args...) +## NOTE: split into two to make `SciML.isinplace(oc)` work. +## it also resembles how kernels are called. +@inline function call(oc::OpaqueClosure{F,E,A,R}, args...) where {F,E,A,R} ptr = ccall("extern deferred_codegen", llvmcall, Ptr{Cvoid}, (Int,), F) assume(ptr != C_NULL) #ccall(ptr, R, (A...), args...)