blas-benchmarks/benchmark-sample.R

19 lines
292 B
R
Raw Normal View History

2016-05-29 17:57:09 +02:00
runs = 10
2016-04-29 14:13:49 +02:00
f = function()
{
2016-05-29 17:57:09 +02:00
set.seed (1)
2016-05-30 17:49:09 +02:00
m <- 3500
n <- 3500
2016-05-29 17:57:09 +02:00
A <- matrix (runif (m*n),m,n)
2016-04-29 14:13:49 +02:00
2016-05-29 17:57:09 +02:00
# Matrix multiply
B <- crossprod(A)
2016-04-29 14:13:49 +02:00
}
2016-05-29 17:57:09 +02:00
cumulate = 0
for (i in 1:runs)
cumulate = cumulate + as.numeric(system.time(f())[3])
cat(paste0(round(cumulate/runs, 3), "\n"))