Skip to content

Commit

Permalink
Introduce Persistent Temporary Fields and Mesh to the Cuda Backend (#…
Browse files Browse the repository at this point in the history
…1089)

## Technical Description

Currently, temporary fields are allocated in the constructor of the generated class. Since the API functions to the FORTRAN and cpp drivers hold the stencil on the stack, this leads to memory (de-)allocation on each call. This is fine for debugging, but not for production runs. Thus, this PR keeps that behavior for the convenience wrappers starting from host memory, but introduces static `setup` and `free` functions which have to be called by the host when using the production interface which assumes device pointers. 

Additionally, since the APIs are touched either way, globals can now be communicated from FORTRAN to the CUDA backend. 

Furthermore this PR contains a small refactoring and removes the (now) superfluous template parameter from the generated stencil class

### Resolves / Enhances

Addresses part of #1038 
Fixes #1042
### Testing

Since this affects the CUDA-ico backend this is tested by `icondusk-e2e`
  • Loading branch information
mroethlin committed Jan 18, 2021
1 parent 10d08b4 commit f56e306
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 171 deletions.
2 changes: 1 addition & 1 deletion dawn/src/dawn/AST/ASTExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ class ReductionOverNeighborExpr : public Expr {
// due to current design limitations (getChildren() returning a view into memory), the operands
// hold a copy of the (shared pointer to) the weights
std::vector<std::shared_ptr<Expr>> operands_ = std::vector<std::shared_ptr<Expr>>(2);
bool chainIsValid() const;
bool chainIsValid() const;

public:
/// @name Constructor & Destructor
Expand Down
Loading

0 comments on commit f56e306

Please sign in to comment.