omlins / ParallelStencil.jl

Package for writing high-level code for parallel high-performance stencil computations that can be deployed on both GPUs and CPUs
BSD 3-Clause "New" or "Revised" License
322 stars 38 forks source link

Use multiple dispatch for allocators #49

Closed omlins closed 2 years ago

omlins commented 2 years ago

This PR enables to handle @zeros, @rand and @ones with a datatype argument, e.g., @zeros(Float16, 2, 3) and without, e.g., @zeros(2, 3) by dispatching at runtime the right function invocation. This avoids any type instability.