Skip to content

Commit cf85ebd

Browse files
authored
Merge pull request #19 from JuliaGPU/vc/uniform
mark values used in localmem initialization as uniform
2 parents be57a24 + edb76d5 commit cf85ebd

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/accumulate/accumulate_1d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919
# NOTE: shmem_size MUST be greater than 2 * block_size
2020
# NOTE: block_size MUST be a power of 2
2121
len = length(v)
22-
block_size = @groupsize()[1]
22+
@uniform block_size = @groupsize()[1]
2323
temp = @localmem eltype(v) (0x2 * block_size + conflict_free_offset(0x2 * block_size),)
2424

2525
# NOTE: for many index calculations in this library, computation using zero-indexing leads to

src/accumulate/accumulate_nd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ end
7373
length_dims = vsizes[dims]
7474
length_outer = length(v) ÷ length_dims
7575

76-
block_size = @groupsize()[1]
76+
@uniform block_size = @groupsize()[1]
7777

7878
temp = @localmem eltype(v) (0x2 * block_size + conflict_free_offset(0x2 * block_size),)
7979
running_prefix = @localmem eltype(v) (1,)

src/reduce/mapreduce_1d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@kernel inbounds=true cpu=false function _mapreduce_block!(@Const(src), dst, f, op, init)
22

3-
N = @groupsize()[1]
3+
@uniform N = @groupsize()[1]
44
sdata = @localmem eltype(dst) (N,)
55

66
len = length(src)

src/reduce/mapreduce_nd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ end
7878

7979
ndims = length(src_sizes)
8080

81-
N = @groupsize()[1]
81+
@uniform N = @groupsize()[1]
8282
sdata = @localmem eltype(dst) (N,)
8383

8484
# NOTE: for many index calculations in this library, computation using zero-indexing leads to

src/reduce/reduce_1d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@kernel inbounds=true cpu=false function _reduce_block!(@Const(src), dst, op, init)
22

3-
N = @groupsize()[1]
3+
@uniform N = @groupsize()[1]
44
sdata = @localmem eltype(dst) (N,)
55

66
len = length(src)

src/reduce/reduce_nd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ end
7878

7979
ndims = length(src_sizes)
8080

81-
N = @groupsize()[1]
81+
@uniform N = @groupsize()[1]
8282
sdata = @localmem eltype(dst) (N,)
8383

8484
# NOTE: for many index calculations in this library, computation using zero-indexing leads to

src/sort/merge_sort.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@kernel inbounds=true function _merge_sort_block!(vec, comp)
22

3-
N = @groupsize()[1]
3+
@uniform N = @groupsize()[1]
44
s_buf = @localmem eltype(vec) (N * 0x2,)
55

66
T = eltype(vec)

src/sort/merge_sort_by_key.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@kernel inbounds=true function _merge_sort_by_key_block!(keys, values, comp)
22

3-
N = @groupsize()[1]
3+
@uniform N = @groupsize()[1]
44
s_keys = @localmem eltype(keys) (N * 0x2,)
55
s_values = @localmem eltype(values) (N * 0x2,)
66

0 commit comments

Comments
 (0)