diff --git a/Project.toml b/Project.toml index f2f1d35..3c4b0e1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BinomialSynapses" uuid = "8a0f34ba-5679-4d46-87d2-b44c4b1cf105" authors = ["Simone Carlo Surace", "Camille Gontier"] -version = "0.4.2" +version = "0.4.3" [deps] BinomialGPU = "c5bbfde1-2136-42cd-9b65-d5719df69ebf" @@ -14,7 +14,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] BinomialGPU = "0.3, 0.4" -CUDA = "3" +CUDA = "3.8" Distributions = "0.25" LaTeXStrings = "1" Plots = "1" diff --git a/src/myopic.jl b/src/myopic.jl index 7a6e8fb..ccc4c69 100644 --- a/src/myopic.jl +++ b/src/myopic.jl @@ -150,24 +150,15 @@ function _temp_epsps(sim) end function _temp_epsps(times, N_star, p_star, q_star, τ_star, dts, ::AnyCuArray) - x = 1. - L = length(times) - if L > 1 - for ii in 2:L - x = 1-(1-(1-p_star)*x)*exp(-(times[ii]-times[ii-1])/τ_star) - end - end - - e_temp = zeros(Float32, length(dts)) - for kk in 1:length(e_temp) - x_temp = 1-(1-(1-p_star)*x)*exp(-dts[kk]/τ_star) - e_temp[kk] = x_temp*N_star*p_star*q_star - end - return e_temp + return cu(_temp_epsps(times, N_star, p_star, q_star, τ_star, dts)) end # CPU fallback: function _temp_epsps(times, N_star, p_star, q_star, τ_star, dts, ::AbstractArray) + return _temp_epsps(times, N_star, p_star, q_star, τ_star, dts) +end + +function _temp_epsps(times, N_star, p_star, q_star, τ_star, dts) x = 1. L = length(times) if L > 1