Skip to content
Snippets Groups Projects
Verified Commit 44e4bd4a authored by Dorian Stoll's avatar Dorian Stoll
Browse files

rodinia-srad: julia: Switch to libc RNG

parent ac3810e4
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@
using Printf
using Random
const RAND_MAX::Float32 = 2147483647.0
function usage()
prog = basename(Base.source_path())
# println(STDERR,"Usage ",prog," <rows> <cols> <y1> <y2> <x1> <x2> <no. of threads><lamda> <no. of iter>")
......@@ -55,7 +57,15 @@ function main(args)
println("Randomizing the input matrix")
I = rand(Float32, rows, cols)
@ccall srand(7::Cint)::Cvoid
I::Matrix{Float32} = zeros(rows, cols)
for i in 1:size(I, 1)
for j in 1:size(I, 2)
I[i, j] = (@ccall rand()::Cint) / RAND_MAX
end
end
J = exp.(I)
c::Matrix{Float32} = zeros(rows,cols)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment