@@ -13,8 +13,7 @@ function create_histogram(input)
1313end
1414
1515# 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)
1817 tid = @index (Global, Linear)
1918 lid = @index (Local, Linear)
2019
7877 all_two = fill (Int32 (2 ), 512 )
7978
8079 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)
8382
8483 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)
8786
8887 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)))
9190
9291 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)
9594 KernelAbstractions. synchronize (backend)
9695
9796 @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)
10099end
0 commit comments