---
# System prepended metadata

title: '[Greenline] backend selection for greenline/run GPU'
tags: [cycle 19]

---

# [Greenline] greenline run on GPU/flexible backend

- Shaped by: Magdalena
- Appetite (FTEs, weeks):1 Developer  1 week.
- Developers: <!-- Filled in at the betting table unless someone is specifically required here --> Chia Ruui

## Problem
<!-- The raw idea, a use case, or something we’ve seen that motivates us to work on this -->
The greenline granules (`SolveNonHydro`, `Diffusion`) import the backend on the module level. In order to change it needs to be changed in the source code, that makes it very rigid. 

We currently run on the gridtools CPU backend, the GPU backend has never not been tested, we want to make sure that this work as well.

## Appetite
<!-- Explain how much time we want to spend and how that constrains the solution -->
This is mostly a cleanup and consolidation task: sharing the (currently used) backend among all greenline modules should be straight forward. 

Maybe some unforeseen issues might arise when switching to GPU.

## Solution
<!-- The core elements we came up with, presented in a form that’s easy for people to immediately understand -->
- import the backend from a joint common module in all greenline components
- do test run on gpu and fix potential issues.

## Rabbit holes
<!-- Details about the solution worth calling out to avoid problems -->

## No-gos
<!-- Anything specifically excluded from the concept: functionality or use cases we intentionally aren’t covering to fit the ## appetite or make the problem tractable -->

## Progress
<!-- Don't fill during shaping. This area is for collecting TODOs during building. As first task during building add a preliminary list of coarse-grained tasks for the project and refine them with finer-grained items when it makes sense as you work on them. -->

- [x] Task 1 ([PR#xxxx](https://github.com/GridTools/gt4py/pulls))
    - [x] Subtask A
    - [x] Subtask X
- [ ] Task 2
    - [x] Subtask H
    - [ ] Subtask J
- [ ] Discovered Task 3
    - [ ] Subtask L
    - [ ] Subtask S
- [ ] Task 4

