Skip to content

Commit

Permalink
Emit STATE advancement kernels with additive=ON
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenhater committed Sep 9, 2024
1 parent a8a1304 commit f0e456d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions modcc/printer/cprinter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <cmath>
#include <iostream>
#include <regex>
#include <string>
Expand All @@ -19,7 +18,6 @@

using io::indent;
using io::popindent;
using io::quote;

constexpr bool with_profiling() {
#ifdef ARB_HAVE_PROFILING
Expand Down
6 changes: 2 additions & 4 deletions modcc/printer/gpuprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

#include "gpuprinter.hpp"
#include "expression.hpp"
#include "io/ostream_wrappers.hpp"
#include "io/prefixbuf.hpp"
#include "printer/cexpr_emit.hpp"
#include "printer/printerutil.hpp"

using io::indent;
using io::popindent;
using io::quote;

static std::string scaled(double coeff) {
std::stringstream ss;
Expand Down Expand Up @@ -215,7 +213,8 @@ ARB_LIBMODCC_API std::string emit_gpu_cu_source(const Module& module_, const pri
"}}\n\n"),
pp_var_pfx);
}
emit_api_kernel(state_api);
// TODO This needs additive?
emit_api_kernel(state_api, true);
emit_api_kernel(current_api, true);
emit_api_kernel(write_ions_api);

Expand Down Expand Up @@ -471,7 +470,6 @@ void emit_state_update_cu(std::ostream& out,
auto var = deref(d);
auto use_weight = d.always_use_weight || !flags.is_point;
std::string weight = scale + (use_weight ? pp_var_pfx + "weight[tid_]" : "1.0");

if (d.additive && flags.use_additive) {
out << name << " -= " << var << ";\n";
if (flags.is_point) {
Expand Down

0 comments on commit f0e456d

Please sign in to comment.