I have a function f(x,y,z) defined as
<code>global a = 1.0
fucntion f(x, y, z)
return a*x^2 + y*z
end
</code>
<code>global a = 1.0
fucntion f(x, y, z)
return a*x^2 + y*z
end
</code>
global a = 1.0
fucntion f(x, y, z)
return a*x^2 + y*z
end
How to calculate the sum of function values at 10000 different points by using CUDA?
I ask GPT and it tells me to define a function such as
<code>function kernel_function!(results, x, y, z)
i = threadIdx().x + (blockIdx().x - 1) * blockDim().x
if i <= length(results)
results[i] = f(x[i], y[i], z[i])
end
end
</code>
<code>function kernel_function!(results, x, y, z)
i = threadIdx().x + (blockIdx().x - 1) * blockDim().x
if i <= length(results)
results[i] = f(x[i], y[i], z[i])
end
end
</code>
function kernel_function!(results, x, y, z)
i = threadIdx().x + (blockIdx().x - 1) * blockDim().x
if i <= length(results)
results[i] = f(x[i], y[i], z[i])
end
end
But it does not seem to work.