@@ -13,8 +13,7 @@ function create_histogram(input)
13
13
end
14
14
15
15
# This a 1D histogram kernel where the histogramming happens on shmem
16
- # @kernel unsafe_indices=true function histogram_kernel!(histogram_output, input)
17
- @kernel function histogram_kernel! (histogram_output, input)
16
+ @kernel unsafe_indices= true function histogram_kernel! (histogram_output, input)
18
17
tid = @index (Global, Linear)
19
18
lid = @index (Local, Linear)
20
19
78
77
all_two = fill (Int32 (2 ), 512 )
79
78
80
79
histogram_rand_baseline = create_histogram (rand_input)
81
- # histogram_linear_baseline = create_histogram(linear_input)
82
- # histogram_two_baseline = create_histogram(all_two)
80
+ histogram_linear_baseline = create_histogram (linear_input)
81
+ histogram_two_baseline = create_histogram (all_two)
83
82
84
83
rand_input = move (backend, rand_input)
85
- # linear_input = move(backend, linear_input)
86
- # all_two = move(backend, all_two)
84
+ linear_input = move (backend, linear_input)
85
+ all_two = move (backend, all_two)
87
86
88
87
rand_histogram = KernelAbstractions. zeros (backend, eltype (rand_input), Int (maximum (rand_input)))
89
- # linear_histogram = KernelAbstractions.zeros(backend, eltype(linear_input), Int(maximum(linear_input)))
90
- # two_histogram = KernelAbstractions.zeros(backend, eltype(all_two), Int(maximum(all_two)))
88
+ linear_histogram = KernelAbstractions. zeros (backend, eltype (linear_input), Int (maximum (linear_input)))
89
+ two_histogram = KernelAbstractions. zeros (backend, eltype (all_two), Int (maximum (all_two)))
91
90
92
91
histogram! (rand_histogram, rand_input, 6 )
93
- # histogram!(linear_histogram, linear_input)
94
- # histogram!(two_histogram, all_two)
92
+ histogram! (linear_histogram, linear_input)
93
+ histogram! (two_histogram, all_two)
95
94
KernelAbstractions. synchronize (backend)
96
95
97
96
@test isapprox (Array (rand_histogram), histogram_rand_baseline)
98
- # @test isapprox(Array(linear_histogram), histogram_linear_baseline)
99
- # @test isapprox(Array(two_histogram), histogram_two_baseline)
97
+ @test isapprox (Array (linear_histogram), histogram_linear_baseline)
98
+ @test isapprox (Array (two_histogram), histogram_two_baseline)
100
99
end
0 commit comments