mrc-ide / odin.dust
Showing 1 of 6 files from the diff.

@@ -121,7 +121,7 @@
Loading
121 121
  i_internal <- vcapply(dat$data$elements[i], "[[", "stage") == "time"
122 122
123 123
  if (is.null(dat$compare)) {
124 -
    data_type <- "typedef dust::no_data data_type;"
124 +
    data_type <- "using data_type = dust::no_data;"
125 125
  } else {
126 126
    data_type <- c(
127 127
      "struct __align__(16) data_type {",
@@ -129,8 +129,8 @@
Loading
129 129
      "};")
130 130
  }
131 131
132 -
  c(sprintf("typedef %s real_type;", dat$meta$dust$real_type),
133 -
    sprintf("typedef %s rng_state_type;", dat$meta$dust$rng_state_type),
132 +
  c(sprintf("using real_type = %s;", dat$meta$dust$real_type),
133 +
    sprintf("using rng_state_type = %s;", dat$meta$dust$rng_state_type),
134 134
    data_type,
135 135
    "struct shared_type {",
136 136
    els[!i_internal],
@@ -215,7 +215,7 @@
Loading
215 215
  internal_type <- sprintf("%s::internal_type", dat$config$base)
216 216
217 217
  body <- collector()
218 -
  body$add("typedef typename %s::real_type real_type;", dat$config$base)
218 +
  body$add("using real_type = typename %s::real_type;", dat$config$base)
219 219
  body$add("auto %s = std::make_shared<%s::shared_type>();",
220 220
           dat$meta$dust$shared, dat$config$base)
221 221
  body$add("%s %s;", internal_type, dat$meta$internal)
@@ -565,7 +565,7 @@
Loading
565 565
                      unname(dat$compare$data),
566 566
                      names(dat$compare$data),
567 567
                      rep(c(",", ""), c(length(dat$compare$data) - 1, 1)))
568 -
  body <- c(sprintf("typedef %s::real_type real_type;", dat$config$base),
568 +
  body <- c(sprintf("using real_type = %s::real_type;", dat$config$base),
569 569
            sprintf("return %s::data_type{", dat$config$base),
570 570
            contents,
571 571
            "  };")
@@ -664,7 +664,7 @@
Loading
664 664
  eqs <- generate_dust_equations(dat, NULL, dat$components$rhs$equations,
665 665
                                 TRUE)
666 666
667 -
  body <- c(sprintf("typedef %s::real_type real_type;", dat$config$base),
667 +
  body <- c(sprintf("using real_type = %s::real_type;", dat$config$base),
668 668
            dust_flatten_eqs(eqs))
669 669
670 670
  c("template<>",
@@ -694,7 +694,7 @@
Loading
694 694
  names(args) <- sub("%s", base, names(args), fixed = TRUE)
695 695
696 696
  body <- collector()
697 -
  body$add("typedef %s::real_type real_type;", base)
697 +
  body$add("using real_type = %s::real_type;", base)
698 698
  body$add(dat$gpu$access[dat$compare$used])
699 699
  body$add(transform_compare_odin_gpu(code))
700 700
@@ -974,6 +974,8 @@
Loading
974 974
  code <- code[-drop]
975 975
976 976
  code <- code[!grepl("typedef\\s+typename\\s+T::real_type\\s+real_type", code)]
977 +
  code <- code[!grepl("using\\s+real_type\\s*=\\s*typename\\s+T::real_type",
978 +
                      code)]
977 979
978 980
  ## As a sanity check here, we'll look at the indenting and make sure
979 981
  ## that everything is at least as indented as the first line:
Files Coverage
R 100.00%
Project Totals (7 files) 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading