ERROR: LoadError: GPU compilation of MethodInstance for (::GPUArrays.var"#broadcast_kernel#26")(::CUDA.CuKernelContext, ::CuDeviceMatrix{Float32, 1}, ::Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, typeof(-), Tuple{Base.Broadcast.Extruded{Matrix{Float32}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}, Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float32, CuDeviceVector{Float32, 1}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}, ::Int64) failed

KernelError: passing and using non-bitstype argument

Argument 4 to your kernel function is of type Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, typeof(-), Tuple{Base.Broadcast.Extruded{Matrix{Float32}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}, Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float32, CuDeviceVector{Float32, 1}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}, which is not isbits:

.args is of type Tuple{Base.Broadcast.Extruded{Matrix{Float32}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}, Base.Broadcast.Extruded{LinearAlgebra.Adjoint{Float32, CuDeviceVector{Float32, 1}}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}} which is not isbits.

.1 is of type Base.Broadcast.Extruded{Matrix{Float32}, Tuple{Bool, Bool}, Tuple{Int64, Int64}} which is not isbits.

.x is of type Matrix{Float32} which is not isbits.

```
# Function to calculate the Data loss
function loss_data(phi,θ,p_,coord,data,depVars)
# First data frame corresponding to the velocity data
#println(θ.depvar[:U])
ld = sum([Statistics.mean(abs2,phi[i](coord,θ.depvar[depVars[i]]) .- data[i,:]')/Statistics.mean(abs2,data[i,:]) for i ∈ 1:8])
return ld
end
depVars = [:U, :V, :Θ, :u′u′_mean, :u′v′_mean, :v′v′_mean, :u′θ′_mean, :v′θ′_mean, :P]
loss_data_(phi,θ,p_) = loss_data(phi,θ,p_,coord,data,depVars)
# Discretization using PhysicsInformedNN constructor
discretization = PhysicsInformedNN(chain, strategy, init_params = ps, additional_loss = loss_data_, adaptive_loss = adaptiveLossWeights)
```

The error says that the fourth argument of the kernel function which is the data loss function has a broadcast problem. What is the problem exactly? Can somebody help me out please?

The specific error from GPU compilation that’s mentioned here is from this line "phii .- data[i,:]’ ". @avikpal, @ChrisRackauckas The two terms of the subtraction operation is not happening on the GPU…Why is this the case?But when I try to print the individual components that I’m subtracting (broadcasted subtraction) here, it works fine…Please help me out…?