|
1 | 1 | synchronize(::CPU) = nothing |
2 | 2 |
|
3 | | -allocate(::CPU, ::Type{T}, dims::Tuple) where {T} = Array{T}(undef, dims) |
| 3 | +allocate(::CPU, ::Type{T}, dims::Tupl; unified::Bool=false) where {T} = Array{T}(undef, dims) |
4 | 4 |
|
5 | | -function zeros(backend::CPU, ::Type{T}, dims::Tuple) where {T} |
6 | | - arr = allocate(backend, T, dims) |
| 5 | +function zeros(backend::CPU, ::Type{T}, dims::Tuple, kwargs...) where {T} |
| 6 | + arr = allocate(backend, T, dims; kwargs...) |
7 | 7 | kernel = init_kernel(backend) |
8 | 8 | kernel(arr, zero, T, ndrange = length(arr)) |
9 | 9 | return arr |
10 | 10 | end |
11 | | -function ones(backend::CPU, ::Type{T}, dims::Tuple) where {T} |
12 | | - arr = allocate(backend, T, dims) |
| 11 | +function ones(backend::CPU, ::Type{T}, dims::Tuple, kwargs...) where {T} |
| 12 | + arr = allocate(backend, T, dims; kwargs...) |
13 | 13 | kernel = init_kernel(backend) |
14 | 14 | kernel(arr, one, T; ndrange = length(arr)) |
15 | 15 | return arr |
|
33 | 33 |
|
34 | 34 | functional(::CPU) = true |
35 | 35 | pagelock!(::CPU, x) = nothing |
| 36 | +supports_unified(::CPU) = true |
36 | 37 |
|
37 | 38 | function (obj::Kernel{CPU})(args...; ndrange = nothing, workgroupsize = nothing) |
38 | 39 | ndrange, workgroupsize, iterspace, dynamic = launch_config(obj, ndrange, workgroupsize) |
|
0 commit comments