KernelAbstractions.jl icon indicating copy to clipboard operation
KernelAbstractions.jl copied to clipboard

Add query function for if we are executing on a GPU

Open vchuravy opened this issue 2 years ago • 3 comments

Requires an API bump since backend need to implement this with device_overlay.

vchuravy avatar Sep 18 '23 19:09 vchuravy

Feels a little ad-hoc. I haven't thought this through, but what about a Device or Accelerator object, which could be used to query additional properties (SIMD width, etc)? The GPU-ness could be a part of the type hierarchy (CUDAGPU <: AbstractGPU <: AbstractAccelerator or whatever).

maleadt avatar Sep 19 '23 15:09 maleadt

Hm yeah, I was thinking current_backend() but Simon wanted the ability to not use it on the top-level.

We could pre-empt some other work I am thinking about and expose something like target() or compilation_target() and and then return a Features struct.

vchuravy avatar Sep 19 '23 16:09 vchuravy

We could pre-empt some other work I am thinking about and expose something like target() or compilation_target() and and then return a Features struct.

Any more thoughts on this?

simonbyrne avatar Nov 27 '23 21:11 simonbyrne