From 358bf09ef2ed9a7379fad4a7f23be2e6c0375820 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace Date: Mon, 2 May 2022 18:38:38 +0200 Subject: [PATCH 1/4] Limit CUDA compat version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index f2f1d35..961de53 100644 --- a/Project.toml +++ b/Project.toml @@ -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" From 7420f90f0103394e145e6dbee1136be0d7438dad Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace Date: Mon, 2 May 2022 19:04:32 +0200 Subject: [PATCH 2/4] Fix `_temp_epsps` output --- src/myopic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/myopic.jl b/src/myopic.jl index 7a6e8fb..62b4111 100644 --- a/src/myopic.jl +++ b/src/myopic.jl @@ -163,7 +163,7 @@ function _temp_epsps(times, N_star, p_star, q_star, τ_star, dts, ::AnyCuArray) 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(e_temp) end # CPU fallback: From e8ca90fcd8849ca8147559f8a1650a0ecc13c589 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace Date: Mon, 2 May 2022 19:08:38 +0200 Subject: [PATCH 3/4] Refactor and simplify implementation --- src/myopic.jl | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/myopic.jl b/src/myopic.jl index 62b4111..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 cu(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 From 8b05c9e69385f40ccf0c9fe91b8ebe997c78650f Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace Date: Mon, 2 May 2022 19:10:01 +0200 Subject: [PATCH 4/4] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 961de53..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"