Introduce HIP as a dedicated code generation platform.
pystencils.codegen
Target.HIP
Target.GPU
to alias Target.CurrentGPU
Target.CUDA
or Target.HIP
on GPU systems when using Target.CurrentGPU
pystencils.backend
GenericGpu
platform classHipPlatform
to inherit from GenericGpu
pystencils.jit
CupyJit
to only compile CUDA kernels on NVidia platforms, and only HIP kernels on ROCm platforms
hipcc
will just call nvcc
on Nvidia systems anyway,
and c) cupy needs to be built against the entire ROCm software stack to use HIP.Target.CurrentGPU
throughout the test suite where it is requiredTarget.is_gpu()
to detect GPU targets in all places where previously targets were checked only against Target.CUDA
Since cupy only supports the combinations NVidia+CUDA and ROCm+HIP, we cannot currently test HIP code generation in the CI since we don't have GitLab runners with AMD GPUs.
Separate modelling of CUDA and HIP in the code generator will be necessary to capture architectural differences in !438. Also, it turns out to be very important for the new waLBerla code generator (see https://i10git.cs.fau.de/da15siwa/sfg-walberla); using the target is the easiest way to distinguish between CUDA and HIP for GPU codegen.