Skip to content

Accept static sizes as keyword arguments #570

Open
@maleadt

Description

@maleadt

Kernel closures support passing ndrange and workgroupsize as keyword arguments:

(kernel::Kernel{<:NewBackend})(args...; ndrange=nothing, workgroupsize=nothing)

The kernel function itself probably should too, while it currently only accepts positional versions of these arguments (used to construct static sizes):

function $name(dev::Dev, sz::S, range::NDRange) where {Dev, S <: $_Size, NDRange <: $_Size}
return $construct(dev, sz, range, $gpu_name)
end

IMO this makes the code more readable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions