diff --git a/Makefile b/Makefile index ec6bd386..0d43a640 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/README.md b/README.md index fc4e9f22..dee371b0 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,10 @@ YASK contains a domain-specific compiler to convert stencil-equation specificati large shared-memory (shm) regions, so those versions are not recommended when using the `-use_shm` feature. This issue was resolved in MPI version 2019u3. - * There is an issue in the Intel C++ compiler 2019.1.x that causes + * There is an issue in the Intel C++ compiler 2019.1.0 that causes an internal error when building YASK kernels. - Use 2019.0.5 to work around until a patch is released. + This has been fixed in 19.1.1. + You may also use 2019.0.x to work around this. * If you are using g++ version 8.x or later, Intel(R) C++ version 2019 is required. * Building a YASK kernel with clang is possible; however, @@ -77,6 +78,10 @@ YASK contains a domain-specific compiler to convert stencil-equation specificati ## Backward-compatibility notices ### Version 3 +* Version 3.04.00 changed the terms "pack" and "pass" to "stage", which may affect + user-written result parsers. Option `auto_tune_each_pass` changed to + `auto_tune_each_stage`. + * Version 3.01.00 moved the `-trace` and `-msg_rank` options from the kernel library to the kernel utility, so those options may no longer be set via `yk_solution::apply_command_line_options()`. APIs to set the corresponding diff --git a/YASK-LICENSE.md b/YASK-LICENSE.md index cc631848..cfb35c85 100644 --- a/YASK-LICENSE.md +++ b/YASK-LICENSE.md @@ -1,5 +1,5 @@ YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/docs/YASK-tutorial.pdf b/docs/YASK-tutorial.pdf index 6f7d2d23..fdb6a57b 100644 Binary files a/docs/YASK-tutorial.pdf and b/docs/YASK-tutorial.pdf differ diff --git a/docs/api/html/yask__common__api_8hpp_source.html b/docs/api/html/yask__common__api_8hpp_source.html index 63d2219b..4ce41780 100644 --- a/docs/api/html/yask__common__api_8hpp_source.html +++ b/docs/api/html/yask__common__api_8hpp_source.html @@ -70,7 +70,7 @@
yask_common_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include <string>
35 #include <vector>
36 #include <map>
37 #include <iostream>
38 #include <ostream>
39 #include <memory>
40 #include <functional>
41 
42 namespace yask {
43 
50 
54  std::string yask_get_version_string();
55 
57 
58 #ifdef SWIG
59  typedef long int idx_t; // SWIG doesn't seem to understand int64_t.
60 #else
61  typedef std::int64_t idx_t;
62 #endif
63 
64  // Forward declarations of class-pointers.
65 
66  class yask_output;
68  typedef std::shared_ptr<yask_output> yask_output_ptr;
69 
72  typedef std::shared_ptr<yask_file_output> yask_file_output_ptr;
73 
76  typedef std::shared_ptr<yask_string_output> yask_string_output_ptr;
77 
80  typedef std::shared_ptr<yask_stdout_output> yask_stdout_output_ptr;
81 
84  typedef std::shared_ptr<yask_null_output> yask_null_output_ptr;
85 
87 
88  class yask_exception: public std::exception {
89  private:
91  std::string _msg;
92 
93  public:
94 
97  _msg("YASK exception") { };
98 
100  yask_exception(const std::string& message) :
101  _msg(message) { };
102 
103  virtual ~yask_exception() { };
104 
106 
108  virtual const char* what() const noexcept;
109 
111  virtual void add_message(const std::string& message );
113 
115 
117  virtual const char* get_message() const;
118  };
119 
122  public:
123  virtual ~yask_output_factory() {}
124 
126 
131  virtual yask_file_output_ptr
132  new_file_output(const std::string& file_name ) const;
135 
137 
141  virtual yask_string_output_ptr
142  new_string_output() const;
143 
145 
149  virtual yask_stdout_output_ptr
150  new_stdout_output() const;
151 
153 
157  virtual yask_null_output_ptr
158  new_null_output() const;
159  };
160 
162  class yask_output {
163  public:
164  virtual ~yask_output() {}
165 
167 
168  virtual std::ostream& get_ostream() =0;
169  };
170 
172  class yask_file_output : public virtual yask_output {
173  public:
174  virtual ~yask_file_output() {}
175 
177 
178  virtual std::string get_filename() const =0;
179 
181  virtual void close() =0;
182  };
183 
185  class yask_string_output : public virtual yask_output {
186  public:
187  virtual ~yask_string_output() {}
188 
190 
192  virtual std::string get_string() const =0;
193 
195  virtual void discard() =0;
196  };
197 
199  class yask_stdout_output : public virtual yask_output {
200  public:
201  virtual ~yask_stdout_output() {}
202  };
203 
205 
206  class yask_null_output : public virtual yask_output {
207  public:
208  virtual ~yask_null_output() {}
209  };
210 
212 
218  std::vector<double>
219  get_center_fd_coefficients(int derivative_order,
221  int radius );
223 
225 
230  std::vector<double>
231  get_forward_fd_coefficients(int derivative_order,
233  int accuracy_order );
235 
237 
242  std::vector<double>
243  get_backward_fd_coefficients(int derivative_order,
245  int accuracy_order );
247 
249 
252  std::vector<double>
253  get_arbitrary_fd_coefficients(int derivative_order,
255  double eval_point,
257  const std::vector<double> sample_points );
259 
262 } // namespace yask.
263 
std::shared_ptr< yask_null_output > yask_null_output_ptr
Shared pointer to yask_null_output.
Definition: yask_common_api.hpp:82
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include <string>
35 #include <vector>
36 #include <map>
37 #include <iostream>
38 #include <ostream>
39 #include <memory>
40 #include <functional>
41 
42 namespace yask {
43 
50 
54  std::string yask_get_version_string();
55 
57 
58 #ifdef SWIG
59  typedef long int idx_t; // SWIG doesn't seem to understand int64_t.
60 #else
61  typedef std::int64_t idx_t;
62 #endif
63 
64  // Forward declarations of class-pointers.
65 
66  class yask_output;
68  typedef std::shared_ptr<yask_output> yask_output_ptr;
69 
72  typedef std::shared_ptr<yask_file_output> yask_file_output_ptr;
73 
76  typedef std::shared_ptr<yask_string_output> yask_string_output_ptr;
77 
80  typedef std::shared_ptr<yask_stdout_output> yask_stdout_output_ptr;
81 
84  typedef std::shared_ptr<yask_null_output> yask_null_output_ptr;
85 
87 
88  class yask_exception: public std::exception {
89  private:
91  std::string _msg;
92 
93  public:
94 
97  _msg("YASK exception") { };
98 
100  yask_exception(const std::string& message) :
101  _msg(message) { };
102 
103  virtual ~yask_exception() { };
104 
106 
108  virtual const char* what() const noexcept;
109 
111  virtual void add_message(const std::string& message );
113 
115 
117  virtual const char* get_message() const;
118  };
119 
122  public:
123  virtual ~yask_output_factory() {}
124 
126 
131  virtual yask_file_output_ptr
132  new_file_output(const std::string& file_name ) const;
135 
137 
141  virtual yask_string_output_ptr
142  new_string_output() const;
143 
145 
149  virtual yask_stdout_output_ptr
150  new_stdout_output() const;
151 
153 
157  virtual yask_null_output_ptr
158  new_null_output() const;
159  };
160 
162  class yask_output {
163  public:
164  virtual ~yask_output() {}
165 
167 
168  virtual std::ostream& get_ostream() =0;
169  };
170 
172  class yask_file_output : public virtual yask_output {
173  public:
174  virtual ~yask_file_output() {}
175 
177 
178  virtual std::string get_filename() const =0;
179 
181  virtual void close() =0;
182  };
183 
185  class yask_string_output : public virtual yask_output {
186  public:
187  virtual ~yask_string_output() {}
188 
190 
192  virtual std::string get_string() const =0;
193 
195  virtual void discard() =0;
196  };
197 
199  class yask_stdout_output : public virtual yask_output {
200  public:
201  virtual ~yask_stdout_output() {}
202  };
203 
205 
206  class yask_null_output : public virtual yask_output {
207  public:
208  virtual ~yask_null_output() {}
209  };
210 
212 
218  std::vector<double>
219  get_center_fd_coefficients(int derivative_order,
221  int radius );
223 
225 
230  std::vector<double>
231  get_forward_fd_coefficients(int derivative_order,
233  int accuracy_order );
235 
237 
242  std::vector<double>
243  get_backward_fd_coefficients(int derivative_order,
245  int accuracy_order );
247 
249 
252  std::vector<double>
253  get_arbitrary_fd_coefficients(int derivative_order,
255  double eval_point,
257  const std::vector<double> sample_points );
259 
262 } // namespace yask.
263 
std::shared_ptr< yask_null_output > yask_null_output_ptr
Shared pointer to yask_null_output.
Definition: yask_common_api.hpp:82
std::shared_ptr< yask_file_output > yask_file_output_ptr
Shared pointer to yask_file_output.
Definition: yask_common_api.hpp:70
Exception from YASK framework.
Definition: yask_common_api.hpp:88
std::vector< double > get_backward_fd_coefficients(int derivative_order, int accuracy_order)
Create finite-difference (FD) coefficients for the standard backward form.
diff --git a/docs/api/html/yask__compiler__api_8hpp_source.html b/docs/api/html/yask__compiler__api_8hpp_source.html index 32826b18..23385ead 100644 --- a/docs/api/html/yask__compiler__api_8hpp_source.html +++ b/docs/api/html/yask__compiler__api_8hpp_source.html @@ -70,7 +70,7 @@
yask_compiler_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_common_api.hpp"
35 #include <functional>
36 #include <vector>
37 
38 namespace yask {
39 
46  // Forward declarations of classes and their pointers.
47  // See yask_compiler_api.hpp for more.
48 
49  class yc_solution;
51  typedef std::shared_ptr<yc_solution> yc_solution_ptr;
52 
53  class yc_var;
55  typedef yc_var* yc_var_ptr;
56 
57  // Forward declarations of expression nodes and their pointers.
58 
59  class yc_expr_node;
61  typedef std::shared_ptr<yc_expr_node> yc_expr_node_ptr;
62 
63  class yc_bool_node;
65  typedef std::shared_ptr<yc_bool_node> yc_bool_node_ptr;
66 
69  typedef std::shared_ptr<yc_number_node> yc_number_node_ptr;
70 
73  typedef std::shared_ptr<yc_index_node> yc_index_node_ptr;
74 
77  typedef std::shared_ptr<yc_equation_node> yc_equation_node_ptr;
78 
81  typedef std::shared_ptr<yc_var_point_node> yc_var_point_node_ptr;
82 
84 }
85 
86 #include "aux/yc_node_api.hpp"
87 
88 namespace yask {
89 
95  class yc_factory {
97  public:
98  virtual ~yc_factory() {}
99 
101 
104  virtual std::string
106 
108 
112  virtual yc_solution_ptr
113  new_solution(const std::string& name ) const;
115  }; // yc_factory.
116 
118 
123  class yc_solution {
124  public:
125  virtual ~yc_solution() {}
126 
128  virtual void
132 
134 
138  virtual std::string
139  get_name() const =0;
140 
142 
145  virtual void
146  set_name(std::string name ) =0;
148 
150 
154  virtual std::string
155  get_description() const =0;
156 
158 
163  virtual void
164  set_description(std::string description ) =0;
166 
168 
173  virtual std::string
174  get_target() =0;
175 
177 
193  virtual void
194  set_target(
195  const std::string& format) =0;
196 
198 
202  virtual bool
203  is_target_set() =0;
204 
206 
207  virtual int
208  get_element_bytes() const =0;
209 
211  virtual void
212  set_element_bytes(int nbytes ) =0;
214 
216 
246  virtual yc_var_ptr
247  new_var(const std::string& name,
250  const std::vector<yc_index_node_ptr>& dims ) =0;
253 
254 #ifndef SWIG
255 
262  virtual yc_var_ptr
263  new_var(const std::string& name ,
266  const std::initializer_list<yc_index_node_ptr>& dims ) =0;
269 #endif
270 
272 
287  virtual yc_var_ptr
288  new_scratch_var(const std::string& name,
291  const std::vector<yc_index_node_ptr>& dims ) =0;
294 
295 #ifndef SWIG
296 
303  virtual yc_var_ptr
304  new_scratch_var(const std::string& name,
308  const std::initializer_list<yc_index_node_ptr>& dims ) =0;
311 #endif
312 
314 
317  virtual int
318  get_num_vars() const =0;
319 
321 
322  virtual std::vector<yc_var_ptr>
323  get_vars() =0;
324 
326 
327  virtual yc_var_ptr
328  get_var(const std::string& name ) =0;
329 
331 
346  virtual void
350  int len ) =0;
351 
353 
357  virtual bool
358  is_folding_set() =0;
359 
361  virtual void
362  clear_folding() =0;
363 
365 
372  virtual void
376  int mult ) =0;
377 
379 
383  virtual bool
384  is_clustering_set() =0;
385 
387  virtual void
388  clear_clustering() =0;
389 
391 
393  virtual int
394  get_num_equations() const =0;
395 
397 
399  virtual std::vector<yc_equation_node_ptr>
400  get_equations() =0;
401 
403 
407  virtual int
409  int level) =0;
410 
412 
416  virtual void
418  int level,
421  int distance) =0;
422 
424 
435  virtual void
436  output_solution(yask_output_ptr output) =0;
439 
440 #ifndef SWIG
441  typedef std::function<void(yc_solution& soln,
444 
446 
458  virtual void
460  output_hook_t hook_fn) =0;
461 #endif
462 
464 
487  virtual void
488  call_after_new_solution(const std::string& code) =0;
492 
494 
498 #define CALL_AFTER_NEW_SOLUTION(...) call_after_new_solution(#__VA_ARGS__)
499 
501 
510  virtual void
511  set_domain_dims(const std::vector<yc_index_node_ptr>& dims ) =0;
513 
514 #ifndef SWIG
515 
521  virtual void
522  set_domain_dims(const std::initializer_list<yc_index_node_ptr>& dims ) =0;
524 #endif
525 
527 
534  virtual void
535  set_step_dim(const yc_index_node_ptr dim) =0;
537 
539 
548  virtual void
549  set_dependency_checker_enabled(bool enable) =0;
551 
553 
556  virtual bool
558 
560 
629  virtual void
632  yc_equation_node_ptr to) =0;
634 
636 
639  virtual void
640  clear_dependencies() =0;
641 
643  inline void
644  format(const std::string& format_type,
645  yask_output_ptr output) {
646  set_target(format_type);
647  output_solution(output);
648  }
649 
651  inline yc_var_ptr
652  new_grid(const std::string& name,
653  const std::vector<yc_index_node_ptr>& dims) {
654  return new_var(name, dims);
655  }
656 
657 #ifndef SWIG
658  inline yc_var_ptr
660  new_grid(const std::string& name,
661  const std::initializer_list<yc_index_node_ptr>& dims) {
662  return new_var(name, dims);
663  }
664 #endif
665 
667  inline yc_var_ptr
668  new_scratch_grid(const std::string& name,
669  const std::vector<yc_index_node_ptr>& dims) {
670  return new_scratch_var(name, dims);
671  }
672 
673 #ifndef SWIG
674  inline yc_var_ptr
676  new_scratch_grid(const std::string& name,
677  const std::initializer_list<yc_index_node_ptr>& dims) {
678  return new_scratch_var(name, dims);
679  }
680 #endif
681 
683  inline int
684  get_num_grids() const {
685  return get_num_vars();
686  }
687 
689  inline std::vector<yc_var_ptr>
691  return get_vars();
692  }
693 
695  inline yc_var_ptr
696  get_grid(const std::string& name) {
697  return get_var(name);
698  }
699  }; // yc_solution.
700 
702 
711  class yc_var {
712  public:
713  virtual ~yc_var() {}
714 
716 
718  virtual const std::string& get_name() const =0;
719 
721 
723  virtual int get_num_dims() const =0;
724 
726 
731  virtual std::vector<std::string>
732  get_dim_names() const =0;
733 
735 
740  virtual yc_var_point_node_ptr
741  new_var_point(const std::vector<yc_number_node_ptr>& index_exprs ) =0;
745 
746 #ifndef SWIG
747 
757  virtual yc_var_point_node_ptr
758  new_var_point(const std::initializer_list<yc_number_node_ptr>& index_exprs) = 0;
759 #endif
760 
762 
777  virtual yc_var_point_node_ptr
778  new_relative_var_point(const std::vector<int>& dim_offsets ) =0;
780 
781 #ifndef SWIG
782 
788  virtual yc_var_point_node_ptr
789  new_relative_var_point(const std::initializer_list<int>& dim_offsets) = 0;
790 #endif
791 
793 
796  virtual bool
797  is_dynamic_step_alloc() const =0;
798 
800 
803  virtual void
804  set_dynamic_step_alloc(bool is_dynamic) =0;
806 
808 
814  virtual idx_t
815  get_step_alloc_size() const =0;
816 
818 
822  virtual void
823  set_step_alloc_size(idx_t size) =0;
825 
827  inline yc_var_point_node_ptr
828  new_grid_point(const std::vector<yc_number_node_ptr>& index_exprs) {
829  return new_var_point(index_exprs);
830  }
832  inline yc_var_point_node_ptr
833  new_grid_point(const std::initializer_list<yc_number_node_ptr>& index_exprs) {
834  return new_var_point(index_exprs);
835  }
837  inline yc_var_point_node_ptr
838  new_relative_grid_point(const std::vector<int>& dim_offsets) {
839  return new_relative_var_point(dim_offsets);
840  }
842  inline yc_var_point_node_ptr
843  new_relative_grid_point(const std::initializer_list<int>& dim_offsets) {
844  return new_relative_var_point(dim_offsets);
845  }
846 
847  }; // yc_var.
848 
850 
882  class yc_var_proxy {
883  private:
884  yc_var_ptr _var;
885 
886  public:
887 
889 
893  yc_var_proxy(const std::string& name,
896  yc_solution_ptr soln,
898  const std::vector< yc_index_node_ptr > &dims,
901  bool is_scratch = false) {
903  if (is_scratch)
904  _var = soln->new_scratch_var(name, dims);
905  else
906  _var = soln->new_var(name, dims);
907  }
908 
909 #ifndef SWIG
910 
916  yc_var_proxy(const std::string& name,
919  yc_solution_ptr soln,
921  const std::initializer_list< yc_index_node_ptr > &dims,
924  bool is_scratch = false) {
926  if (is_scratch)
927  _var = soln->new_scratch_var(name, dims);
928  else
929  _var = soln->new_var(name, dims);
930  }
931 #endif
932 
934 
937  yc_var_proxy(const std::string& name,
940  yc_solution_ptr soln) {
942  _var = soln->new_var(name, { });
943  }
944 
946 
950  yc_var_proxy(yc_var_ptr& var) : _var(var) { }
951 
953  virtual ~yc_var_proxy() { }
954 
956  virtual yc_var_ptr get_var() {
957  return _var;
958  }
959 
961  virtual const yc_var_ptr get_var() const {
962  return _var;
963  }
964 
966 
972  virtual yc_var_point_node_ptr
973  operator()(const std::vector<yc_number_node_ptr>& index_exprs) {
974  return _var->new_var_point(index_exprs);
975  }
976 
977 #ifndef SWIG
978 
986  virtual yc_var_point_node_ptr
987  operator()(const std::initializer_list<yc_number_node_ptr>& index_exprs) {
988  return _var->new_var_point(index_exprs);
989  }
990 
992 
1001  const yc_number_any_arg i2 = nullptr,
1002  const yc_number_any_arg i3 = nullptr,
1003  const yc_number_any_arg i4 = nullptr,
1004  const yc_number_any_arg i5 = nullptr,
1005  const yc_number_any_arg i6 = nullptr) {
1006  std::vector<yc_number_node_ptr> args;
1007  if (i1)
1008  args.push_back(i1);
1009  if (i2)
1010  args.push_back(i2);
1011  if (i3)
1012  args.push_back(i3);
1013  if (i4)
1014  args.push_back(i4);
1015  if (i5)
1016  args.push_back(i5);
1017  if (i6)
1018  args.push_back(i6);
1019  return _var->new_var_point(args);
1020  }
1021 
1023 
1030  virtual operator yc_number_ptr_arg() {
1031  return _var->new_var_point({});
1032  }
1033 
1035 
1043  return _var->new_var_point({i1});
1044  }
1045 
1046 #endif
1047 
1048  }; // yc_var_proxy.
1051  typedef yc_var yc_grid;
1059 
1060 } // namespace yask.
1061 
1062 // More solution-based objects.
1063 #include "aux/yc_solution_api.hpp"
virtual void output_solution(yask_output_ptr output)=0
Optimize and the current equation(s) and write to given output object.
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_common_api.hpp"
35 #include <functional>
36 #include <vector>
37 
38 namespace yask {
39 
46  // Forward declarations of classes and their pointers.
47  // See yask_compiler_api.hpp for more.
48 
49  class yc_solution;
51  typedef std::shared_ptr<yc_solution> yc_solution_ptr;
52 
53  class yc_var;
55  typedef yc_var* yc_var_ptr;
56 
57  // Forward declarations of expression nodes and their pointers.
58 
59  class yc_expr_node;
61  typedef std::shared_ptr<yc_expr_node> yc_expr_node_ptr;
62 
63  class yc_bool_node;
65  typedef std::shared_ptr<yc_bool_node> yc_bool_node_ptr;
66 
69  typedef std::shared_ptr<yc_number_node> yc_number_node_ptr;
70 
73  typedef std::shared_ptr<yc_index_node> yc_index_node_ptr;
74 
77  typedef std::shared_ptr<yc_equation_node> yc_equation_node_ptr;
78 
81  typedef std::shared_ptr<yc_var_point_node> yc_var_point_node_ptr;
82 
84 }
85 
86 #include "aux/yc_node_api.hpp"
87 
88 namespace yask {
89 
95  class yc_factory {
97  public:
98  virtual ~yc_factory() {}
99 
101 
104  virtual std::string
106 
108 
112  virtual yc_solution_ptr
113  new_solution(const std::string& name ) const;
115  }; // yc_factory.
116 
118 
123  class yc_solution {
124  public:
125  virtual ~yc_solution() {}
126 
128  virtual void
132 
134 
138  virtual std::string
139  get_name() const =0;
140 
142 
145  virtual void
146  set_name(std::string name ) =0;
148 
150 
154  virtual std::string
155  get_description() const =0;
156 
158 
163  virtual void
164  set_description(std::string description ) =0;
166 
168 
173  virtual std::string
174  get_target() =0;
175 
177 
193  virtual void
194  set_target(
195  const std::string& format) =0;
196 
198 
202  virtual bool
203  is_target_set() =0;
204 
206 
207  virtual int
208  get_element_bytes() const =0;
209 
211  virtual void
212  set_element_bytes(int nbytes ) =0;
214 
216 
246  virtual yc_var_ptr
247  new_var(const std::string& name,
250  const std::vector<yc_index_node_ptr>& dims ) =0;
253 
254 #ifndef SWIG
255 
262  virtual yc_var_ptr
263  new_var(const std::string& name ,
266  const std::initializer_list<yc_index_node_ptr>& dims ) =0;
269 #endif
270 
272 
287  virtual yc_var_ptr
288  new_scratch_var(const std::string& name,
291  const std::vector<yc_index_node_ptr>& dims ) =0;
294 
295 #ifndef SWIG
296 
303  virtual yc_var_ptr
304  new_scratch_var(const std::string& name,
308  const std::initializer_list<yc_index_node_ptr>& dims ) =0;
311 #endif
312 
314 
317  virtual int
318  get_num_vars() const =0;
319 
321 
322  virtual std::vector<yc_var_ptr>
323  get_vars() =0;
324 
326 
327  virtual yc_var_ptr
328  get_var(const std::string& name ) =0;
329 
331 
346  virtual void
350  int len ) =0;
351 
353 
357  virtual bool
358  is_folding_set() =0;
359 
361  virtual void
362  clear_folding() =0;
363 
365 
372  virtual void
376  int mult ) =0;
377 
379 
383  virtual bool
384  is_clustering_set() =0;
385 
387  virtual void
388  clear_clustering() =0;
389 
391 
393  virtual int
394  get_num_equations() const =0;
395 
397 
399  virtual std::vector<yc_equation_node_ptr>
400  get_equations() =0;
401 
403 
407  virtual int
409  int level) =0;
410 
412 
416  virtual void
418  int level,
421  int distance) =0;
422 
424 
435  virtual void
436  output_solution(yask_output_ptr output) =0;
439 
440 #ifndef SWIG
441  typedef std::function<void(yc_solution& soln,
444 
446 
458  virtual void
460  output_hook_t hook_fn) =0;
461 #endif
462 
464 
487  virtual void
488  call_after_new_solution(const std::string& code) =0;
492 
494 
498 #define CALL_AFTER_NEW_SOLUTION(...) call_after_new_solution(#__VA_ARGS__)
499 
501 
510  virtual void
511  set_domain_dims(const std::vector<yc_index_node_ptr>& dims ) =0;
513 
514 #ifndef SWIG
515 
521  virtual void
522  set_domain_dims(const std::initializer_list<yc_index_node_ptr>& dims ) =0;
524 #endif
525 
527 
534  virtual void
535  set_step_dim(const yc_index_node_ptr dim) =0;
537 
539 
548  virtual void
549  set_dependency_checker_enabled(bool enable) =0;
551 
553 
556  virtual bool
558 
560 
629  virtual void
632  yc_equation_node_ptr to) =0;
634 
636 
639  virtual void
640  clear_dependencies() =0;
641 
643  inline void
644  format(const std::string& format_type,
645  yask_output_ptr output) {
646  set_target(format_type);
647  output_solution(output);
648  }
649 
651  inline yc_var_ptr
652  new_grid(const std::string& name,
653  const std::vector<yc_index_node_ptr>& dims) {
654  return new_var(name, dims);
655  }
656 
657 #ifndef SWIG
658  inline yc_var_ptr
660  new_grid(const std::string& name,
661  const std::initializer_list<yc_index_node_ptr>& dims) {
662  return new_var(name, dims);
663  }
664 #endif
665 
667  inline yc_var_ptr
668  new_scratch_grid(const std::string& name,
669  const std::vector<yc_index_node_ptr>& dims) {
670  return new_scratch_var(name, dims);
671  }
672 
673 #ifndef SWIG
674  inline yc_var_ptr
676  new_scratch_grid(const std::string& name,
677  const std::initializer_list<yc_index_node_ptr>& dims) {
678  return new_scratch_var(name, dims);
679  }
680 #endif
681 
683  inline int
684  get_num_grids() const {
685  return get_num_vars();
686  }
687 
689  inline std::vector<yc_var_ptr>
691  return get_vars();
692  }
693 
695  inline yc_var_ptr
696  get_grid(const std::string& name) {
697  return get_var(name);
698  }
699  }; // yc_solution.
700 
702 
711  class yc_var {
712  public:
713  virtual ~yc_var() {}
714 
716 
718  virtual const std::string& get_name() const =0;
719 
721 
723  virtual int get_num_dims() const =0;
724 
726 
731  virtual std::vector<std::string>
732  get_dim_names() const =0;
733 
735 
740  virtual yc_var_point_node_ptr
741  new_var_point(const std::vector<yc_number_node_ptr>& index_exprs ) =0;
745 
746 #ifndef SWIG
747 
757  virtual yc_var_point_node_ptr
758  new_var_point(const std::initializer_list<yc_number_node_ptr>& index_exprs) = 0;
759 #endif
760 
762 
777  virtual yc_var_point_node_ptr
778  new_relative_var_point(const std::vector<int>& dim_offsets ) =0;
780 
781 #ifndef SWIG
782 
788  virtual yc_var_point_node_ptr
789  new_relative_var_point(const std::initializer_list<int>& dim_offsets) = 0;
790 #endif
791 
793 
796  virtual bool
797  is_dynamic_step_alloc() const =0;
798 
800 
803  virtual void
804  set_dynamic_step_alloc(bool is_dynamic) =0;
806 
808 
814  virtual idx_t
815  get_step_alloc_size() const =0;
816 
818 
822  virtual void
823  set_step_alloc_size(idx_t size) =0;
825 
827  inline yc_var_point_node_ptr
828  new_grid_point(const std::vector<yc_number_node_ptr>& index_exprs) {
829  return new_var_point(index_exprs);
830  }
832  inline yc_var_point_node_ptr
833  new_grid_point(const std::initializer_list<yc_number_node_ptr>& index_exprs) {
834  return new_var_point(index_exprs);
835  }
837  inline yc_var_point_node_ptr
838  new_relative_grid_point(const std::vector<int>& dim_offsets) {
839  return new_relative_var_point(dim_offsets);
840  }
842  inline yc_var_point_node_ptr
843  new_relative_grid_point(const std::initializer_list<int>& dim_offsets) {
844  return new_relative_var_point(dim_offsets);
845  }
846 
847  }; // yc_var.
848 
850 
882  class yc_var_proxy {
883  private:
884  yc_var_ptr _var;
885 
886  public:
887 
889 
893  yc_var_proxy(const std::string& name,
896  yc_solution_ptr soln,
898  const std::vector< yc_index_node_ptr > &dims,
901  bool is_scratch = false) {
903  if (is_scratch)
904  _var = soln->new_scratch_var(name, dims);
905  else
906  _var = soln->new_var(name, dims);
907  }
908 
909 #ifndef SWIG
910 
916  yc_var_proxy(const std::string& name,
919  yc_solution_ptr soln,
921  const std::initializer_list< yc_index_node_ptr > &dims,
924  bool is_scratch = false) {
926  if (is_scratch)
927  _var = soln->new_scratch_var(name, dims);
928  else
929  _var = soln->new_var(name, dims);
930  }
931 #endif
932 
934 
937  yc_var_proxy(const std::string& name,
940  yc_solution_ptr soln) {
942  _var = soln->new_var(name, { });
943  }
944 
946 
950  yc_var_proxy(yc_var_ptr& var) : _var(var) { }
951 
953  virtual ~yc_var_proxy() { }
954 
956  virtual yc_var_ptr get_var() {
957  return _var;
958  }
959 
961  virtual const yc_var_ptr get_var() const {
962  return _var;
963  }
964 
966 
972  virtual yc_var_point_node_ptr
973  operator()(const std::vector<yc_number_node_ptr>& index_exprs) {
974  return _var->new_var_point(index_exprs);
975  }
976 
977 #ifndef SWIG
978 
986  virtual yc_var_point_node_ptr
987  operator()(const std::initializer_list<yc_number_node_ptr>& index_exprs) {
988  return _var->new_var_point(index_exprs);
989  }
990 
992 
1001  const yc_number_any_arg i2 = nullptr,
1002  const yc_number_any_arg i3 = nullptr,
1003  const yc_number_any_arg i4 = nullptr,
1004  const yc_number_any_arg i5 = nullptr,
1005  const yc_number_any_arg i6 = nullptr) {
1006  std::vector<yc_number_node_ptr> args;
1007  if (i1)
1008  args.push_back(i1);
1009  if (i2)
1010  args.push_back(i2);
1011  if (i3)
1012  args.push_back(i3);
1013  if (i4)
1014  args.push_back(i4);
1015  if (i5)
1016  args.push_back(i5);
1017  if (i6)
1018  args.push_back(i6);
1019  return _var->new_var_point(args);
1020  }
1021 
1023 
1030  virtual operator yc_number_ptr_arg() {
1031  return _var->new_var_point({});
1032  }
1033 
1035 
1043  return _var->new_var_point({i1});
1044  }
1045 
1046 #endif
1047 
1048  }; // yc_var_proxy.
1051  typedef yc_var yc_grid;
1059 
1060 } // namespace yask.
1061 
1062 // More solution-based objects.
1063 #include "aux/yc_solution_api.hpp"
virtual void output_solution(yask_output_ptr output)=0
Optimize and the current equation(s) and write to given output object.
Arguments that may be YASK or non-YASK numeric types.
Definition: yc_node_api.hpp:560
virtual yc_var_ptr get_var()
Get the underlying yc_var pointer.
Definition: yask_compiler_api.hpp:956
virtual void clear_dependencies()=0
[Advanced] Remove all existing dependencies.
diff --git a/docs/api/html/yask__kernel__api_8hpp_source.html b/docs/api/html/yask__kernel__api_8hpp_source.html index 4045c7ff..6fb3dc89 100644 --- a/docs/api/html/yask__kernel__api_8hpp_source.html +++ b/docs/api/html/yask__kernel__api_8hpp_source.html @@ -70,7 +70,7 @@
yask_kernel_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_common_api.hpp"
35 #include <vector>
36 #include <cinttypes>
37 
38 #ifndef MPI_VERSION
39 typedef int MPI_Comm;
40 #endif
41 
42 namespace yask {
43 
50  // Forward declarations of classes and pointers.
51 
52  class yk_env;
54  typedef std::shared_ptr<yk_env> yk_env_ptr;
55 
56  class yk_solution;
58  typedef std::shared_ptr<yk_solution> yk_solution_ptr;
59 
60  class yk_var;
62  typedef std::shared_ptr<yk_var> yk_var_ptr;
63 
64  class yk_stats;
66  typedef std::shared_ptr<yk_stats> yk_stats_ptr;
67 
69 } // namespace yask.
70 
71 #include "aux/yk_solution_api.hpp"
72 #include "aux/yk_var_api.hpp"
73 
74 namespace yask {
75 
81  class yk_factory {
83  public:
84  yk_factory();
85  virtual ~yk_factory() {}
86 
88 
91  virtual std::string
93 
95 
123  virtual yk_env_ptr
124  new_env() const;
125 
127 
136  virtual yk_env_ptr
137  new_env(MPI_Comm comm) const;
138 
140 
145  virtual yk_solution_ptr
146  new_solution(yk_env_ptr env ) const;
147 
149 
156  virtual yk_solution_ptr
158  const yk_solution_ptr source ) const;
161  }; // yk_factory.
162 
164 
167  class yk_env {
168  public:
169  virtual ~yk_env() {}
170 
172  virtual void
176 
178 
182  virtual yask_output_ptr
183  get_debug_output() const =0;
184 
186 
189  virtual void
190  set_trace_enabled(bool enable) =0;
191 
193 
196  virtual int get_num_ranks() const =0;
197 
199 
202  virtual int get_rank_index() const =0;
203 
205 
209  virtual void
210  global_barrier() const =0;
211 
212  }; // yk_env.
213 
215  typedef yk_var yk_grid;
218 
221 } // namespace yask.
Statistics from calls to run_solution().
Definition: yk_solution_api.hpp:1040
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_common_api.hpp"
35 #include <vector>
36 #include <cinttypes>
37 
38 #ifndef MPI_VERSION
39 typedef int MPI_Comm;
40 #endif
41 
42 namespace yask {
43 
50  // Forward declarations of classes and pointers.
51 
52  class yk_env;
54  typedef std::shared_ptr<yk_env> yk_env_ptr;
55 
56  class yk_solution;
58  typedef std::shared_ptr<yk_solution> yk_solution_ptr;
59 
60  class yk_var;
62  typedef std::shared_ptr<yk_var> yk_var_ptr;
63 
64  class yk_stats;
66  typedef std::shared_ptr<yk_stats> yk_stats_ptr;
67 
69 } // namespace yask.
70 
71 #include "aux/yk_solution_api.hpp"
72 #include "aux/yk_var_api.hpp"
73 
74 namespace yask {
75 
81  class yk_factory {
83  public:
84  yk_factory();
85  virtual ~yk_factory() {}
86 
88 
91  virtual std::string
93 
95 
123  virtual yk_env_ptr
124  new_env() const;
125 
127 
136  virtual yk_env_ptr
137  new_env(MPI_Comm comm) const;
138 
140 
145  virtual yk_solution_ptr
146  new_solution(yk_env_ptr env ) const;
147 
149 
156  virtual yk_solution_ptr
158  const yk_solution_ptr source ) const;
161  }; // yk_factory.
162 
164 
167  class yk_env {
168  public:
169  virtual ~yk_env() {}
170 
172  virtual void
176 
178 
182  virtual yask_output_ptr
183  get_debug_output() const =0;
184 
186 
189  virtual void
190  set_trace_enabled(bool enable) =0;
191 
193 
196  virtual int get_num_ranks() const =0;
197 
199 
202  virtual int get_rank_index() const =0;
203 
205 
209  virtual void
210  global_barrier() const =0;
211 
212  }; // yk_env.
213 
215  typedef yk_var yk_grid;
218 
221 } // namespace yask.
Statistics from calls to run_solution().
Definition: yk_solution_api.hpp:1040
std::shared_ptr< yk_stats > yk_stats_ptr
Shared pointer to yk_stats.
Definition: yask_kernel_api.hpp:64
Kernel environment.
Definition: yask_kernel_api.hpp:167
virtual yk_env_ptr new_env() const
Create an object to hold environment information.
diff --git a/docs/api/html/yc__node__api_8hpp_source.html b/docs/api/html/yc__node__api_8hpp_source.html index c6ff1faf..36b43d45 100644 --- a/docs/api/html/yc__node__api_8hpp_source.html +++ b/docs/api/html/yc__node__api_8hpp_source.html @@ -70,7 +70,7 @@
yc_node_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 namespace yask {
35 
41  // More node types not exposed except via RTTI.
42 
45  typedef std::shared_ptr<yc_const_number_node> yc_const_number_node_ptr;
46 
49  typedef std::shared_ptr<yc_negate_node> yc_negate_node_ptr;
50 
53  typedef std::shared_ptr<yc_commutative_number_node> yc_commutative_number_node_ptr;
54 
57  typedef std::shared_ptr<yc_binary_number_node> yc_binary_number_node_ptr;
58 
61  typedef std::shared_ptr<yc_binary_bool_node> yc_binary_bool_node_ptr;
62 
65  typedef std::shared_ptr<yc_binary_comparison_node> yc_binary_comparison_node_ptr;
66 
67  class yc_add_node;
69  typedef std::shared_ptr<yc_add_node> yc_add_node_ptr;
70 
73  typedef std::shared_ptr<yc_multiply_node> yc_multiply_node_ptr;
74 
77  typedef std::shared_ptr<yc_subtract_node> yc_subtract_node_ptr;
78 
81  typedef std::shared_ptr<yc_divide_node> yc_divide_node_ptr;
82 
83  class yc_mod_node;
85  typedef std::shared_ptr<yc_mod_node> yc_mod_node_ptr;
86 
87  class yc_not_node;
89  typedef std::shared_ptr<yc_not_node> yc_not_node_ptr;
90 
93  typedef std::shared_ptr<yc_equals_node> yc_equals_node_ptr;
94 
97  typedef std::shared_ptr<yc_not_equals_node> yc_not_equals_node_ptr;
98 
101  typedef std::shared_ptr<yc_less_than_node> yc_less_than_node_ptr;
102 
105  typedef std::shared_ptr<yc_greater_than_node> yc_greater_than_node_ptr;
106 
109  typedef std::shared_ptr<yc_not_less_than_node> yc_not_less_than_node_ptr;
110 
113  typedef std::shared_ptr<yc_not_greater_than_node> yc_not_greater_than_node_ptr;
114 
115  class yc_and_node;
117  typedef std::shared_ptr<yc_and_node> yc_and_node_ptr;
118 
119  class yc_or_node;
121  typedef std::shared_ptr<yc_or_node> yc_or_node_ptr;
122 
124 
125  class yc_expr_node {
126  public:
127  virtual ~yc_expr_node() {}
128 
130 
134  virtual std::string format_simple() const =0;
135 
137 
141  virtual int get_num_nodes() const =0;
142  };
143 
145 
149  class yc_equation_node : public virtual yc_expr_node {
150  public:
151 
153 
154  virtual yc_var_point_node_ptr get_lhs() =0;
155 
157 
158  virtual yc_number_node_ptr get_rhs() =0;
159 
161 
163  virtual yc_bool_node_ptr get_cond() =0;
164 
166 
207  virtual void set_cond(yc_bool_node_ptr sub_domain_cond ) =0;
211 
213 
236  virtual void set_step_cond(yc_bool_node_ptr step_cond ) =0;
240 
242  virtual yc_equation_node_ptr clone_ast() const =0;
243  };
244 
246 
247  class yc_number_node : public virtual yc_expr_node {
248  public:
249 
251  virtual yc_number_node_ptr clone_ast() const =0;
252  };
253 
255 
256  class yc_bool_node : public virtual yc_expr_node {
257  public:
258 
260  virtual yc_bool_node_ptr clone_ast() const =0;
261  };
262 
264 
270  class yc_index_node : public virtual yc_number_node {
271  public:
272 
274 
275  virtual const std::string&
276  get_name() const =0;
277  };
278 
280 
283  class yc_var_point_node : public virtual yc_number_node {
284  public:
285 
287 
288  virtual yc_var_ptr
289  get_var() =0;
290 
292  inline yc_var_ptr
294  return get_var();
295  }
296  };
297 
299 
303  class yc_const_number_node : public virtual yc_number_node {
304  public:
305 
307 
309  virtual void
310  set_value(double val ) =0;
311 
313 
314  virtual double
315  get_value() const =0;
316  };
317 
319 
322  class yc_negate_node : public virtual yc_number_node {
323  public:
324 
326 
329  virtual yc_number_node_ptr
330  get_rhs() =0;
331  };
332 
334 
337  public:
338 
340 
345  virtual int
346  get_num_operands() =0;
347 
349 
350  virtual std::vector<yc_number_node_ptr>
351  get_operands() =0;
352 
354  virtual void
356  };
357 
359 
360  class yc_add_node : public virtual yc_commutative_number_node { };
361 
363 
364  class yc_multiply_node : public virtual yc_commutative_number_node { };
365 
367 
369  class yc_binary_number_node : public virtual yc_number_node {
370  public:
371 
373  virtual yc_number_node_ptr
374  get_lhs() =0;
375 
377  virtual yc_number_node_ptr
378  get_rhs() =0;
379  };
380 
382 
383  class yc_subtract_node : public virtual yc_binary_number_node { };
384 
386 
387  class yc_divide_node : public virtual yc_binary_number_node { };
388 
390 
391  class yc_mod_node : public virtual yc_binary_number_node { };
392 
394 
397  class yc_not_node : public virtual yc_bool_node {
398  public:
399 
401 
402  virtual yc_bool_node_ptr
403  get_rhs() =0;
404  };
405 
407  class yc_binary_bool_node : public virtual yc_bool_node {
408  public:
409 
411  virtual yc_bool_node_ptr
412  get_lhs() =0;
413 
415  virtual yc_bool_node_ptr
416  get_rhs() =0;
417  };
418 
420 
423  class yc_and_node : public virtual yc_binary_bool_node { };
424 
426 
429  class yc_or_node : public virtual yc_binary_bool_node { };
430 
432  class yc_binary_comparison_node : public virtual yc_bool_node {
433  public:
434 
436 
437  virtual yc_number_node_ptr
438  get_lhs() =0;
439 
441 
442  virtual yc_number_node_ptr
443  get_rhs() =0;
444  };
445 
447 
450  class yc_equals_node : public virtual yc_binary_comparison_node { };
451 
453 
456  class yc_not_equals_node : public virtual yc_binary_comparison_node { };
457 
459 
462  class yc_less_than_node : public virtual yc_binary_comparison_node { };
463 
465 
469 
471 
475 
477 
481 
482 #ifndef SWIG
483 
495 
496  public:
497 
500  yc_number_node_ptr(p) { }
501 
504  yc_number_node_ptr(p) { }
505 
508  yc_number_node_ptr(p) { }
509  };
510 
512 
523 
524  protected:
525 
527  yc_number_node_ptr _convert_const(double val) const;
528 
529  public:
530 
534 
538 
542 
546  };
547 
549 
561 
562  protected:
563 
565  yc_number_node_ptr _convert_const(double val) const;
566 
567  public:
568 
571  yc_number_node_ptr(p) { }
572 
575  yc_number_node_ptr(p) { }
576 
579  yc_number_node_ptr(p) { }
580 
584 
588 
590  yc_number_any_arg(double f) :
592 
594  yc_number_any_arg(float f) :
596 
598  yc_number_any_arg(std::nullptr_t p) :
599  yc_number_node_ptr(p) { }
600  };
601 #endif
602 
604 
607  public:
608  virtual ~yc_node_factory() {}
609 
611 
617  virtual yc_index_node_ptr
618  new_step_index(const std::string& name ) const;
620 
622 
634  virtual yc_index_node_ptr
635  new_domain_index(const std::string& name ) const;
637 
639 
647  virtual yc_index_node_ptr
648  new_misc_index(const std::string& name ) const;
650 
652 
678  virtual yc_equation_node_ptr
681  yc_number_node_ptr rhs,
683  yc_bool_node_ptr sub_domain_cond = nullptr ) const;
686 
687 #ifndef SWIG
688 
694  virtual yc_number_node_ptr
697  return std::move(arg);
698  }
699 #endif
700 
702 
708  virtual yc_number_node_ptr
709  new_const_number_node(double val ) const;
711 
713 
719  virtual yc_number_node_ptr
720  new_const_number_node(idx_t val ) const;
722 
724 
729  virtual yc_number_node_ptr
732 
734 
740  virtual yc_number_node_ptr
742  yc_number_node_ptr rhs ) const;
743 
745 
751  virtual yc_number_node_ptr
753  yc_number_node_ptr rhs ) const;
754 
756 
766  virtual yc_number_node_ptr
768  yc_number_node_ptr rhs ) const;
769 
771 
778  virtual yc_number_node_ptr
780  yc_number_node_ptr rhs ) const;
781 
783 
790  virtual yc_number_node_ptr
792  yc_number_node_ptr rhs ) const;
793 
795 
804  virtual yc_number_node_ptr
807 
809 
818  virtual yc_number_node_ptr
821 
823 
829  virtual yc_bool_node_ptr
830  new_not_node(yc_bool_node_ptr rhs ) const;
831 
833 
839  virtual yc_bool_node_ptr
841  yc_bool_node_ptr rhs ) const;
842 
844 
850  virtual yc_bool_node_ptr
852  yc_bool_node_ptr rhs ) const;
853 
855 
860  virtual yc_bool_node_ptr
862  yc_number_node_ptr rhs ) const;
863 
865 
870  virtual yc_bool_node_ptr
872  yc_number_node_ptr rhs ) const;
873 
875 
880  virtual yc_bool_node_ptr
882  yc_number_node_ptr rhs ) const;
883 
885 
890  virtual yc_bool_node_ptr
892  yc_number_node_ptr rhs ) const;
893 
895 
900  virtual yc_bool_node_ptr
902  yc_number_node_ptr rhs ) const;
903 
905 
910  virtual yc_bool_node_ptr
912  yc_number_node_ptr rhs ) const;
913 
914  };
915 
917 #define UNARY_MATH_EXPR(fn_name) \
918  yc_number_node_ptr fn_name(const yc_number_node_ptr rhs)
919 
921  UNARY_MATH_EXPR(sqrt);
923  UNARY_MATH_EXPR(cbrt);
925  UNARY_MATH_EXPR(fabs);
927  UNARY_MATH_EXPR(erf);
929  UNARY_MATH_EXPR(exp);
931  UNARY_MATH_EXPR(log);
933  UNARY_MATH_EXPR(sin);
935  UNARY_MATH_EXPR(cos);
937  UNARY_MATH_EXPR(atan);
938 #undef UNARY_MATH_EXPR
939 
941 #define BINARY_MATH_EXPR(fn_name) \
942  yc_number_node_ptr fn_name(const yc_number_node_ptr arg1, const yc_number_node_ptr arg2); \
943  yc_number_node_ptr fn_name(double arg1, const yc_number_node_ptr arg2); \
944  yc_number_node_ptr fn_name(const yc_number_node_ptr arg1, double arg2)
945 
947 
951  BINARY_MATH_EXPR(pow);
952 #undef BINARY_MATH_EXPR
953 
954 #if !defined SWIG
955 
956  // Non-class operators.
957  // These are not defined for SWIG because
958  // the Python operators are defined in the ".i" file.
959  // For the binary operators, we define 3 combinations to implicitly
960  // avoid the const-const combinations, which conflict with built-in
961  // operators on fundamental C++ types, e.g., '5+8'.
962 
964  yc_number_node_ptr operator-(yc_number_ptr_arg rhs);
965 
967  yc_number_node_ptr operator+(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
969  yc_number_node_ptr operator+(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
971  yc_number_node_ptr operator+(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
972 
974  yc_number_node_ptr operator/(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
976  yc_number_node_ptr operator/(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
978  yc_number_node_ptr operator/(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
979 
981  yc_number_node_ptr operator%(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
983  yc_number_node_ptr operator%(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
985  yc_number_node_ptr operator%(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
986 
988  yc_number_node_ptr operator*(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
990  yc_number_node_ptr operator*(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
992  yc_number_node_ptr operator*(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
993 
995  yc_number_node_ptr operator-(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
997  yc_number_node_ptr operator-(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
999  yc_number_node_ptr operator-(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
1000 
1004  void operator+=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1005 
1009  void operator-=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1010 
1014  void operator*=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1015 
1019  void operator/=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1020 
1022 
1024 
1026 
1028 
1030 
1032 
1034 
1040 #define BOOL_OPER(oper, fn) \
1041  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_number_node_ptr rhs) { \
1042  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1043  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_index_node_ptr rhs) { \
1044  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1045  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
1046  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1047  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_number_node_ptr rhs) { \
1048  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1049  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_index_node_ptr rhs) { \
1050  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1051  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
1052  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1053  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_number_node_ptr rhs) { \
1054  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1055  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_index_node_ptr rhs) { \
1056  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1057  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
1058  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1059  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, double rhs) { \
1060  yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); } \
1061  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, double rhs) { \
1062  yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); } \
1063  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, double rhs) { \
1064  yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); }
1065 
1066  BOOL_OPER(==, new_equals_node)
1067  BOOL_OPER(!=, new_not_equals_node)
1068  BOOL_OPER(<, new_less_than_node)
1069  BOOL_OPER(>, new_greater_than_node)
1070  BOOL_OPER(<=, new_not_greater_than_node)
1071  BOOL_OPER(>=, new_not_less_than_node)
1072 #undef BOOL_OPER
1073 
1075 
1083 #define EQUALS <<
1084 
1086  yc_equation_node_ptr operator EQUALS(yc_var_point_node_ptr gpp, const yc_number_any_arg rhs);
1087 
1089 
1093 #define IF_DOMAIN ^=
1094 
1097  const yc_bool_node_ptr cond);
1098 
1100 
1104 #define IF_STEP |=
1105 
1108  const yc_bool_node_ptr cond);
1109 
1110 #endif // !SWIG.
1111 
1114 } // namespace yask.
virtual yc_bool_node_ptr get_rhs()=0
Get the [only] operand.
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 namespace yask {
35 
41  // More node types not exposed except via RTTI.
42 
45  typedef std::shared_ptr<yc_const_number_node> yc_const_number_node_ptr;
46 
49  typedef std::shared_ptr<yc_negate_node> yc_negate_node_ptr;
50 
53  typedef std::shared_ptr<yc_commutative_number_node> yc_commutative_number_node_ptr;
54 
57  typedef std::shared_ptr<yc_binary_number_node> yc_binary_number_node_ptr;
58 
61  typedef std::shared_ptr<yc_binary_bool_node> yc_binary_bool_node_ptr;
62 
65  typedef std::shared_ptr<yc_binary_comparison_node> yc_binary_comparison_node_ptr;
66 
67  class yc_add_node;
69  typedef std::shared_ptr<yc_add_node> yc_add_node_ptr;
70 
73  typedef std::shared_ptr<yc_multiply_node> yc_multiply_node_ptr;
74 
77  typedef std::shared_ptr<yc_subtract_node> yc_subtract_node_ptr;
78 
81  typedef std::shared_ptr<yc_divide_node> yc_divide_node_ptr;
82 
83  class yc_mod_node;
85  typedef std::shared_ptr<yc_mod_node> yc_mod_node_ptr;
86 
87  class yc_not_node;
89  typedef std::shared_ptr<yc_not_node> yc_not_node_ptr;
90 
93  typedef std::shared_ptr<yc_equals_node> yc_equals_node_ptr;
94 
97  typedef std::shared_ptr<yc_not_equals_node> yc_not_equals_node_ptr;
98 
101  typedef std::shared_ptr<yc_less_than_node> yc_less_than_node_ptr;
102 
105  typedef std::shared_ptr<yc_greater_than_node> yc_greater_than_node_ptr;
106 
109  typedef std::shared_ptr<yc_not_less_than_node> yc_not_less_than_node_ptr;
110 
113  typedef std::shared_ptr<yc_not_greater_than_node> yc_not_greater_than_node_ptr;
114 
115  class yc_and_node;
117  typedef std::shared_ptr<yc_and_node> yc_and_node_ptr;
118 
119  class yc_or_node;
121  typedef std::shared_ptr<yc_or_node> yc_or_node_ptr;
122 
124 
125  class yc_expr_node {
126  public:
127  virtual ~yc_expr_node() {}
128 
130 
134  virtual std::string format_simple() const =0;
135 
137 
141  virtual int get_num_nodes() const =0;
142  };
143 
145 
149  class yc_equation_node : public virtual yc_expr_node {
150  public:
151 
153 
154  virtual yc_var_point_node_ptr get_lhs() =0;
155 
157 
158  virtual yc_number_node_ptr get_rhs() =0;
159 
161 
163  virtual yc_bool_node_ptr get_cond() =0;
164 
166 
207  virtual void set_cond(yc_bool_node_ptr sub_domain_cond ) =0;
211 
213 
236  virtual void set_step_cond(yc_bool_node_ptr step_cond ) =0;
240 
242  virtual yc_equation_node_ptr clone_ast() const =0;
243  };
244 
246 
247  class yc_number_node : public virtual yc_expr_node {
248  public:
249 
251  virtual yc_number_node_ptr clone_ast() const =0;
252  };
253 
255 
256  class yc_bool_node : public virtual yc_expr_node {
257  public:
258 
260  virtual yc_bool_node_ptr clone_ast() const =0;
261  };
262 
264 
270  class yc_index_node : public virtual yc_number_node {
271  public:
272 
274 
275  virtual const std::string&
276  get_name() const =0;
277  };
278 
280 
283  class yc_var_point_node : public virtual yc_number_node {
284  public:
285 
287 
288  virtual yc_var_ptr
289  get_var() =0;
290 
292  inline yc_var_ptr
294  return get_var();
295  }
296  };
297 
299 
303  class yc_const_number_node : public virtual yc_number_node {
304  public:
305 
307 
309  virtual void
310  set_value(double val ) =0;
311 
313 
314  virtual double
315  get_value() const =0;
316  };
317 
319 
322  class yc_negate_node : public virtual yc_number_node {
323  public:
324 
326 
329  virtual yc_number_node_ptr
330  get_rhs() =0;
331  };
332 
334 
337  public:
338 
340 
345  virtual int
346  get_num_operands() =0;
347 
349 
350  virtual std::vector<yc_number_node_ptr>
351  get_operands() =0;
352 
354  virtual void
356  };
357 
359 
360  class yc_add_node : public virtual yc_commutative_number_node { };
361 
363 
364  class yc_multiply_node : public virtual yc_commutative_number_node { };
365 
367 
369  class yc_binary_number_node : public virtual yc_number_node {
370  public:
371 
373  virtual yc_number_node_ptr
374  get_lhs() =0;
375 
377  virtual yc_number_node_ptr
378  get_rhs() =0;
379  };
380 
382 
383  class yc_subtract_node : public virtual yc_binary_number_node { };
384 
386 
387  class yc_divide_node : public virtual yc_binary_number_node { };
388 
390 
391  class yc_mod_node : public virtual yc_binary_number_node { };
392 
394 
397  class yc_not_node : public virtual yc_bool_node {
398  public:
399 
401 
402  virtual yc_bool_node_ptr
403  get_rhs() =0;
404  };
405 
407  class yc_binary_bool_node : public virtual yc_bool_node {
408  public:
409 
411  virtual yc_bool_node_ptr
412  get_lhs() =0;
413 
415  virtual yc_bool_node_ptr
416  get_rhs() =0;
417  };
418 
420 
423  class yc_and_node : public virtual yc_binary_bool_node { };
424 
426 
429  class yc_or_node : public virtual yc_binary_bool_node { };
430 
432  class yc_binary_comparison_node : public virtual yc_bool_node {
433  public:
434 
436 
437  virtual yc_number_node_ptr
438  get_lhs() =0;
439 
441 
442  virtual yc_number_node_ptr
443  get_rhs() =0;
444  };
445 
447 
450  class yc_equals_node : public virtual yc_binary_comparison_node { };
451 
453 
456  class yc_not_equals_node : public virtual yc_binary_comparison_node { };
457 
459 
462  class yc_less_than_node : public virtual yc_binary_comparison_node { };
463 
465 
469 
471 
475 
477 
481 
482 #ifndef SWIG
483 
495 
496  public:
497 
500  yc_number_node_ptr(p) { }
501 
504  yc_number_node_ptr(p) { }
505 
508  yc_number_node_ptr(p) { }
509  };
510 
512 
523 
524  protected:
525 
527  yc_number_node_ptr _convert_const(double val) const;
528 
529  public:
530 
534 
538 
542 
546  };
547 
549 
561 
562  protected:
563 
565  yc_number_node_ptr _convert_const(double val) const;
566 
567  public:
568 
571  yc_number_node_ptr(p) { }
572 
575  yc_number_node_ptr(p) { }
576 
579  yc_number_node_ptr(p) { }
580 
584 
588 
590  yc_number_any_arg(double f) :
592 
594  yc_number_any_arg(float f) :
596 
598  yc_number_any_arg(std::nullptr_t p) :
599  yc_number_node_ptr(p) { }
600  };
601 #endif
602 
604 
607  public:
608  virtual ~yc_node_factory() {}
609 
611 
617  virtual yc_index_node_ptr
618  new_step_index(const std::string& name ) const;
620 
622 
634  virtual yc_index_node_ptr
635  new_domain_index(const std::string& name ) const;
637 
639 
647  virtual yc_index_node_ptr
648  new_misc_index(const std::string& name ) const;
650 
652 
678  virtual yc_equation_node_ptr
681  yc_number_node_ptr rhs,
683  yc_bool_node_ptr sub_domain_cond = nullptr ) const;
686 
687 #ifndef SWIG
688 
694  virtual yc_number_node_ptr
697  return std::move(arg);
698  }
699 #endif
700 
702 
708  virtual yc_number_node_ptr
709  new_const_number_node(double val ) const;
711 
713 
719  virtual yc_number_node_ptr
720  new_const_number_node(idx_t val ) const;
722 
724 
729  virtual yc_number_node_ptr
732 
734 
740  virtual yc_number_node_ptr
742  yc_number_node_ptr rhs ) const;
743 
745 
751  virtual yc_number_node_ptr
753  yc_number_node_ptr rhs ) const;
754 
756 
766  virtual yc_number_node_ptr
768  yc_number_node_ptr rhs ) const;
769 
771 
778  virtual yc_number_node_ptr
780  yc_number_node_ptr rhs ) const;
781 
783 
790  virtual yc_number_node_ptr
792  yc_number_node_ptr rhs ) const;
793 
795 
804  virtual yc_number_node_ptr
807 
809 
818  virtual yc_number_node_ptr
821 
823 
829  virtual yc_bool_node_ptr
830  new_not_node(yc_bool_node_ptr rhs ) const;
831 
833 
839  virtual yc_bool_node_ptr
841  yc_bool_node_ptr rhs ) const;
842 
844 
850  virtual yc_bool_node_ptr
852  yc_bool_node_ptr rhs ) const;
853 
855 
860  virtual yc_bool_node_ptr
862  yc_number_node_ptr rhs ) const;
863 
865 
870  virtual yc_bool_node_ptr
872  yc_number_node_ptr rhs ) const;
873 
875 
880  virtual yc_bool_node_ptr
882  yc_number_node_ptr rhs ) const;
883 
885 
890  virtual yc_bool_node_ptr
892  yc_number_node_ptr rhs ) const;
893 
895 
900  virtual yc_bool_node_ptr
902  yc_number_node_ptr rhs ) const;
903 
905 
910  virtual yc_bool_node_ptr
912  yc_number_node_ptr rhs ) const;
913 
914  };
915 
917 #define UNARY_MATH_EXPR(fn_name) \
918  yc_number_node_ptr fn_name(const yc_number_node_ptr rhs)
919 
921  UNARY_MATH_EXPR(sqrt);
923  UNARY_MATH_EXPR(cbrt);
925  UNARY_MATH_EXPR(fabs);
927  UNARY_MATH_EXPR(erf);
929  UNARY_MATH_EXPR(exp);
931  UNARY_MATH_EXPR(log);
933  UNARY_MATH_EXPR(sin);
935  UNARY_MATH_EXPR(cos);
937  UNARY_MATH_EXPR(atan);
938 #undef UNARY_MATH_EXPR
939 
941 #define BINARY_MATH_EXPR(fn_name) \
942  yc_number_node_ptr fn_name(const yc_number_node_ptr arg1, const yc_number_node_ptr arg2); \
943  yc_number_node_ptr fn_name(double arg1, const yc_number_node_ptr arg2); \
944  yc_number_node_ptr fn_name(const yc_number_node_ptr arg1, double arg2)
945 
947 
951  BINARY_MATH_EXPR(pow);
952 #undef BINARY_MATH_EXPR
953 
954 #if !defined SWIG
955 
956  // Non-class operators.
957  // These are not defined for SWIG because
958  // the Python operators are defined in the ".i" file.
959  // For the binary operators, we define 3 combinations to implicitly
960  // avoid the const-const combinations, which conflict with built-in
961  // operators on fundamental C++ types, e.g., '5+8'.
962 
964  yc_number_node_ptr operator-(yc_number_ptr_arg rhs);
965 
967  yc_number_node_ptr operator+(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
969  yc_number_node_ptr operator+(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
971  yc_number_node_ptr operator+(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
972 
974  yc_number_node_ptr operator/(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
976  yc_number_node_ptr operator/(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
978  yc_number_node_ptr operator/(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
979 
981  yc_number_node_ptr operator%(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
983  yc_number_node_ptr operator%(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
985  yc_number_node_ptr operator%(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
986 
988  yc_number_node_ptr operator*(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
990  yc_number_node_ptr operator*(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
992  yc_number_node_ptr operator*(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
993 
995  yc_number_node_ptr operator-(yc_number_ptr_arg lhs, yc_number_ptr_arg rhs);
997  yc_number_node_ptr operator-(yc_number_const_arg lhs, yc_number_ptr_arg rhs);
999  yc_number_node_ptr operator-(yc_number_ptr_arg lhs, yc_number_const_arg rhs);
1000 
1004  void operator+=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1005 
1009  void operator-=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1010 
1014  void operator*=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1015 
1019  void operator/=(yc_number_node_ptr& lhs, yc_number_const_arg rhs);
1020 
1022 
1024 
1026 
1028 
1030 
1032 
1034 
1040 #define BOOL_OPER(oper, fn) \
1041  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_number_node_ptr rhs) { \
1042  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1043  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_index_node_ptr rhs) { \
1044  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1045  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
1046  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1047  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_number_node_ptr rhs) { \
1048  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1049  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_index_node_ptr rhs) { \
1050  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1051  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
1052  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1053  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_number_node_ptr rhs) { \
1054  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1055  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_index_node_ptr rhs) { \
1056  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1057  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, const yc_var_point_node_ptr rhs) { \
1058  yc_node_factory nfac; return nfac.fn(lhs, rhs); } \
1059  inline yc_bool_node_ptr operator oper(const yc_number_node_ptr lhs, double rhs) { \
1060  yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); } \
1061  inline yc_bool_node_ptr operator oper(const yc_index_node_ptr lhs, double rhs) { \
1062  yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); } \
1063  inline yc_bool_node_ptr operator oper(const yc_var_point_node_ptr lhs, double rhs) { \
1064  yc_node_factory nfac; return nfac.fn(lhs, nfac.new_number_node(rhs)); }
1065 
1066  BOOL_OPER(==, new_equals_node)
1067  BOOL_OPER(!=, new_not_equals_node)
1068  BOOL_OPER(<, new_less_than_node)
1069  BOOL_OPER(>, new_greater_than_node)
1070  BOOL_OPER(<=, new_not_greater_than_node)
1071  BOOL_OPER(>=, new_not_less_than_node)
1072 #undef BOOL_OPER
1073 
1075 
1083 #define EQUALS <<
1084 
1086  yc_equation_node_ptr operator EQUALS(yc_var_point_node_ptr gpp, const yc_number_any_arg rhs);
1087 
1089 
1093 #define IF_DOMAIN ^=
1094 
1097  const yc_bool_node_ptr cond);
1098 
1100 
1104 #define IF_STEP |=
1105 
1108  const yc_bool_node_ptr cond);
1109 
1110 #endif // !SWIG.
1111 
1114 } // namespace yask.
virtual yc_bool_node_ptr get_rhs()=0
Get the [only] operand.
virtual yc_bool_node_ptr new_not_equals_node(yc_number_node_ptr lhs, yc_number_node_ptr rhs) const
Create a numerical-comparison 'not-equals' node.
Base class for boolean binary operators that take boolean inputs.
Definition: yc_node_api.hpp:407
std::shared_ptr< yc_commutative_number_node > yc_commutative_number_node_ptr
Shared pointer to yc_commutative_number_node.
Definition: yc_node_api.hpp:51
diff --git a/docs/api/html/yc__solution__api_8hpp_source.html b/docs/api/html/yc__solution__api_8hpp_source.html index 4cb86c3c..137ebeaa 100644 --- a/docs/api/html/yc__solution__api_8hpp_source.html +++ b/docs/api/html/yc__solution__api_8hpp_source.html @@ -70,7 +70,7 @@
yc_solution_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
26 // This file contains a base class and macros to create
27 // stencils to be included in the YASK compiler binary utility.
28 
29 // This file uses Doxygen 1.8 markup for API documentation-generation.
30 // See http://www.stack.nl/~dimitri/doxygen.
33 #pragma once
34 
35 // Standard headers.
36 #include <cassert>
37 #include <map>
38 
39 namespace yask {
40 
46 
58 
59  public:
61  typedef std::map<std::string, yc_solution_base*> soln_map;
62 
63  private:
64 
66  yc_solution_ptr _soln;
67 
69  yc_factory _yc_factory;
70 
72  yc_node_factory _node_factory;
73 
74  public:
75 
77 
82  yc_solution_base(const std::string& name);
83 
85 
91 
93  virtual ~yc_solution_base() { }
94 
96 
99  static soln_map& get_registry();
100 
102 
117  virtual void
118  define();
119 
121  inline yc_solution_ptr
123  return _soln;
124  }
125 
127  inline yc_index_node_ptr
128  new_step_index(const std::string& name) {
129  return _node_factory.new_step_index(name);
130  }
131 
133  inline yc_index_node_ptr
134  new_domain_index(const std::string& name) {
135  return _node_factory.new_domain_index(name);
136  }
137 
139  inline yc_index_node_ptr
140  new_misc_index(const std::string& name) {
141  return _node_factory.new_misc_index(name);
142  }
143 
145  inline yc_number_node_ptr
147  return _node_factory.new_number_node(arg);
148  }
149 
151  inline yc_number_node_ptr
153  return _node_factory.new_first_domain_index(dim);
154  }
155 
157  inline yc_number_node_ptr
159  return _node_factory.new_last_domain_index(dim);
160  }
161  };
162 
164 
172  private:
173 
175  int _radius;
176 
177  public:
179  yc_solution_with_radius_base(const std::string& name, int radius) :
180  yc_solution_base(name) {
181  set_radius(radius);
182  }
183 
185 
188  virtual void
189  define() override;
190 
192 
197  virtual bool
198  set_radius(int radius) {
199  _radius = radius;
200  auto soln = get_soln();
201  soln->set_description(soln->get_name() + " radius " + std::to_string(radius));
202  return radius >= 0; // support only non-neg. radius.
203  }
204 
206 
209  virtual int
210  get_radius() const {
211  return _radius;
212  }
213  };
214 
217 } // namespace yask.
virtual ~yc_solution_base()
Destructor.
Definition: yc_solution_api.hpp:93
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
26 // This file contains a base class and macros to create
27 // stencils to be included in the YASK compiler binary utility.
28 
29 // This file uses Doxygen 1.8 markup for API documentation-generation.
30 // See http://www.stack.nl/~dimitri/doxygen.
33 #pragma once
34 
35 // Standard headers.
36 #include <cassert>
37 #include <map>
38 
39 namespace yask {
40 
46 
58 
59  public:
61  typedef std::map<std::string, yc_solution_base*> soln_map;
62 
63  private:
64 
66  yc_solution_ptr _soln;
67 
69  yc_factory _yc_factory;
70 
72  yc_node_factory _node_factory;
73 
74  public:
75 
77 
82  yc_solution_base(const std::string& name);
83 
85 
91 
93  virtual ~yc_solution_base() { }
94 
96 
99  static soln_map& get_registry();
100 
102 
117  virtual void
118  define();
119 
121  inline yc_solution_ptr
123  return _soln;
124  }
125 
127  inline yc_index_node_ptr
128  new_step_index(const std::string& name) {
129  return _node_factory.new_step_index(name);
130  }
131 
133  inline yc_index_node_ptr
134  new_domain_index(const std::string& name) {
135  return _node_factory.new_domain_index(name);
136  }
137 
139  inline yc_index_node_ptr
140  new_misc_index(const std::string& name) {
141  return _node_factory.new_misc_index(name);
142  }
143 
145  inline yc_number_node_ptr
147  return _node_factory.new_number_node(arg);
148  }
149 
151  inline yc_number_node_ptr
153  return _node_factory.new_first_domain_index(dim);
154  }
155 
157  inline yc_number_node_ptr
159  return _node_factory.new_last_domain_index(dim);
160  }
161  };
162 
164 
172  private:
173 
175  int _radius;
176 
177  public:
179  yc_solution_with_radius_base(const std::string& name, int radius) :
180  yc_solution_base(name) {
181  set_radius(radius);
182  }
183 
185 
188  virtual void
189  define() override;
190 
192 
197  virtual bool
198  set_radius(int radius) {
199  _radius = radius;
200  auto soln = get_soln();
201  soln->set_description(soln->get_name() + " radius " + std::to_string(radius));
202  return radius >= 0; // support only non-neg. radius.
203  }
204 
206 
209  virtual int
210  get_radius() const {
211  return _radius;
212  }
213  };
214 
217 } // namespace yask.
virtual ~yc_solution_base()
Destructor.
Definition: yc_solution_api.hpp:93
Arguments that may be YASK or non-YASK numeric types.
Definition: yc_node_api.hpp:560
Factory to create AST nodes.
Definition: yc_node_api.hpp:606
yc_index_node_ptr new_step_index(const std::string &name)
A simple wrapper for yc_node_factory::new_step_index().
Definition: yc_solution_api.hpp:128
diff --git a/docs/api/html/yk__solution__api_8hpp_source.html b/docs/api/html/yk__solution__api_8hpp_source.html index 4fa32dc3..b66caa33 100644 --- a/docs/api/html/yk__solution__api_8hpp_source.html +++ b/docs/api/html/yk__solution__api_8hpp_source.html @@ -70,7 +70,7 @@
yk_solution_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_kernel_api.hpp"
35 
36 namespace yask {
37 
43 
49  const int yask_numa_local = -1;
50 
52 
57  const int yask_numa_interleave = -2;
58 
60 
65  const int yask_numa_none = -9;
66 
68 
74  class yk_solution {
75  public:
76  virtual ~yk_solution() {}
77 
79 
83  virtual void
87 
89 
92  virtual const std::string&
93  get_name() const =0;
94 
96 
101  virtual std::string
102  get_target() const =0;
103 
105 
108  virtual int
109  get_element_bytes() const =0;
110 
112 
117  virtual std::string
118  get_step_dim_name() const =0;
119 
121 
127  virtual int
128  get_num_domain_dims() const =0;
129 
131 
136  virtual std::vector<std::string>
137  get_domain_dim_names() const =0;
138 
140 
148  virtual std::vector<std::string>
149  get_misc_dim_names() const =0;
150 
152 
175  virtual void
176  set_rank_domain_size(const std::string& dim,
179  idx_t size ) =0;
180 
182 
192  virtual idx_t
193  get_rank_domain_size(const std::string& dim) const =0;
196 
198 
208  virtual void
209  set_overall_domain_size(const std::string& dim,
212  idx_t size ) =0;
213 
215 
228  virtual idx_t
229  get_overall_domain_size(const std::string& dim ) const =0;
232 
234 
251  virtual void
252  set_block_size(const std::string& dim,
256  idx_t size ) =0;
258 
260 
265  virtual idx_t
266  get_block_size(const std::string& dim) const =0;
270 
272 
299  virtual void
300  set_num_ranks(const std::string& dim,
303  idx_t num ) =0;
304 
306 
309  virtual idx_t
310  get_num_ranks(const std::string& dim) const =0;
313 
315 
336  virtual void
337  set_rank_index(const std::string& dim,
340  idx_t num ) =0;
341 
343 
348  virtual idx_t
349  get_rank_index(const std::string& dim ) const =0;
352 
354 
368  virtual std::string
369  apply_command_line_options(const std::string& args ) =0;
371 
373 
380  virtual std::string
381  apply_command_line_options(int argc, char* argv[]) =0;
382 
384 
390  virtual std::string
391  apply_command_line_options(const std::vector<std::string>& args) =0;
392 
394 
401  virtual int
402  get_num_vars() const =0;
403 
405 
409  virtual yk_var_ptr
410  get_var(const std::string& name ) =0;
412 
414 
417  virtual std::vector<yk_var_ptr>
418  get_vars() =0;
419 
421 
429  virtual void
430  prepare_solution() =0;
431 
433 
445  virtual idx_t
446  get_first_rank_domain_index(const std::string& dim ) const =0;
449 
451 
464  virtual idx_t
465  get_last_rank_domain_index(const std::string& dim ) const =0;
468 
470 
501  virtual void
502  run_solution(idx_t first_step_index ,
503  idx_t last_step_index ) =0;
504 
506 
531  virtual void
532  run_solution(idx_t step_index ) =0;
533 
535 
541  virtual void
542  end_solution() =0;
543 
545 
550  virtual yk_stats_ptr
551  get_stats() =0;
552 
554 
559  virtual bool
560  is_auto_tuner_enabled() const =0;
561 
562  /* Advanced APIs for yk_solution found below are not needed for most applications. */
563 
565 
592  virtual void
593  set_region_size(const std::string& dim,
597  idx_t size ) =0;
599 
601 
606  virtual idx_t
607  get_region_size(const std::string& dim) const =0;
611 
613 
637  virtual void
638  set_min_pad_size(const std::string& dim,
641  idx_t size ) =0;
644 
646 
649  virtual idx_t
650  get_min_pad_size(const std::string& dim) const =0;
653 
655 
666  virtual void
667  reset_auto_tuner(bool enable,
670  bool verbose = false ) =0;
673 
675 
693  virtual void
694  run_auto_tuner_now(bool verbose = true ) =0;
697 
699 
747  virtual yk_var_ptr
748  new_var(const std::string& name,
751  const std::vector<std::string>& dims ) =0;
755 
756 #ifndef SWIG
757 
764  virtual yk_var_ptr
765  new_var(const std::string& name,
768  const std::initializer_list<std::string>& dims ) =0;
772 #endif
773 
775 
822  virtual yk_var_ptr
823  new_fixed_size_var(const std::string& name,
826  const std::vector<std::string>& dims,
830  const std::vector<idx_t>& dim_sizes ) =0;
833 
834 #ifndef SWIG
835 
842  virtual yk_var_ptr
843  new_fixed_size_var(const std::string& name,
846  const std::initializer_list<std::string>& dims,
850  const std::initializer_list<idx_t>& dim_sizes ) =0;
853 #endif
854 
856 
867  virtual bool
868  set_default_numa_preferred(int numa_node) =0;
879 
881 
884  virtual int
885  get_default_numa_preferred() const =0;
886 
887 #ifndef SWIG
888  typedef std::function<void(yk_solution&)> hook_fn_t;
890 
892  typedef std::function<void(yk_solution& soln,
893  idx_t first_step_index,
894  idx_t last_step_index)> hook_fn_2idx_t;
895 
897 
905  virtual void
908 
910 
918  virtual void
921 
923 
933  virtual void
936 
938 
948  virtual void
951 #endif
952 
954 
959  virtual void
960  fuse_vars(yk_solution_ptr source) =0;
962 
964  virtual void
965  set_step_wrap(bool do_wrap) =0;
967 
969 
972  virtual bool
973  get_step_wrap() const =0;
974 
976  inline int
977  get_num_grids() const {
978  return get_num_vars();
979  }
980 
982  inline yk_var_ptr
983  get_grid(const std::string& name) {
984  return get_var(name);
985  }
986 
988  inline std::vector<yk_var_ptr>
990  return get_vars();
991  }
992 
994  inline yk_var_ptr
995  new_grid(const std::string& name,
996  const std::vector<std::string>& dims) {
997  return new_var(name, dims);
998  }
999 
1000 #ifndef SWIG
1001  inline yk_var_ptr
1003  new_grid(const std::string& name,
1004  const std::initializer_list<std::string>& dims) {
1005  return new_var(name, dims);
1006  }
1007 #endif
1008 
1010  inline yk_var_ptr
1011  new_fixed_size_grid(const std::string& name,
1012  const std::vector<std::string>& dims,
1013  const std::vector<idx_t>& dim_sizes) {
1014  return new_fixed_size_var(name, dims, dim_sizes);
1015  }
1016 
1017 #ifndef SWIG
1018  inline yk_var_ptr
1020  new_fixed_size_grid(const std::string& name,
1021  const std::initializer_list<std::string>& dims,
1022  const std::vector<idx_t>& dim_sizes) {
1023  return new_fixed_size_var(name, dims, dim_sizes);
1024  }
1025 #endif
1026 
1028  inline void
1030  fuse_vars(source);
1031  }
1032  }; // yk_solution.
1033 
1035 
1040  class yk_stats {
1041  public:
1042  virtual ~yk_stats() {}
1043 
1045 
1051  virtual idx_t
1052  get_num_elements() =0;
1053 
1055 
1059  virtual idx_t
1060  get_num_steps_done() =0;
1061 
1063 
1067  virtual idx_t
1068  get_num_writes_done() =0;
1069 
1071 
1077  virtual idx_t
1078  get_est_fp_ops_done() =0;
1079 
1081 
1085  virtual double
1086  get_elapsed_secs() =0;
1087  }; // yk_stats.
1088 
1090 } // namespace yask.
virtual void reset_auto_tuner(bool enable, bool verbose=false)=0
[Advanced] Restart or disable the auto-tuner on this rank.
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_kernel_api.hpp"
35 
36 namespace yask {
37 
43 
49  const int yask_numa_local = -1;
50 
52 
57  const int yask_numa_interleave = -2;
58 
60 
65  const int yask_numa_none = -9;
66 
68 
74  class yk_solution {
75  public:
76  virtual ~yk_solution() {}
77 
79 
83  virtual void
87 
89 
92  virtual const std::string&
93  get_name() const =0;
94 
96 
101  virtual std::string
102  get_target() const =0;
103 
105 
108  virtual int
109  get_element_bytes() const =0;
110 
112 
117  virtual std::string
118  get_step_dim_name() const =0;
119 
121 
127  virtual int
128  get_num_domain_dims() const =0;
129 
131 
136  virtual std::vector<std::string>
137  get_domain_dim_names() const =0;
138 
140 
148  virtual std::vector<std::string>
149  get_misc_dim_names() const =0;
150 
152 
175  virtual void
176  set_rank_domain_size(const std::string& dim,
179  idx_t size ) =0;
180 
182 
192  virtual idx_t
193  get_rank_domain_size(const std::string& dim) const =0;
196 
198 
208  virtual void
209  set_overall_domain_size(const std::string& dim,
212  idx_t size ) =0;
213 
215 
228  virtual idx_t
229  get_overall_domain_size(const std::string& dim ) const =0;
232 
234 
251  virtual void
252  set_block_size(const std::string& dim,
256  idx_t size ) =0;
258 
260 
265  virtual idx_t
266  get_block_size(const std::string& dim) const =0;
270 
272 
299  virtual void
300  set_num_ranks(const std::string& dim,
303  idx_t num ) =0;
304 
306 
309  virtual idx_t
310  get_num_ranks(const std::string& dim) const =0;
313 
315 
336  virtual void
337  set_rank_index(const std::string& dim,
340  idx_t num ) =0;
341 
343 
348  virtual idx_t
349  get_rank_index(const std::string& dim ) const =0;
352 
354 
368  virtual std::string
369  apply_command_line_options(const std::string& args ) =0;
371 
373 
380  virtual std::string
381  apply_command_line_options(int argc, char* argv[]) =0;
382 
384 
390  virtual std::string
391  apply_command_line_options(const std::vector<std::string>& args) =0;
392 
394 
401  virtual int
402  get_num_vars() const =0;
403 
405 
409  virtual yk_var_ptr
410  get_var(const std::string& name ) =0;
412 
414 
417  virtual std::vector<yk_var_ptr>
418  get_vars() =0;
419 
421 
429  virtual void
430  prepare_solution() =0;
431 
433 
445  virtual idx_t
446  get_first_rank_domain_index(const std::string& dim ) const =0;
449 
451 
464  virtual idx_t
465  get_last_rank_domain_index(const std::string& dim ) const =0;
468 
470 
501  virtual void
502  run_solution(idx_t first_step_index ,
503  idx_t last_step_index ) =0;
504 
506 
531  virtual void
532  run_solution(idx_t step_index ) =0;
533 
535 
541  virtual void
542  end_solution() =0;
543 
545 
550  virtual yk_stats_ptr
551  get_stats() =0;
552 
554 
559  virtual bool
560  is_auto_tuner_enabled() const =0;
561 
562  /* Advanced APIs for yk_solution found below are not needed for most applications. */
563 
565 
592  virtual void
593  set_region_size(const std::string& dim,
597  idx_t size ) =0;
599 
601 
606  virtual idx_t
607  get_region_size(const std::string& dim) const =0;
611 
613 
637  virtual void
638  set_min_pad_size(const std::string& dim,
641  idx_t size ) =0;
644 
646 
649  virtual idx_t
650  get_min_pad_size(const std::string& dim) const =0;
653 
655 
666  virtual void
667  reset_auto_tuner(bool enable,
670  bool verbose = false ) =0;
673 
675 
693  virtual void
694  run_auto_tuner_now(bool verbose = true ) =0;
697 
699 
747  virtual yk_var_ptr
748  new_var(const std::string& name,
751  const std::vector<std::string>& dims ) =0;
755 
756 #ifndef SWIG
757 
764  virtual yk_var_ptr
765  new_var(const std::string& name,
768  const std::initializer_list<std::string>& dims ) =0;
772 #endif
773 
775 
822  virtual yk_var_ptr
823  new_fixed_size_var(const std::string& name,
826  const std::vector<std::string>& dims,
830  const std::vector<idx_t>& dim_sizes ) =0;
833 
834 #ifndef SWIG
835 
842  virtual yk_var_ptr
843  new_fixed_size_var(const std::string& name,
846  const std::initializer_list<std::string>& dims,
850  const std::initializer_list<idx_t>& dim_sizes ) =0;
853 #endif
854 
856 
867  virtual bool
868  set_default_numa_preferred(int numa_node) =0;
879 
881 
884  virtual int
885  get_default_numa_preferred() const =0;
886 
887 #ifndef SWIG
888  typedef std::function<void(yk_solution&)> hook_fn_t;
890 
892  typedef std::function<void(yk_solution& soln,
893  idx_t first_step_index,
894  idx_t last_step_index)> hook_fn_2idx_t;
895 
897 
905  virtual void
908 
910 
918  virtual void
921 
923 
933  virtual void
936 
938 
948  virtual void
951 #endif
952 
954 
959  virtual void
960  fuse_vars(yk_solution_ptr source) =0;
962 
964  virtual void
965  set_step_wrap(bool do_wrap) =0;
967 
969 
972  virtual bool
973  get_step_wrap() const =0;
974 
976  inline int
977  get_num_grids() const {
978  return get_num_vars();
979  }
980 
982  inline yk_var_ptr
983  get_grid(const std::string& name) {
984  return get_var(name);
985  }
986 
988  inline std::vector<yk_var_ptr>
990  return get_vars();
991  }
992 
994  inline yk_var_ptr
995  new_grid(const std::string& name,
996  const std::vector<std::string>& dims) {
997  return new_var(name, dims);
998  }
999 
1000 #ifndef SWIG
1001  inline yk_var_ptr
1003  new_grid(const std::string& name,
1004  const std::initializer_list<std::string>& dims) {
1005  return new_var(name, dims);
1006  }
1007 #endif
1008 
1010  inline yk_var_ptr
1011  new_fixed_size_grid(const std::string& name,
1012  const std::vector<std::string>& dims,
1013  const std::vector<idx_t>& dim_sizes) {
1014  return new_fixed_size_var(name, dims, dim_sizes);
1015  }
1016 
1017 #ifndef SWIG
1018  inline yk_var_ptr
1020  new_fixed_size_grid(const std::string& name,
1021  const std::initializer_list<std::string>& dims,
1022  const std::vector<idx_t>& dim_sizes) {
1023  return new_fixed_size_var(name, dims, dim_sizes);
1024  }
1025 #endif
1026 
1028  inline void
1030  fuse_vars(source);
1031  }
1032  }; // yk_solution.
1033 
1035 
1040  class yk_stats {
1041  public:
1042  virtual ~yk_stats() {}
1043 
1045 
1051  virtual idx_t
1052  get_num_elements() =0;
1053 
1055 
1059  virtual idx_t
1060  get_num_steps_done() =0;
1061 
1063 
1067  virtual idx_t
1068  get_num_writes_done() =0;
1069 
1071 
1077  virtual idx_t
1078  get_est_fp_ops_done() =0;
1079 
1081 
1085  virtual double
1086  get_elapsed_secs() =0;
1087  }; // yk_stats.
1088 
1090 } // namespace yask.
virtual void reset_auto_tuner(bool enable, bool verbose=false)=0
[Advanced] Restart or disable the auto-tuner on this rank.
virtual idx_t get_num_writes_done()=0
Get the number of elements written across all steps.
void fuse_grids(yk_solution_ptr source)
[Deprecated] Use fuse_vars().
Definition: yk_solution_api.hpp:1029
virtual yk_var_ptr new_fixed_size_var(const std::string &name, const std::vector< std::string > &dims, const std::vector< idx_t > &dim_sizes)=0
[Advanced] Add a new var to the solution with a specified size.
diff --git a/docs/api/html/yk__var__api_8hpp_source.html b/docs/api/html/yk__var__api_8hpp_source.html index a2557b70..b56a6b0a 100644 --- a/docs/api/html/yk__var__api_8hpp_source.html +++ b/docs/api/html/yk__var__api_8hpp_source.html @@ -70,7 +70,7 @@
yk_var_api.hpp
-Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2019, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_kernel_api.hpp"
35 
36 namespace yask {
37 
43 
185  class yk_var {
186  public:
187  virtual ~yk_var() {}
188 
190 
196  virtual const std::string& get_name() const =0;
197 
199 
204  virtual int get_num_dims() const =0;
205 
207 
211  virtual std::vector<std::string>
212  get_dim_names() const =0;
213 
215 
219  virtual bool
220  is_dim_used(const std::string& dim) const =0;
221 
223 
227  virtual bool is_fixed_size() const =0;
228 
230 
242  virtual idx_t
243  get_first_local_index(const std::string& dim ) const =0;
246 
248 
260  virtual idx_t
261  get_last_local_index(const std::string& dim ) const =0;
264 
266 
273  virtual idx_t
274  get_alloc_size(const std::string& dim ) const =0;
277 
279 
287  virtual idx_t
288  get_first_valid_step_index() const =0;
289 
291 
299  virtual idx_t
300  get_last_valid_step_index() const =0;
301 
303 
308  virtual idx_t
309  get_rank_domain_size(const std::string& dim) const =0;
312 
314 
320  virtual idx_t
321  get_first_rank_domain_index(const std::string& dim ) const =0;
324 
326 
333  virtual idx_t
334  get_last_rank_domain_index(const std::string& dim ) const =0;
337 
339 
343  virtual idx_t
344  get_left_halo_size(const std::string& dim ) const =0;
348 
350 
354  virtual idx_t
355  get_right_halo_size(const std::string& dim ) const =0;
359 
361 
368  virtual idx_t
369  get_first_rank_halo_index(const std::string& dim ) const =0;
372 
374 
381  virtual idx_t
382  get_last_rank_halo_index(const std::string& dim ) const =0;
385 
387 
395  virtual idx_t
396  get_left_pad_size(const std::string& dim ) const =0;
400 
402 
410  virtual idx_t
411  get_right_pad_size(const std::string& dim ) const =0;
415 
417 
422  virtual idx_t
423  get_left_extra_pad_size(const std::string& dim ) const =0;
427 
429 
434  virtual idx_t
435  get_right_extra_pad_size(const std::string& dim ) const =0;
439 
441 
445  virtual idx_t
446  get_first_misc_index(const std::string& dim ) const =0;
449 
451 
455  virtual idx_t
456  get_last_misc_index(const std::string& dim ) const =0;
459 
461 
468  virtual bool
469  are_indices_local(const std::vector<idx_t>& indices ) const =0;
471 
472 #ifndef SWIG
473 
477  virtual bool
478  are_indices_local(const std::initializer_list<idx_t>& indices ) const =0;
480 #endif
481 
483 
491  virtual double
492  get_element(const std::vector<idx_t>& indices ) const =0;
494 
495 #ifndef SWIG
496 
501  virtual double
502  get_element(const std::initializer_list<idx_t>& indices ) const =0;
504 #endif
505 
507 
526  virtual idx_t
527  set_element(double val ,
528  const std::vector<idx_t>& indices,
530  bool strict_indices = true ) =0;
534 
535 #ifndef SWIG
536 
541  virtual idx_t
542  set_element(double val ,
543  const std::initializer_list<idx_t>& indices,
545  bool strict_indices = true ) =0;
549 #endif
550 
552 
569  virtual idx_t
570  get_elements_in_slice(void* buffer_ptr,
572  const std::vector<idx_t>& first_indices,
574  const std::vector<idx_t>& last_indices ) const =0;
576 
578 
593  virtual idx_t
594  add_to_element(double val ,
595  const std::vector<idx_t>& indices,
597  bool strict_indices = true ) =0;
601 
602 #ifndef SWIG
603 
608  virtual idx_t
609  add_to_element(double val ,
610  const std::initializer_list<idx_t>& indices,
612  bool strict_indices = true ) =0;
616 #endif
617 
619 
627  virtual void
628  set_all_elements_same(double val ) =0;
629 
631 
644  virtual idx_t
645  set_elements_in_slice_same(double val ,
646  const std::vector<idx_t>& first_indices,
648  const std::vector<idx_t>& last_indices,
650  bool strict_indices = true ) =0;
654 
656 
675  virtual idx_t
676  set_elements_in_slice(const void* buffer_ptr,
678  const std::vector<idx_t>& first_indices,
680  const std::vector<idx_t>& last_indices ) =0;
682 
683 #ifdef COPY_SLICE_IMPLEMENTED
684 
698  virtual idx_t
699  set_elements_in_slice(const yk_var_ptr source,
701  const std::vector<idx_t>& first_source_indices,
704  const std::vector<idx_t>& first_target_indices,
707  const std::vector<idx_t>& last_target_indices ) =0;
710 #endif
711 
713 
717  virtual std::string
718  format_indices(const std::vector<idx_t>& indices ) const =0;
720 
721 #ifndef SWIG
722 
727  virtual std::string
728  format_indices(const std::initializer_list<idx_t>& indices ) const =0;
730 #endif
731 
732  /* Advanced APIs for yk_var found below are not needed for most applications. */
733 
735 
752  virtual int
753  get_halo_exchange_l1_norm() const =0;
754 
756 
759  virtual void
760  set_halo_exchange_l1_norm(int norm) =0;
763 
765 
768  virtual bool
769  is_dynamic_step_alloc() const =0;
770 
772 
779  virtual bool
780  set_numa_preferred(int numa_node) =0;
783 
785 
788  virtual int
789  get_numa_preferred() const =0;
790 
792 
802  virtual void
803  set_left_min_pad_size(const std::string& dim,
807  idx_t size ) =0;
810 
812 
822  virtual void
823  set_right_min_pad_size(const std::string& dim,
827  idx_t size ) =0;
830 
832 
835  virtual void
836  set_min_pad_size(const std::string& dim,
840  idx_t size ) =0;
843 
845 
854  virtual void
855  set_left_halo_size(const std::string& dim,
859  idx_t size ) =0;
861 
863 
872  virtual void
873  set_right_halo_size(const std::string& dim,
877  idx_t size ) =0;
879 
881 
884  virtual void
885  set_halo_size(const std::string& dim,
889  idx_t size ) =0;
891 
892 
894 
919  virtual void
920  set_alloc_size(const std::string& dim,
924  idx_t size ) =0;
925 
927 
933  virtual void
934  set_first_misc_index(const std::string& dim,
937  idx_t idx ) =0;
939 
941 
945  virtual idx_t
946  get_first_rank_alloc_index(const std::string& dim ) const =0;
950 
952 
956  virtual idx_t
957  get_last_rank_alloc_index(const std::string& dim ) const =0;
961 
963 
967  virtual bool
968  is_storage_allocated() const =0;
969 
971 
975  virtual idx_t
976  get_num_storage_bytes() const =0;
977 
979 
982  virtual idx_t
983  get_num_storage_elements() const =0;
984 
986 
992  virtual void
993  alloc_storage() =0;
994 
996 
1000  virtual void
1001  release_storage() =0;
1002 
1004 
1020  virtual bool
1021  is_storage_layout_identical(const yk_var_ptr other) const =0;
1022 
1024 
1050  virtual void
1051  fuse_vars(yk_var_ptr source) =0;
1053 
1055 
1091  virtual void* get_raw_storage_buffer() =0;
1092 
1093  /* Deprecated APIs for yk_var found below should be avoided.
1094  Use the more explicit form found in the documentation. */
1095 
1097  inline idx_t
1098  get_halo_size(const std::string& dim) const {
1099  return get_left_halo_size(dim);
1100  }
1102  inline idx_t
1103  get_pad_size(const std::string& dim) const {
1104  return get_left_pad_size(dim);
1105  }
1107  inline idx_t
1108  get_extra_pad_size(const std::string& dim) const {
1109  return get_left_extra_pad_size(dim);
1110  }
1111 
1113  inline bool
1114  is_element_allocated(const std::vector<idx_t>& indices ) const {
1116  return are_indices_local(indices);
1117  }
1118 
1119 #ifndef SWIG
1120  inline bool
1122  is_element_allocated(const std::initializer_list<idx_t>& indices ) const {
1124  return are_indices_local(indices);
1125  }
1126 #endif
1127 
1129  inline void
1131  fuse_vars(source);
1132  }
1133 
1134  }; // yk_var.
1135 
1137  typedef yk_var yk_grid;
1138 
1140 } // namespace yask.
virtual idx_t get_alloc_size(const std::string &dim) const =0
Get the number of elements allocated in the specified dimension.
+Go to the documentation of this file.
1 /*****************************************************************************
2 
3 YASK: Yet Another Stencil Kit
4 Copyright (c) 2014-2020, Intel Corporation
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 * The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 IN THE SOFTWARE.
23 
24 *****************************************************************************/
25 
27 
28 // This file uses Doxygen 1.8 markup for API documentation-generation.
29 // See http://www.stack.nl/~dimitri/doxygen.
32 #pragma once
33 
34 #include "yask_kernel_api.hpp"
35 
36 namespace yask {
37 
43 
185  class yk_var {
186  public:
187  virtual ~yk_var() {}
188 
190 
196  virtual const std::string& get_name() const =0;
197 
199 
204  virtual int get_num_dims() const =0;
205 
207 
211  virtual std::vector<std::string>
212  get_dim_names() const =0;
213 
215 
219  virtual bool
220  is_dim_used(const std::string& dim) const =0;
221 
223 
227  virtual bool is_fixed_size() const =0;
228 
230 
242  virtual idx_t
243  get_first_local_index(const std::string& dim ) const =0;
246 
248 
260  virtual idx_t
261  get_last_local_index(const std::string& dim ) const =0;
264 
266 
273  virtual idx_t
274  get_alloc_size(const std::string& dim ) const =0;
277 
279 
287  virtual idx_t
288  get_first_valid_step_index() const =0;
289 
291 
299  virtual idx_t
300  get_last_valid_step_index() const =0;
301 
303 
308  virtual idx_t
309  get_rank_domain_size(const std::string& dim) const =0;
312 
314 
320  virtual idx_t
321  get_first_rank_domain_index(const std::string& dim ) const =0;
324 
326 
333  virtual idx_t
334  get_last_rank_domain_index(const std::string& dim ) const =0;
337 
339 
343  virtual idx_t
344  get_left_halo_size(const std::string& dim ) const =0;
348 
350 
354  virtual idx_t
355  get_right_halo_size(const std::string& dim ) const =0;
359 
361 
368  virtual idx_t
369  get_first_rank_halo_index(const std::string& dim ) const =0;
372 
374 
381  virtual idx_t
382  get_last_rank_halo_index(const std::string& dim ) const =0;
385 
387 
395  virtual idx_t
396  get_left_pad_size(const std::string& dim ) const =0;
400 
402 
410  virtual idx_t
411  get_right_pad_size(const std::string& dim ) const =0;
415 
417 
422  virtual idx_t
423  get_left_extra_pad_size(const std::string& dim ) const =0;
427 
429 
434  virtual idx_t
435  get_right_extra_pad_size(const std::string& dim ) const =0;
439 
441 
445  virtual idx_t
446  get_first_misc_index(const std::string& dim ) const =0;
449 
451 
455  virtual idx_t
456  get_last_misc_index(const std::string& dim ) const =0;
459 
461 
468  virtual bool
469  are_indices_local(const std::vector<idx_t>& indices ) const =0;
471 
472 #ifndef SWIG
473 
477  virtual bool
478  are_indices_local(const std::initializer_list<idx_t>& indices ) const =0;
480 #endif
481 
483 
491  virtual double
492  get_element(const std::vector<idx_t>& indices ) const =0;
494 
495 #ifndef SWIG
496 
501  virtual double
502  get_element(const std::initializer_list<idx_t>& indices ) const =0;
504 #endif
505 
507 
526  virtual idx_t
527  set_element(double val ,
528  const std::vector<idx_t>& indices,
530  bool strict_indices = true ) =0;
534 
535 #ifndef SWIG
536 
541  virtual idx_t
542  set_element(double val ,
543  const std::initializer_list<idx_t>& indices,
545  bool strict_indices = true ) =0;
549 #endif
550 
552 
569  virtual idx_t
570  get_elements_in_slice(void* buffer_ptr,
572  const std::vector<idx_t>& first_indices,
574  const std::vector<idx_t>& last_indices ) const =0;
576 
578 
593  virtual idx_t
594  add_to_element(double val ,
595  const std::vector<idx_t>& indices,
597  bool strict_indices = true ) =0;
601 
602 #ifndef SWIG
603 
608  virtual idx_t
609  add_to_element(double val ,
610  const std::initializer_list<idx_t>& indices,
612  bool strict_indices = true ) =0;
616 #endif
617 
619 
627  virtual void
628  set_all_elements_same(double val ) =0;
629 
631 
644  virtual idx_t
645  set_elements_in_slice_same(double val ,
646  const std::vector<idx_t>& first_indices,
648  const std::vector<idx_t>& last_indices,
650  bool strict_indices = true ) =0;
654 
656 
675  virtual idx_t
676  set_elements_in_slice(const void* buffer_ptr,
678  const std::vector<idx_t>& first_indices,
680  const std::vector<idx_t>& last_indices ) =0;
682 
683 #ifdef COPY_SLICE_IMPLEMENTED
684 
698  virtual idx_t
699  set_elements_in_slice(const yk_var_ptr source,
701  const std::vector<idx_t>& first_source_indices,
704  const std::vector<idx_t>& first_target_indices,
707  const std::vector<idx_t>& last_target_indices ) =0;
710 #endif
711 
713 
717  virtual std::string
718  format_indices(const std::vector<idx_t>& indices ) const =0;
720 
721 #ifndef SWIG
722 
727  virtual std::string
728  format_indices(const std::initializer_list<idx_t>& indices ) const =0;
730 #endif
731 
732  /* Advanced APIs for yk_var found below are not needed for most applications. */
733 
735 
752  virtual int
753  get_halo_exchange_l1_norm() const =0;
754 
756 
759  virtual void
760  set_halo_exchange_l1_norm(int norm) =0;
763 
765 
768  virtual bool
769  is_dynamic_step_alloc() const =0;
770 
772 
779  virtual bool
780  set_numa_preferred(int numa_node) =0;
783 
785 
788  virtual int
789  get_numa_preferred() const =0;
790 
792 
802  virtual void
803  set_left_min_pad_size(const std::string& dim,
807  idx_t size ) =0;
810 
812 
822  virtual void
823  set_right_min_pad_size(const std::string& dim,
827  idx_t size ) =0;
830 
832 
835  virtual void
836  set_min_pad_size(const std::string& dim,
840  idx_t size ) =0;
843 
845 
854  virtual void
855  set_left_halo_size(const std::string& dim,
859  idx_t size ) =0;
861 
863 
872  virtual void
873  set_right_halo_size(const std::string& dim,
877  idx_t size ) =0;
879 
881 
884  virtual void
885  set_halo_size(const std::string& dim,
889  idx_t size ) =0;
891 
892 
894 
919  virtual void
920  set_alloc_size(const std::string& dim,
924  idx_t size ) =0;
925 
927 
933  virtual void
934  set_first_misc_index(const std::string& dim,
937  idx_t idx ) =0;
939 
941 
945  virtual idx_t
946  get_first_rank_alloc_index(const std::string& dim ) const =0;
950 
952 
956  virtual idx_t
957  get_last_rank_alloc_index(const std::string& dim ) const =0;
961 
963 
967  virtual bool
968  is_storage_allocated() const =0;
969 
971 
975  virtual idx_t
976  get_num_storage_bytes() const =0;
977 
979 
982  virtual idx_t
983  get_num_storage_elements() const =0;
984 
986 
992  virtual void
993  alloc_storage() =0;
994 
996 
1000  virtual void
1001  release_storage() =0;
1002 
1004 
1020  virtual bool
1021  is_storage_layout_identical(const yk_var_ptr other) const =0;
1022 
1024 
1050  virtual void
1051  fuse_vars(yk_var_ptr source) =0;
1053 
1055 
1091  virtual void* get_raw_storage_buffer() =0;
1092 
1093  /* Deprecated APIs for yk_var found below should be avoided.
1094  Use the more explicit form found in the documentation. */
1095 
1097  inline idx_t
1098  get_halo_size(const std::string& dim) const {
1099  return get_left_halo_size(dim);
1100  }
1102  inline idx_t
1103  get_pad_size(const std::string& dim) const {
1104  return get_left_pad_size(dim);
1105  }
1107  inline idx_t
1108  get_extra_pad_size(const std::string& dim) const {
1109  return get_left_extra_pad_size(dim);
1110  }
1111 
1113  inline bool
1114  is_element_allocated(const std::vector<idx_t>& indices ) const {
1116  return are_indices_local(indices);
1117  }
1118 
1119 #ifndef SWIG
1120  inline bool
1122  is_element_allocated(const std::initializer_list<idx_t>& indices ) const {
1124  return are_indices_local(indices);
1125  }
1126 #endif
1127 
1129  inline void
1131  fuse_vars(source);
1132  }
1133 
1134  }; // yk_var.
1135 
1137  typedef yk_var yk_grid;
1138 
1140 } // namespace yask.
virtual idx_t get_alloc_size(const std::string &dim) const =0
Get the number of elements allocated in the specified dimension.
virtual idx_t get_first_valid_step_index() const =0
Get the first valid index in the step dimension.
virtual idx_t get_left_pad_size(const std::string &dim) const =0
Get the actual left padding in the specified dimension.
virtual bool is_dynamic_step_alloc() const =0
[Advanced] Get whether the allocation of the step dimension of this var can be modified at run-time.
diff --git a/include/aux/Soln.hpp b/include/aux/Soln.hpp index 499ac829..34d61af9 100644 --- a/include/aux/Soln.hpp +++ b/include/aux/Soln.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/aux/yc_node_api.hpp b/include/aux/yc_node_api.hpp index 678a9607..3ced0119 100644 --- a/include/aux/yc_node_api.hpp +++ b/include/aux/yc_node_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/aux/yc_solution_api.hpp b/include/aux/yc_solution_api.hpp index 1a5fd690..456c62f8 100644 --- a/include/aux/yc_solution_api.hpp +++ b/include/aux/yc_solution_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/aux/yk_solution_api.hpp b/include/aux/yk_solution_api.hpp index cad80c35..b69f276e 100644 --- a/include/aux/yk_solution_api.hpp +++ b/include/aux/yk_solution_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/aux/yk_var_api.hpp b/include/aux/yk_var_api.hpp index 7584ffbb..a2f271c4 100644 --- a/include/aux/yk_var_api.hpp +++ b/include/aux/yk_var_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/yask_common_api.hpp b/include/yask_common_api.hpp index 1448fda8..d55b784f 100644 --- a/include/yask_common_api.hpp +++ b/include/yask_common_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/yask_compiler_api.hpp b/include/yask_compiler_api.hpp index 3fa253dc..173be321 100644 --- a/include/yask_compiler_api.hpp +++ b/include/yask_compiler_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/include/yask_kernel_api.hpp b/include/yask_kernel_api.hpp index 8fcf7cdd..bd1da286 100644 --- a/include/yask_kernel_api.hpp +++ b/include/yask_kernel_api.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/combo.cpp b/src/common/combo.cpp index 7f4caf76..5876e55e 100644 --- a/src/common/combo.cpp +++ b/src/common/combo.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/combo.hpp b/src/common/combo.hpp index 3561220c..b6f351f1 100644 --- a/src/common/combo.hpp +++ b/src/common/combo.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/common.mk b/src/common/common.mk index 1922cf84..5be13ea4 100644 --- a/src/common/common.mk +++ b/src/common/common.mk @@ -1,6 +1,6 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/common/common_utils.cpp b/src/common/common_utils.cpp index d3fbe57a..0d139fc5 100644 --- a/src/common/common_utils.cpp +++ b/src/common/common_utils.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -43,7 +43,7 @@ namespace yask { // for numbers above 9 (at least up to 99). // Format: "major.minor.patch". - const string version = "3.03.01"; + const string version = "3.04.01"; string yask_get_version_string() { return version; diff --git a/src/common/common_utils.hpp b/src/common/common_utils.hpp index 79b4ef76..0b850c7c 100644 --- a/src/common/common_utils.hpp +++ b/src/common/common_utils.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -41,6 +41,10 @@ IN THE SOFTWARE. // _OPENMP is defined. #ifdef _OPENMP #include +#if !defined(KMP_VERSION_MAJOR) || KMP_VERSION_MAJOR >= 5 +// omp_set_nested() is deprecated. +#define omp_set_nested(n) void(0) +#endif #else typedef int omp_lock_t; inline int omp_get_num_procs() { return 1; } diff --git a/src/common/fd_coeff2.cpp b/src/common/fd_coeff2.cpp index 52b29dc4..4d8c9541 100644 --- a/src/common/fd_coeff2.cpp +++ b/src/common/fd_coeff2.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/idiv.hpp b/src/common/idiv.hpp index 9d4c431b..d3a44567 100644 --- a/src/common/idiv.hpp +++ b/src/common/idiv.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/output.cpp b/src/common/output.cpp index f398cff4..2fbae142 100644 --- a/src/common/output.cpp +++ b/src/common/output.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/swig/yask_common_api.i b/src/common/swig/yask_common_api.i index 07fb788f..317e4fef 100644 --- a/src/common/swig/yask_common_api.i +++ b/src/common/swig/yask_common_api.i @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/tests/tuple_test.cpp b/src/common/tests/tuple_test.cpp index 8558ca39..a3425584 100644 --- a/src/common/tests/tuple_test.cpp +++ b/src/common/tests/tuple_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/tuple.cpp b/src/common/tuple.cpp index da7c3bcb..c1617c1b 100644 --- a/src/common/tuple.cpp +++ b/src/common/tuple.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/tuple.hpp b/src/common/tuple.hpp index 4b9e0a81..16e55560 100644 --- a/src/common/tuple.hpp +++ b/src/common/tuple.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/common/yask_assert.hpp b/src/common/yask_assert.hpp index d1c7284a..71dfea2d 100644 --- a/src/common/yask_assert.hpp +++ b/src/common/yask_assert.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/Makefile b/src/compiler/Makefile index 976d9983..21c82f07 100644 --- a/src/compiler/Makefile +++ b/src/compiler/Makefile @@ -1,6 +1,6 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/compiler_main.cpp b/src/compiler/compiler_main.cpp index 48133284..27fcf261 100644 --- a/src/compiler/compiler_main.cpp +++ b/src/compiler/compiler_main.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -373,7 +373,7 @@ int main(int argc, const char* argv[]) { cout << "YASK -- Yet Another Stencil Kit\n" "YASK Stencil Compiler Utility\n" - "Copyright (c) 2014-2019, Intel Corporation.\n" + "Copyright (c) 2014-2020, Intel Corporation.\n" "Version: " << yask_get_version_string() << endl; try { diff --git a/src/compiler/lib/Cpp.cpp b/src/compiler/lib/Cpp.cpp index 18aa3623..de52fed2 100644 --- a/src/compiler/lib/Cpp.cpp +++ b/src/compiler/lib/Cpp.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Cpp.hpp b/src/compiler/lib/Cpp.hpp index cea4d0bd..62d6156a 100644 --- a/src/compiler/lib/Cpp.hpp +++ b/src/compiler/lib/Cpp.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -275,7 +275,7 @@ namespace yask { // Print out a stencil in C++ form for YASK. class YASKCppPrinter : public PrinterBase { protected: - EqBundlePacks& _eqBundlePacks; // packs of bundles w/o inter-dependencies. + EqStages& _eqStages; // stages of bundles w/o inter-dependencies. EqBundles& _clusterEqBundles; // eq-bundles for scalar and vector. string _context, _context_base, _context_hook; // class names; @@ -304,10 +304,10 @@ namespace yask { public: YASKCppPrinter(StencilSolution& stencil, EqBundles& eqBundles, - EqBundlePacks& eqBundlePacks, + EqStages& eqStages, EqBundles& clusterEqBundles) : PrinterBase(stencil, eqBundles), - _eqBundlePacks(eqBundlePacks), + _eqStages(eqStages), _clusterEqBundles(clusterEqBundles) { // name of C++ struct. diff --git a/src/compiler/lib/CppIntrin.cpp b/src/compiler/lib/CppIntrin.cpp index 9f43700f..79438fab 100644 --- a/src/compiler/lib/CppIntrin.cpp +++ b/src/compiler/lib/CppIntrin.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/CppIntrin.hpp b/src/compiler/lib/CppIntrin.hpp index 21102351..e6c19f0c 100644 --- a/src/compiler/lib/CppIntrin.hpp +++ b/src/compiler/lib/CppIntrin.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -212,9 +212,9 @@ namespace yask { public: YASKKncPrinter(StencilSolution& stencil, EqBundles& eqBundles, - EqBundlePacks& eqBundlePacks, + EqStages& eqStages, EqBundles& clusterEqBundles) : - YASKCppPrinter(stencil, eqBundles, eqBundlePacks, clusterEqBundles) { } + YASKCppPrinter(stencil, eqBundles, eqStages, clusterEqBundles) { } virtual int num_vec_elems() const { return 64 / _settings._elem_bytes; } @@ -234,9 +234,9 @@ namespace yask { public: YASKAvx256Printer(StencilSolution& stencil, EqBundles& eqBundles, - EqBundlePacks& eqBundlePacks, + EqStages& eqStages, EqBundles& clusterEqBundles) : - YASKCppPrinter(stencil, eqBundles, eqBundlePacks, clusterEqBundles) { } + YASKCppPrinter(stencil, eqBundles, eqStages, clusterEqBundles) { } virtual int num_vec_elems() const { return 32 / _settings._elem_bytes; } }; @@ -254,10 +254,10 @@ namespace yask { public: YASKAvx512Printer(StencilSolution& stencil, EqBundles& eqBundles, - EqBundlePacks& eqBundlePacks, + EqStages& eqStages, EqBundles& clusterEqBundles, bool is_lo = false) : - YASKCppPrinter(stencil, eqBundles, eqBundlePacks, clusterEqBundles), + YASKCppPrinter(stencil, eqBundles, eqStages, clusterEqBundles), _is_lo(is_lo) { } virtual int num_vec_elems() const { diff --git a/src/compiler/lib/Eqs.cpp b/src/compiler/lib/Eqs.cpp index 18f16f64..93891508 100644 --- a/src/compiler/lib/Eqs.cpp +++ b/src/compiler/lib/Eqs.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -696,7 +696,7 @@ namespace yask { // Update access stats for the vars. // For now, this us just const indices. - // Halos are updated later, after packs are established. + // Halos are updated later, after stages are established. void Eqs::updateVarStats() { // Find all LHS and RHS points and vars for all eqs. @@ -1060,7 +1060,7 @@ namespace yask { } // Find halos needed for each var. - void EqBundlePacks::calcHalos(EqBundles& allBundles) { + void EqStages::calcHalos(EqBundles& allBundles) { // Find all LHS and RHS points and vars for all eqs. PointVisitor pv; @@ -1128,7 +1128,7 @@ namespace yask { // from the shadows. vector< map> shadows; - // Packs. + // Stages. for (auto& bp : getAll()) { auto pname = bp->getName(); auto& pbundles = bp->getBundles(); // list of bundles. @@ -1136,7 +1136,7 @@ namespace yask { // Bundles with their dependency info. for (auto& b1 : allBundles.getAll()) { - // Only need bundles in this pack. + // Only need bundles in this stage. if (pbundles.count(b1) == 0) continue; @@ -1267,7 +1267,7 @@ namespace yask { } // path. }); // lambda fn. } // bundles. - } // packs. + } // stages. // Apply the changes from the shadow vars. // This will result in the vars containing the max @@ -1474,13 +1474,13 @@ namespace yask { } } - // Make a human-readable description of this eq bundle pack. - string EqBundlePack::getDescr(string quote) const + // Make a human-readable description of this eq stage. + string EqStage::getDescr(string quote) const { string des; if (isScratch()) des += "scratch "; - des += "equation bundle-pack " + quote + getName() + quote; + des += "equation bundle-stage " + quote + getName() + quote; if (!isScratch()) { if (step_cond.get()) des += " w/step condition " + step_cond->makeQuotedStr(quote); @@ -1490,8 +1490,8 @@ namespace yask { return des; } - // Add a bundle to this pack. - void EqBundlePack::addBundle(EqBundlePtr bp) + // Add a bundle to this stage. + void EqStage::addBundle(EqBundlePtr bp) { _bundles.insert(bp); _isScratch = bp->isScratch(); @@ -1500,20 +1500,20 @@ namespace yask { for (auto& eq : bp->getEqs()) _eqs.insert(eq); - // update list of input and output vars for this pack. + // update list of input and output vars for this stage. for (auto& g : bp->getOutputVars()) _outVars.insert(g); for (auto& g : bp->getInputVars()) _inVars.insert(g); } - // Add 'bp' from 'allBundles'. Create new pack if needed. Returns - // whether a new pack was created. - bool EqBundlePacks::addBundleToPack(EqBundles& allBundles, + // Add 'bp' from 'allBundles'. Create new stage if needed. Returns + // whether a new stage was created. + bool EqStages::addBundleToStage(EqBundles& allBundles, EqBundlePtr bp) { // Already added? - if (_bundles_in_packs.count(bp)) + if (_bundles_in_stages.count(bp)) return false; // Get condition, if any. @@ -1522,9 +1522,9 @@ namespace yask { // Get deps between bundles. auto& deps = allBundles.getDeps(); - // Loop through existing packs, looking for one that + // Loop through existing stages, looking for one that // 'bp' can be added to. - EqBundlePack* target = 0; + EqStage* target = 0; for (auto& ep : getAll()) { // Must be same scratch-ness. @@ -1554,47 +1554,47 @@ namespace yask { } } - // Make new pack if no target pack found. - bool newPack = false; + // Make new stage if no target stage found. + bool newStage = false; if (!target) { - auto np = make_shared(bp->isScratch()); + auto np = make_shared(bp->isScratch()); addItem(np); target = np.get(); target->baseName = _baseName; target->index = _idx++; target->step_cond = stcond; - newPack = true; + newStage = true; } // Add bundle to target. assert(target); target->addBundle(bp); - // Remember pack and updated vars. - _bundles_in_packs.insert(bp); + // Remember stage and updated vars. + _bundles_in_stages.insert(bp); for (auto& g : bp->getOutputVars()) _outVars.insert(g); - return newPack; + return newStage; } - // Divide all bundles into packs. - void EqBundlePacks::makePacks(EqBundles& allBundles, + // Divide all bundles into stages. + void EqStages::makeStages(EqBundles& allBundles, ostream& os) { - os << "\nPartitioning " << allBundles.getNum() << " bundle(s) into packs...\n"; + os << "\nPartitioning " << allBundles.getNum() << " bundle(s) into stages...\n"; for (auto bp : allBundles.getAll()) - addBundleToPack(allBundles, bp); + addBundleToStage(allBundles, bp); os << "Collapsing dependencies from bundles and finding transitive closure...\n"; inherit_deps_from(allBundles); - os << "Topologically ordering packs...\n"; + os << "Topologically ordering stages...\n"; topo_sort(); // Dump info. - os << "Created " << getNum() << " equation bundle pack(s):\n"; + os << "Created " << getNum() << " equation stage(s):\n"; for (auto& bp1 : getAll()) { os << " " << bp1->getDescr() << ":\n" " Contains " << bp1->getBundles().size() << " bundle(s): "; @@ -1616,9 +1616,9 @@ namespace yask { // Deps. for (auto& bp2 : _deps.get_deps_on(bp1)) - os << " Dependent on bundle pack " << bp2->getName() << ".\n"; + os << " Dependent on stage " << bp2->getName() << ".\n"; for (auto& sp : _scratches.get_deps_on(bp1)) - os << " Requires scratch pack " << sp->getName() << ".\n"; + os << " Requires scratch stage " << sp->getName() << ".\n"; } } diff --git a/src/compiler/lib/Eqs.hpp b/src/compiler/lib/Eqs.hpp index 51dd0b49..3feb635b 100644 --- a/src/compiler/lib/Eqs.hpp +++ b/src/compiler/lib/Eqs.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -23,7 +23,7 @@ IN THE SOFTWARE. *****************************************************************************/ -///////// Classes for equations, equation bundles, and bundle packs. //////////// +///////// Classes for equations, equation bundles, and stages. //////////// #pragma once @@ -595,14 +595,14 @@ namespace yask { // A list of unique equation bundles. typedef vector_set EqBundleList; - // A named equation bundle pack, which contains one or more equation - // bundles. All equations in a pack do not need to have the same + // A named equation stage, which contains one or more equation + // bundles. All equations in a stage do not need to have the same // domain condition, but they must have the same step condition. - // Equations in a pack must not have inter-dependencies because they + // Equations in a stage must not have inter-dependencies because they // may be run in parallel or in any order on any sub-domain. - class EqBundlePack : public EqLot { + class EqStage : public EqLot { protected: - EqBundleList _bundles; // bundles in this pack. + EqBundleList _bundles; // bundles in this stage. public: @@ -610,13 +610,13 @@ namespace yask { boolExprPtr step_cond; // Ctor. - EqBundlePack(bool is_scratch) : + EqStage(bool is_scratch) : EqLot(is_scratch) { } - virtual ~EqBundlePack() { } + virtual ~EqStage() { } // Create a copy containing clones of the bundles. - virtual shared_ptr clone() const { - auto p = make_shared(_isScratch); + virtual shared_ptr clone() const { + auto p = make_shared(_isScratch); // Shallow copy. *p = *this; @@ -632,7 +632,7 @@ namespace yask { // Get a string description. virtual string getDescr(string quote = "'") const; - // Add a bundle to this pack. + // Add a bundle to this stage. virtual void addBundle(EqBundlePtr ee); // Get the list of all bundles @@ -655,10 +655,10 @@ namespace yask { }; - // Container for multiple equation bundle packs. - class EqBundlePacks : public DepGroup { + // Container for multiple equation stages. + class EqStages : public DepGroup { protected: - string _baseName = "stencil_pack"; + string _baseName = "stencil_stage"; // Bundle index. int _idx = 0; @@ -667,17 +667,17 @@ namespace yask { Vars _outVars; // Track bundles that have been added already. - set _bundles_in_packs; + set _bundles_in_stages; - // Add 'bp' from 'allBundles'. Create new pack if needed. Returns - // whether a new pack was created. - bool addBundleToPack(EqBundles& allBundles, + // Add 'bp' from 'allBundles'. Create new stage if needed. Returns + // whether a new stage was created. + bool addBundleToStage(EqBundles& allBundles, EqBundlePtr bp); public: - // Separate bundles into packs. - void makePacks(EqBundles& bundles, + // Separate bundles into stages. + void makeStages(EqBundles& bundles, std::ostream& os); // Get all output vars. @@ -685,7 +685,7 @@ namespace yask { return _outVars; } - // Visit all the equations in all packs. + // Visit all the equations in all stages. virtual void visitEqs(ExprVisitor* ev) { for (auto& bp : _all) bp->visitEqs(ev); @@ -694,7 +694,7 @@ namespace yask { // Find halos needed for each var. virtual void calcHalos(EqBundles& allBundles); - }; // EqBundlePacks. + }; // EqStages. } // namespace yask. diff --git a/src/compiler/lib/Expr.cpp b/src/compiler/lib/Expr.cpp index d4eb64cc..262117d6 100644 --- a/src/compiler/lib/Expr.cpp +++ b/src/compiler/lib/Expr.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Expr.hpp b/src/compiler/lib/Expr.hpp index dad61eff..ea9ac2c1 100644 --- a/src/compiler/lib/Expr.hpp +++ b/src/compiler/lib/Expr.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/ExprUtils.cpp b/src/compiler/lib/ExprUtils.cpp index 0bb8a3de..1aa11e90 100644 --- a/src/compiler/lib/ExprUtils.cpp +++ b/src/compiler/lib/ExprUtils.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/ExprUtils.hpp b/src/compiler/lib/ExprUtils.hpp index 9b617a4c..5d3f9ebf 100644 --- a/src/compiler/lib/ExprUtils.hpp +++ b/src/compiler/lib/ExprUtils.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Parse.hpp b/src/compiler/lib/Parse.hpp index c18d3e39..54f756cb 100644 --- a/src/compiler/lib/Parse.hpp +++ b/src/compiler/lib/Parse.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Print.cpp b/src/compiler/lib/Print.cpp index d725e182..da99b522 100644 --- a/src/compiler/lib/Print.cpp +++ b/src/compiler/lib/Print.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Print.hpp b/src/compiler/lib/Print.hpp index f93c68c0..60670d63 100644 --- a/src/compiler/lib/Print.hpp +++ b/src/compiler/lib/Print.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Settings.cpp b/src/compiler/lib/Settings.cpp index f93a5b1c..65f9150c 100644 --- a/src/compiler/lib/Settings.cpp +++ b/src/compiler/lib/Settings.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Settings.hpp b/src/compiler/lib/Settings.hpp index fcb43159..20ebd746 100644 --- a/src/compiler/lib/Settings.hpp +++ b/src/compiler/lib/Settings.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Solution.cpp b/src/compiler/lib/Solution.cpp index 23152f46..ea8bab02 100644 --- a/src/compiler/lib/Solution.cpp +++ b/src/compiler/lib/Solution.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -37,8 +37,8 @@ namespace yask { delete _printer; if (_eqBundles) delete _eqBundles; - if (_eqBundlePacks) - delete _eqBundlePacks; + if (_eqStages) + delete _eqStages; if (_clusterEqBundles) delete _clusterEqBundles; } @@ -187,16 +187,16 @@ namespace yask { // Optimize bundles. _eqBundles->optimizeEqBundles(_settings, "scalar & vector", false, *_dos); - // Separate bundles into packs. - _eqBundlePacks->makePacks(*_eqBundles, *_dos); + // Separate bundles into stages. + _eqStages->makeStages(*_eqBundles, *_dos); // Compute halos. - _eqBundlePacks->calcHalos(*_eqBundles); + _eqStages->calcHalos(*_eqBundles); // Make a copy of each equation at each cluster offset. // We will use these for inter-cluster optimizations and code generation. // NB: these cluster bundles do not maintain dependencies, so cannot be used - // for sorting, making packs, etc. + // for sorting, making stages, etc. *_dos << "\nConstructing cluster of equations containing " << _dims._clusterMults.product() << " vector(s)...\n"; *_clusterEqBundles = *_eqBundles; @@ -225,22 +225,22 @@ namespace yask { // Ensure all intermediate data is clean. _free(true); _eqBundles = new EqBundles; - _eqBundlePacks = new EqBundlePacks; + _eqStages = new EqStages; _clusterEqBundles = new EqBundles; // Create the appropriate printer object based on the format. // Most args to the printers just set references to data. // Data itself will be created in analyze_solution(). if (target == "intel64") - _printer = new YASKCppPrinter(*this, *_eqBundles, *_eqBundlePacks, *_clusterEqBundles); + _printer = new YASKCppPrinter(*this, *_eqBundles, *_eqStages, *_clusterEqBundles); else if (target == "knc") - _printer = new YASKKncPrinter(*this, *_eqBundles, *_eqBundlePacks, *_clusterEqBundles); + _printer = new YASKKncPrinter(*this, *_eqBundles, *_eqStages, *_clusterEqBundles); else if (target == "avx" || target == "avx2") - _printer = new YASKAvx256Printer(*this, *_eqBundles, *_eqBundlePacks, *_clusterEqBundles); + _printer = new YASKAvx256Printer(*this, *_eqBundles, *_eqStages, *_clusterEqBundles); else if (target == "avx512" || target == "knl") - _printer = new YASKAvx512Printer(*this, *_eqBundles, *_eqBundlePacks, *_clusterEqBundles); + _printer = new YASKAvx512Printer(*this, *_eqBundles, *_eqStages, *_clusterEqBundles); else if (target == "avx512lo") - _printer = new YASKAvx512Printer(*this, *_eqBundles, *_eqBundlePacks, *_clusterEqBundles, true); + _printer = new YASKAvx512Printer(*this, *_eqBundles, *_eqStages, *_clusterEqBundles, true); else if (target == "dot") _printer = new DOTPrinter(*this, *_clusterEqBundles, false); else if (target == "dot-lite") diff --git a/src/compiler/lib/Solution.hpp b/src/compiler/lib/Solution.hpp index 9a25fd85..8a35ac6c 100644 --- a/src/compiler/lib/Solution.hpp +++ b/src/compiler/lib/Solution.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -73,7 +73,7 @@ namespace yask { Dimensions _dims; // various dimensions. PrinterBase* _printer = 0; EqBundles* _eqBundles = 0; // eq-bundles for scalar and vector. - EqBundlePacks* _eqBundlePacks = 0; // packs of bundles w/o inter-dependencies. + EqStages* _eqStages = 0; // packs of bundles w/o inter-dependencies. EqBundles* _clusterEqBundles = 0; // eq-bundles for scalar and vector. // Create the intermediate data. diff --git a/src/compiler/lib/Var.cpp b/src/compiler/lib/Var.cpp index acbd9993..07baa9b9 100644 --- a/src/compiler/lib/Var.cpp +++ b/src/compiler/lib/Var.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -230,7 +230,7 @@ namespace yask { // Update halos based on each value in 'offsets' in some // read or write to this var. // This var's halos can only be increased. - void Var::updateHalo(const string& packName, const IntTuple& offsets) { + void Var::updateHalo(const string& stageName, const IntTuple& offsets) { // Find step value or use 0 if none. int stepVal = 0; @@ -249,7 +249,7 @@ namespace yask { auto& dname = dim.getName(); int val = dim.getVal(); bool left = val <= 0; - auto& halos = _halos[packName][left][stepVal]; + auto& halos = _halos[stageName][left][stepVal]; // Don't keep halo in step dim. if (stepDim && dname == stepDim->getName()) @@ -323,10 +323,10 @@ namespace yask { if (_halos.size() == 0) return 1; - // Need the max across all packs. + // Need the max across all stages. int max_sz = 1; - // Loop thru each pack w/halos. + // Loop thru each stage w/halos. for (auto& hi : _halos) { #ifdef DEBUG_HALOS auto& pname = hi.first; @@ -351,7 +351,7 @@ namespace yask { if (halo.size()) { #ifdef DEBUG_HALOS cout << "** var " << _name << " has halo " << halo.makeDimValStr() << - " at ofs " << ofs << " in pack " << pname << endl; + " at ofs " << ofs << " in stage " << pname << endl; #endif // Update vars. @@ -366,7 +366,7 @@ namespace yask { } #ifdef DEBUG_HALOS cout << "** var " << _name << " has halos from " << first_ofs << - " to " << last_ofs << " in pack " << pname << endl; + " to " << last_ofs << " in stage " << pname << endl; #endif // Only need to process if >1 offset. @@ -398,7 +398,7 @@ namespace yask { max_sz = max(max_sz, sz); } - } // packs. + } // stages. return max_sz; } diff --git a/src/compiler/lib/Var.hpp b/src/compiler/lib/Var.hpp index f6f77617..0968e89e 100644 --- a/src/compiler/lib/Var.hpp +++ b/src/compiler/lib/Var.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -67,7 +67,7 @@ namespace yask { // Max abs-value of domain-index halos required by all eqs at // various step-index values. - // string key: name of pack. + // string key: name of stage. // bool key: true=left, false=right. // int key: step-dim offset or 0 if no step-dim. map>> _halos; @@ -122,11 +122,11 @@ namespace yask { virtual const IntTuple& getMinIndices() const { return _minIndices; } virtual const IntTuple& getMaxIndices() const { return _maxIndices; } - // Get the max sizes of halo across all steps for given pack. - virtual IntTuple getHaloSizes(const string& packName, bool left) const { + // Get the max sizes of halo across all steps for given stage. + virtual IntTuple getHaloSizes(const string& stageName, bool left) const { IntTuple halo; - if (_halos.count(packName) && _halos.at(packName).count(left)) { - for (auto i : _halos.at(packName).at(left)) { + if (_halos.count(stageName) && _halos.at(stageName).count(left)) { + for (auto i : _halos.at(stageName).at(left)) { auto& hs = i.second; // halo at step-val 'i'. halo = halo.makeUnionWith(hs); halo = halo.maxElements(hs, false); @@ -135,7 +135,7 @@ namespace yask { return halo; } - // Get the max size in 'dim' of halo across all packs and steps. + // Get the max size in 'dim' of halo across all stages and steps. virtual int getHaloSize(const string& dim, bool left) const { int h = 0; for (auto& hi : _halos) { @@ -185,7 +185,7 @@ namespace yask { virtual void updateHalo(const Var& other); // Update halos and L1 dist based on each value in 'offsets'. - virtual void updateHalo(const string& packName, const IntTuple& offsets); + virtual void updateHalo(const string& stageName, const IntTuple& offsets); // Update L1 dist. virtual void updateL1Dist(int l1Dist) { diff --git a/src/compiler/lib/Vec.cpp b/src/compiler/lib/Vec.cpp index c0f27984..be715f0c 100644 --- a/src/compiler/lib/Vec.cpp +++ b/src/compiler/lib/Vec.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Vec.hpp b/src/compiler/lib/Vec.hpp index 7ad529e2..5a68196e 100644 --- a/src/compiler/lib/Vec.hpp +++ b/src/compiler/lib/Vec.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/Visitor.hpp b/src/compiler/lib/Visitor.hpp index c02a0ce0..43199254 100644 --- a/src/compiler/lib/Visitor.hpp +++ b/src/compiler/lib/Visitor.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/lib/YaskKernel.cpp b/src/compiler/lib/YaskKernel.cpp index db248265..393e76f9 100644 --- a/src/compiler/lib/YaskKernel.cpp +++ b/src/compiler/lib/YaskKernel.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -877,13 +877,13 @@ namespace yask { } } // bundles. - // Packs. - os << "\n // Stencil bundle packs.\n"; - for (auto& bp : _eqBundlePacks.getAll()) { + // Stages. + os << "\n // Stencil stages.\n"; + for (auto& bp : _eqStages.getAll()) { if (bp->isScratch()) continue; string bpName = bp->getName(); - os << " auto " << bpName << " = std::make_shared(this, \"" << + os << " auto " << bpName << " = std::make_shared(this, \"" << bpName << "\");\n"; for (auto& eg : bp->getBundles()) { if (eg->isScratch()) @@ -891,7 +891,7 @@ namespace yask { string egName = eg->getName(); os << " " << bpName << "->push_back(&" << egName << ");\n"; } - os << " stPacks.push_back(" << bpName << ");\n"; + os << " stStages.push_back(" << bpName << ");\n"; } os << "\n // Call code provided by user.\n" << diff --git a/src/compiler/swig/yask_compiler_api.i b/src/compiler/swig/yask_compiler_api.i index 7afbb8a7..fc535e48 100644 --- a/src/compiler/swig/yask_compiler_api.i +++ b/src/compiler/swig/yask_compiler_api.i @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/tests/yask_compiler_api_exception_test.cpp b/src/compiler/tests/yask_compiler_api_exception_test.cpp index 7ca9c2f0..94cd8196 100644 --- a/src/compiler/tests/yask_compiler_api_exception_test.cpp +++ b/src/compiler/tests/yask_compiler_api_exception_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/tests/yask_compiler_api_exception_test.py b/src/compiler/tests/yask_compiler_api_exception_test.py index 419a26ab..81380909 100755 --- a/src/compiler/tests/yask_compiler_api_exception_test.py +++ b/src/compiler/tests/yask_compiler_api_exception_test.py @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/tests/yask_compiler_api_test.cpp b/src/compiler/tests/yask_compiler_api_test.cpp index e4d43d90..3a28af15 100644 --- a/src/compiler/tests/yask_compiler_api_test.cpp +++ b/src/compiler/tests/yask_compiler_api_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/tests/yask_compiler_api_test.py b/src/compiler/tests/yask_compiler_api_test.py index 51b2c14f..6fc8752f 100755 --- a/src/compiler/tests/yask_compiler_api_test.py +++ b/src/compiler/tests/yask_compiler_api_test.py @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/contrib/coefficients/fd_coeff.cpp b/src/contrib/coefficients/fd_coeff.cpp index 5d94ab42..249630e8 100644 --- a/src/contrib/coefficients/fd_coeff.cpp +++ b/src/contrib/coefficients/fd_coeff.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/contrib/coefficients/fd_coeff.hpp b/src/contrib/coefficients/fd_coeff.hpp index ddff31b9..34ac00d3 100644 --- a/src/contrib/coefficients/fd_coeff.hpp +++ b/src/contrib/coefficients/fd_coeff.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/contrib/coefficients/fd_coeff_test.cpp b/src/contrib/coefficients/fd_coeff_test.cpp index 45e2ba88..a2fecf18 100644 --- a/src/contrib/coefficients/fd_coeff_test.cpp +++ b/src/contrib/coefficients/fd_coeff_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/Makefile b/src/kernel/Makefile index dcf2b388..8775ecb0 100644 --- a/src/kernel/Makefile +++ b/src/kernel/Makefile @@ -1,6 +1,6 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to @@ -768,9 +768,9 @@ stencil-tests: $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_stream_3d radius=5 $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_reverse_2d radius=1 $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_func_1d fold=x=4 - $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_dep_1d fold=x=4 - $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_dep_2d fold=x=2,y=2 - $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_dep_3d fold=y=2,x=2 domain_dims=x,z,y + $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_stages_1d fold=x=4 + $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_stages_2d fold=x=2,y=2 + $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_stages_3d fold=y=2,x=2 domain_dims=x,z,y $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_misc_2d fold=x=2,y=2 $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_misc_2d fold=x=2,y=2 EXTRA_YC_FLAGS=-interleave-misc $(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_step_cond_1d fold=x=4 diff --git a/src/kernel/lib/alloc.cpp b/src/kernel/lib/alloc.cpp index b341a04b..8602d478 100644 --- a/src/kernel/lib/alloc.cpp +++ b/src/kernel/lib/alloc.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -813,11 +813,11 @@ namespace yask { // data allocated. makeScratchVars(rthreads); - // Find the max mini-block size across all packs. - // They can be different across packs when pack-specific + // Find the max mini-block size across all stages. + // They can be different across stages when stage-specific // auto-tuning has been used. IdxTuple mblksize(domain_dims); - for (auto& sp : stPacks) { + for (auto& sp : stStages) { auto& psettings = sp->getActiveSettings(); DOMAIN_VAR_LOOP(i, j) { @@ -826,7 +826,7 @@ namespace yask { mblksize[j] = max(mblksize[j], sz); } } - TRACE_MSG("allocScratchData: max mini-block size across pack(s) is " << + TRACE_MSG("allocScratchData: max mini-block size across stage(s) is " << mblksize.makeDimValStr(" * ")); // Pass 0: count required size, allocate chunk of memory at end. diff --git a/src/kernel/lib/auto_tuner.cpp b/src/kernel/lib/auto_tuner.cpp index b778e34b..3fc5d5ba 100644 --- a/src/kernel/lib/auto_tuner.cpp +++ b/src/kernel/lib/auto_tuner.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -50,8 +50,8 @@ namespace yask { _at.steps_done += num_steps; _at.timer.stop(); - if (state->_use_pack_tuners) { - for (auto& sp : stPacks) + if (state->_use_stage_tuners) { + for (auto& sp : stStages) sp->getAT().eval(); } else @@ -60,7 +60,7 @@ namespace yask { // Reset auto-tuners. void StencilContext::reset_auto_tuner(bool enable, bool verbose) { - for (auto& sp : stPacks) + for (auto& sp : stStages) sp->getAT().clear(!enable, verbose); _at.clear(!enable, verbose); } @@ -69,8 +69,8 @@ namespace yask { bool StencilContext::is_auto_tuner_enabled() const { STATE_VARS(this); bool done = true; - if (state->_use_pack_tuners) { - for (auto& sp : stPacks) + if (state->_use_stage_tuners) { + for (auto& sp : stStages) if (!sp->getAT().is_done()) done = false; } else @@ -93,7 +93,7 @@ namespace yask { enable_halo_exchange = false; // Temporarily ignore step conditions to force eval of conditional - // bundles. NB: may affect perf, e.g., if packs A and B run in + // bundles. NB: may affect perf, e.g., if stages A and B run in // AAABAAAB sequence, perf may be [very] different if run as // ABABAB..., esp. w/temporal tiling. TODO: work around this. check_step_conds = false; @@ -134,8 +134,8 @@ namespace yask { at_timer.stop(); DEBUG_MSG("Auto-tuner done after " << steps_done << " step(s) in " << makeNumStr(at_timer.get_elapsed_secs()) << " secs."); - if (state->_use_pack_tuners) { - for (auto& sp : stPacks) + if (state->_use_stage_tuners) { + for (auto& sp : stStages) sp->getAT().print_settings(); } else _at.print_settings(); diff --git a/src/kernel/lib/auto_tuner.hpp b/src/kernel/lib/auto_tuner.hpp index 0eddd291..9a7089ed 100644 --- a/src/kernel/lib/auto_tuner.hpp +++ b/src/kernel/lib/auto_tuner.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/cache_model.hpp b/src/kernel/lib/cache_model.hpp index 3be45bc2..48be4c46 100644 --- a/src/kernel/lib/cache_model.hpp +++ b/src/kernel/lib/cache_model.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/context.cpp b/src/kernel/lib/context.cpp index 197f991e..ae3f914c 100644 --- a/src/kernel/lib/context.cpp +++ b/src/kernel/lib/context.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -70,8 +70,8 @@ namespace yask { opts->adjustSettings(); update_var_info(true); - // Copy these settings to packs and realloc scratch vars. - for (auto& sp : stPacks) + // Copy these settings to stages and realloc scratch vars. + for (auto& sp : stStages) sp->getLocalSettings() = *opts; allocScratchData(); @@ -112,8 +112,8 @@ namespace yask { rank_idxs.stop[step_posn] = stop_t; rank_idxs.stride[step_posn] = stride_t; - // Loop thru bundles. We ignore bundle packs here - // because packing bundles is an optional optimizations. + // Loop thru bundles. We ignore stages here + // because staging is an optional optimizations. for (auto* asg : stBundles) { // Scan through n-D space. @@ -179,7 +179,7 @@ namespace yask { run_time.stop(); } // run_ref. - // Eval stencil bundle pack(s) over var(s) using optimized code. + // Eval stage(s) over var(s) using optimized code. void StencilContext::run_solution(idx_t first_step_index, idx_t last_step_index) { @@ -241,8 +241,8 @@ namespace yask { // Adjust end points for overlapping regions due to wavefront angle. // For each subsequent time step in a region, the spatial location // of each block evaluation is shifted by the angle for each - // bundle pack. So, the total shift in a region is the angle * num - // packs * num timesteps. This assumes all bundle packs + // stage. So, the total shift in a region is the angle * num + // stages * num timesteps. This assumes all stages // are inter-dependent to find maximum extension. Actual required // size may be less, but this will just result in some calls to // calc_region() that do nothing. @@ -325,18 +325,18 @@ namespace yask { // Start timer for auto-tuner. _at.timer.start(); - // If no wave-fronts (default), loop through packs here, and do - // only one pack at a time in calc_region(). This is similar to - // loop in calc_rank_ref(), but with packs instead of bundles. + // If no wave-fronts (default), loop through stages here, and do + // only one stage at a time in calc_region(). This is similar to + // loop in calc_rank_ref(), but with stages instead of bundles. if (wf_steps == 0) { - // Loop thru packs. - for (auto& bp : stPacks) { + // Loop thru stages. + for (auto& bp : stStages) { // Check step. if (check_step_conds && !bp->is_in_valid_step(start_t)) { TRACE_MSG("run_solution: step " << start_t << - " not valid for pack '" << + " not valid for stage '" << bp->get_name() << "'"); continue; } @@ -359,7 +359,7 @@ namespace yask { // Include automatically-generated loop code that calls // calc_region(bp) for each region. TRACE_MSG("run_solution: step " << start_t << - " for pack '" << bp->get_name() << "' in MPI exterior"); + " for stage '" << bp->get_name() << "' in MPI exterior"); #include "yask_rank_loops.hpp" #else @@ -388,7 +388,7 @@ namespace yask { // each region. The region will be trimmed // to the active MPI exterior section. TRACE_MSG("run_solution: step " << start_t << - " for pack '" << bp->get_name() << + " for stage '" << bp->get_name() << "' in MPI exterior dim " << j << " on the " << (is_left ? "left" : "right")); #include "yask_rank_loops.hpp" @@ -397,7 +397,7 @@ namespace yask { #endif // Mark vars that [may] have been written to by - // this pack. Mark vars as dirty even if not + // this stage. Mark vars as dirty even if not // actually written by this rank, perhaps due to // sub-domains or asymmetrical stencils. This is // needed because neighbors will not know what vars @@ -422,7 +422,7 @@ namespace yask { // comms, this will be just the interior. If not, it // will cover the whole rank. TRACE_MSG("run_solution: step " << start_t << - " for pack '" << bp->get_name() << "'"); + " for stage '" << bp->get_name() << "'"); #include "yask_rank_loops.hpp" // Mark as dirty only if we did exterior. @@ -436,16 +436,16 @@ namespace yask { // Set the overlap flags back to default. do_mpi_interior = do_mpi_left = do_mpi_right = true; - } // packs. + } // stages. } // No WF tiling. - // If doing wave-fronts, must loop through all packs in + // If doing wave-fronts, must loop through all stages in // calc_region(). else { - // Null ptr => Eval all stencil packs each time + // Null ptr => Eval all stages each time // calc_region() is called. - BundlePackPtr bp; + StagePtr bp; // Do MPI-external passes? if (mpi_interior.bb_valid) { @@ -482,7 +482,7 @@ namespace yask { } // left/right. } // domain dims. - // Mark vars dirty for all packs. + // Mark vars dirty for all stages. update_vars(bp, start_t, stop_t, true); // Do the appropriate steps for halo exchange of exterior. @@ -519,13 +519,13 @@ namespace yask { // Overall steps. steps_done += this_num_t; - // Count steps for each pack to properly account for + // Count steps for each stage to properly account for // step conditions when using temporal tiling. - for (auto& bp : stPacks) { - idx_t num_pack_steps = 0; + for (auto& bp : stStages) { + idx_t num_stage_steps = 0; if (!check_step_conds) - num_pack_steps = this_num_t; + num_stage_steps = this_num_t; else { // Loop through each step. @@ -534,12 +534,12 @@ namespace yask { // Check step cond for this t. if (bp->is_in_valid_step(t)) - num_pack_steps++; + num_stage_steps++; } } - // Count steps for this pack. - bp->add_steps(num_pack_steps); + // Count steps for this stage. + bp->add_steps(num_stage_steps); } // Call the auto-tuner to evaluate these steps. @@ -569,10 +569,10 @@ namespace yask { // Calculate results within a region. Each region is typically computed // in a separate OpenMP 'for' region. In this function, we loop over - // the time steps and bundle packs and evaluate a pack in each of - // the blocks in the region. If 'sel_bp' is null, eval all packs; else + // the time steps and stages and evaluate a stage in each of + // the blocks in the region. If 'sel_bp' is null, eval all stages; else // eval only the one pointed to. - void StencilContext::calc_region(BundlePackPtr& sel_bp, + void StencilContext::calc_region(StagePtr& sel_bp, const ScanIndices& rank_idxs) { STATE_VARS(this); TRACE_MSG("calc_region: region [" << @@ -617,31 +617,31 @@ namespace yask { region_idxs.start[step_posn] = start_t; region_idxs.stop[step_posn] = stop_t; - // If no temporal blocking (default), loop through packs here, - // and do only one pack at a time in calc_block(). If there is - // no WF blocking either, the pack loop body will only execute - // with one active pack, and 'region_shift_num' will never be > 0. + // If no temporal blocking (default), loop through stages here, + // and do only one stage at a time in calc_block(). If there is + // no WF blocking either, the stage loop body will only execute + // with one active stage, and 'region_shift_num' will never be > 0. if (tb_steps == 0) { - // Stencil bundle packs to evaluate at this time step. - for (auto& bp : stPacks) { + // Stages to evaluate at this time step. + for (auto& bp : stStages) { - // Not a selected bundle pack? + // Not a selected stage? if (sel_bp && sel_bp != bp) continue; - TRACE_MSG("calc_region: no TB; pack '" << + TRACE_MSG("calc_region: no TB; stage '" << bp->get_name() << "' in step(s) [" << start_t << " ... " << stop_t << ")"); // Check step. if (check_step_conds && !bp->is_in_valid_step(start_t)) { TRACE_MSG("calc_region: step " << start_t << - " not valid for pack '" << bp->get_name() << "'"); + " not valid for stage '" << bp->get_name() << "'"); continue; } - // Strides within a region are based on pack block sizes. + // Strides within a region are based on stage block sizes. auto& settings = bp->getActiveSettings(); region_idxs.stride = settings._block_sizes; region_idxs.stride[step_posn] = stride_t; @@ -651,7 +651,7 @@ namespace yask { // Set region_idxs begin & end based on shifted rank // start & stop (original region begin & end), rank - // boundaries, and pack BB. This will be the base of the + // boundaries, and stage BB. This will be the base of the // region loops. bool ok = shift_region(rank_idxs.start, rank_idxs.stop, region_shift_num, bp, @@ -682,21 +682,21 @@ namespace yask { #include "yask_region_loops.hpp" } - // Need to shift for next pack and/or time. + // Need to shift for next stage and/or time. region_shift_num++; - } // stencil bundle packs. + } // stages. } // no temporal blocking. - // If using TB, iterate thru steps in a WF and packs in calc_block(). + // If using TB, iterate thru steps in a WF and stages in calc_block(). else { TRACE_MSG("calc_region: w/TB in step(s) [" << start_t << " ... " << stop_t << ")"); - // Null ptr => Eval all stencil packs each time + // Null ptr => Eval all stages each time // calc_block() is called. - BundlePackPtr bp; + StagePtr bp; // Strides within a region are based on rank block sizes. auto& settings = *opts; @@ -740,19 +740,19 @@ namespace yask { #include "yask_region_loops.hpp" } - // Loop thru stencil bundle packs that were evaluated in + // Loop thru stages that were evaluated in // these 'tb_steps' to increment shift for next region // "layer", if any. This is needed when there are more WF // steps than TB steps. TODO: consider moving this inside // calc_block(). for (idx_t t = start_t; t != stop_t; t += step_dir) { - for (auto& bp : stPacks) { + for (auto& bp : stStages) { // Check step. if (check_step_conds && !bp->is_in_valid_step(t)) continue; - // One shift for each pack in each TB step. + // One shift for each stage in each TB step. region_shift_num++; } } @@ -771,11 +771,11 @@ namespace yask { } // calc_region. // Calculate results within a block. This function calls - // 'calc_mini_block()' for the specified pack or all packs if 'sel_bp' + // 'calc_mini_block()' for the specified stage or all stages if 'sel_bp' // is null. When using TB, only the shape(s) needed for the tesselation // 'phase' are computed. Typically called by a top-level OMP thread // from calc_region(). - void StencilContext::calc_block(BundlePackPtr& sel_bp, + void StencilContext::calc_block(StagePtr& sel_bp, idx_t region_shift_num, idx_t nphases, idx_t phase, const ScanIndices& rank_idxs, @@ -846,7 +846,7 @@ namespace yask { assert(stride_t); const idx_t num_t = CEIL_DIV(abs(end_t - begin_t), abs(stride_t)); - // If TB is not being used, just process the given pack. + // If TB is not being used, just process the given stage. // No need for a time loop. // No need to check bounds, because they were checked in // calc_region() when not using TB. @@ -861,7 +861,7 @@ namespace yask { block_idxs.start[step_posn] = begin_t; block_idxs.stop[step_posn] = end_t; - // Strides within a block are based on pack mini-block sizes. + // Strides within a block are based on stage mini-block sizes. auto& settings = bp->getActiveSettings(); block_idxs.stride = settings._mini_block_sizes; block_idxs.stride[step_posn] = stride_t; @@ -870,7 +870,7 @@ namespace yask { block_idxs.group_size = settings._mini_block_group_sizes; // Default settings for no TB. - BundlePackPtr bp = sel_bp; + StagePtr bp = sel_bp; assert(phase == 0); idx_t nshapes = 1; idx_t shape = 0; @@ -959,7 +959,7 @@ namespace yask { // Include automatically-generated loop code that calls // calc_mini_block() for each mini-block in this block. - BundlePackPtr bp; // null. + StagePtr bp; // null. #include "yask_block_loops.hpp" } // shape loop. @@ -968,12 +968,12 @@ namespace yask { // Calculate results within a mini-block. // This function calls 'StencilBundleBase::calc_mini_block()' - // for each bundle in the specified pack or all packs if 'sel_bp' is + // for each bundle in the specified stage or all stages if 'sel_bp' is // null. When using TB, only the 'shape' needed for the tesselation // 'phase' are computed. The starting 'shift_num' is relative // to the bottom of the current region and block. void StencilContext::calc_mini_block(int region_thread_idx, - BundlePackPtr& sel_bp, + StagePtr& sel_bp, idx_t region_shift_num, idx_t nphases, idx_t phase, idx_t nshapes, idx_t shape, @@ -1038,27 +1038,27 @@ namespace yask { mini_block_idxs.start[step_posn] = start_t; mini_block_idxs.stop[step_posn] = stop_t; - // Stencil bundle packs to evaluate at this time step. - for (auto& bp : stPacks) { + // Stages to evaluate at this time step. + for (auto& bp : stStages) { - // Not a selected bundle pack? + // Not a selected stage? if (sel_bp && sel_bp != bp) continue; // Check step. if (check_step_conds && !bp->is_in_valid_step(start_t)) { TRACE_MSG("calc_mini_block: step " << start_t << - " not valid for pack '" << + " not valid for stage '" << bp->get_name() << "'"); continue; } TRACE_MSG("calc_mini_block: phase " << phase << ", shape " << shape << ", step " << start_t << - ", pack '" << bp->get_name() << + ", stage '" << bp->get_name() << "', shift-num " << shift_num); - // Start timers for this pack. Tracking only on thread + // Start timers for this stage. Tracking only on thread // 0. TODO: track all threads and report cross-thread stats. if (region_thread_idx == 0) bp->start_timers(); @@ -1074,7 +1074,7 @@ namespace yask { // Set mini_block_idxs begin & end based on shifted rank // start & stop (original region begin & end), rank - // boundaries, and pack BB. There may be several TB layers + // boundaries, and stage BB. There may be several TB layers // within a region WF, so we need to add the region and // local mini-block shift counts. bool ok = shift_region(rank_idxs.start, rank_idxs.stop, @@ -1112,35 +1112,35 @@ namespace yask { make_stores_visible(); } - // Need to shift for next pack and/or time-step. + // Need to shift for next stage and/or time-step. shift_num++; - // Stop timers for this pack. + // Stop timers for this stage. if (region_thread_idx == 0) bp->stop_timers(); - } // packs. + } // stages. } // time-steps. } // calc_mini_block(). // Find boundaries within region with 'base_start' to 'base_stop' // shifted 'shift_num' times, which should start at 0 and increment for - // each pack in each time-step. Trim to ext-BB and MPI section if 'bp' if + // each stage in each time-step. Trim to ext-BB and MPI section if 'bp' if // not null. Write results into 'begin' and 'end' in 'idxs'. Return // 'true' if resulting area is non-empty, 'false' if empty. bool StencilContext::shift_region(const Indices& base_start, const Indices& base_stop, idx_t shift_num, - BundlePackPtr& bp, + StagePtr& bp, ScanIndices& idxs) { STATE_VARS(this); // For wavefront adjustments, see conceptual diagram in - // run_solution(). At each pack and time-step, the parallelogram + // run_solution(). At each stage and time-step, the parallelogram // may be trimmed based on the BB and WF extensions outside of the // rank-BB. - // Actual region boundaries must stay within [extended] pack BB. + // Actual region boundaries must stay within [extended] stage BB. // We have to calculate the posn in the extended rank at each // value of 'shift_num' because it is being shifted spatially. bool ok = true; @@ -1155,10 +1155,10 @@ namespace yask { idx_t rstart = base_start[i] - shift_amt; idx_t rstop = base_stop[i] - shift_amt; - // Trim only if pack is specified. + // Trim only if stage is specified. if (bp.get()) { - // Trim to extended BB of pack. This will also trim + // Trim to extended BB of stage. This will also trim // to the extended BB of the rank. auto& pbb = bp.get()->getBB(); rstart = max(rstart, pbb.bb_begin[j]); @@ -1304,7 +1304,7 @@ namespace yask { // For given 'phase' and 'shape', find boundaries within mini-block at // 'mb_base_start' to 'mb_base_stop' shifted by 'mb_shift_num', which - // should start at 0 and increment for each pack in each time-step. + // should start at 0 and increment for each stage in each time-step. // 'mb_base' is subset of 'adj_block_base'. Also trim to block at // 'block_base_start' to 'block_base_stop' shifted by 'mb_shift_num'. // Input 'begin' and 'end' of 'idxs' should be trimmed to region. Writes @@ -1324,7 +1324,7 @@ namespace yask { const BridgeMask& bridge_mask, ScanIndices& idxs) { STATE_VARS(this); - auto npacks = stPacks.size(); + auto nstages = stStages.size(); bool ok = true; // Loop thru dims, breaking out if any dim has no work. @@ -1359,7 +1359,7 @@ namespace yask { // Adjust these based on current shift. Adjust by pts in one TB // step, reducing size on R & L sides. But if block is first // and/or last, clamp to region. TODO: have different R & L - // angles. TODO: have different shifts for each pack. + // angles. TODO: have different shifts for each stage. // Shift start to right unless first. First block will be a // parallelogram or trapezoid clamped to beginning of region. @@ -1926,25 +1926,25 @@ namespace yask { #endif } - // Update data in vars that have been written to by bundle pack 'sel_bp'. - void StencilContext::update_vars(const BundlePackPtr& sel_bp, + // Update data in vars that have been written to by stage 'sel_bp'. + void StencilContext::update_vars(const StagePtr& sel_bp, idx_t start, idx_t stop, bool mark_dirty) { STATE_VARS(this); idx_t stride = (start > stop) ? -1 : 1; map> vars_done; - // Stencil bundle packs. - for (auto& bp : stPacks) { + // Stages. + for (auto& bp : stStages) { - // Not a selected bundle pack? + // Not a selected stage? if (sel_bp && sel_bp != bp) continue; // Each input step. for (idx_t t = start; t != stop; t += stride) { - // Each bundle in this pack. + // Each bundle in this stage. for (auto* sb : *bp) { // Get output step for this bundle, if any. @@ -1971,7 +1971,7 @@ namespace yask { } } // bundles. } // steps. - } // packs. + } // stages. } // update_vars(). // Reset any locks, etc. diff --git a/src/kernel/lib/context.hpp b/src/kernel/lib/context.hpp index f8515702..675e61cf 100644 --- a/src/kernel/lib/context.hpp +++ b/src/kernel/lib/context.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -163,11 +163,11 @@ namespace yask { // Things in a context. class StencilBundleBase; - class BundlePack; + class Stage; typedef std::vector StencilBundleList; typedef std::set StencilBundleSet; - typedef std::shared_ptr BundlePackPtr; - typedef std::vector BundlePackList; + typedef std::shared_ptr StagePtr; + typedef std::vector StageList; typedef std::vector BridgeMask; // Data and hierarchical sizes. @@ -246,9 +246,9 @@ namespace yask { // they should be evaluated within a step. StencilBundleList stBundles; - // List of all non-scratch stencil-bundle packs in the order in + // List of all non-scratch stencil-stages in the order in // which they should be evaluated within a step. - BundlePackList stPacks; + StageList stStages; // All non-scratch vars, including those created by APIs. VarPtrs varPtrs; @@ -462,11 +462,11 @@ namespace yask { idx_t last_step_index); // Calculate results within a region. - void calc_region(BundlePackPtr& sel_bp, + void calc_region(StagePtr& sel_bp, const ScanIndices& rank_idxs); // Calculate results within a block. - void calc_block(BundlePackPtr& sel_bp, + void calc_block(StagePtr& sel_bp, idx_t region_shift_num, idx_t nphases, idx_t phase, const ScanIndices& rank_idxs, @@ -474,7 +474,7 @@ namespace yask { // Calculate results within a mini-block. void calc_mini_block(int region_thread_idx, - BundlePackPtr& sel_bp, + StagePtr& sel_bp, idx_t region_shift_num, idx_t nphases, idx_t phase, idx_t nshapes, idx_t shape, @@ -490,17 +490,17 @@ namespace yask { // Call MPI_Test() on all unfinished requests to promote MPI progress. void poke_halo_exchange(); - // Update valid steps in vars that have been written to by bundle pack 'sel_bp'. + // Update valid steps in vars that have been written to by stage 'sel_bp'. // If sel_bp==null, use all bundles. // If 'mark_dirty', also mark as needing halo exchange. - void update_vars(const BundlePackPtr& sel_bp, + void update_vars(const StagePtr& sel_bp, idx_t start, idx_t stop, bool mark_dirty); // Set various limits in 'idxs' based on current step in region. bool shift_region(const Indices& base_start, const Indices& base_stop, idx_t shift_num, - BundlePackPtr& bp, + StagePtr& bp, ScanIndices& idxs); // Set various limits in 'idxs' based on current step in block. diff --git a/src/kernel/lib/factory.cpp b/src/kernel/lib/factory.cpp index a4ede07c..8b7cf6e3 100644 --- a/src/kernel/lib/factory.cpp +++ b/src/kernel/lib/factory.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/generic_var.cpp b/src/kernel/lib/generic_var.cpp index 51d74b86..549a789f 100644 --- a/src/kernel/lib/generic_var.cpp +++ b/src/kernel/lib/generic_var.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/generic_var.hpp b/src/kernel/lib/generic_var.hpp index f3b50844..ac72b9ae 100644 --- a/src/kernel/lib/generic_var.hpp +++ b/src/kernel/lib/generic_var.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/indices.hpp b/src/kernel/lib/indices.hpp index fd2ce2a9..03badec5 100644 --- a/src/kernel/lib/indices.hpp +++ b/src/kernel/lib/indices.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/new_var.cpp b/src/kernel/lib/new_var.cpp index 07229d47..d2a5c3ae 100644 --- a/src/kernel/lib/new_var.cpp +++ b/src/kernel/lib/new_var.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/realv.hpp b/src/kernel/lib/realv.hpp index df6866be..8220769f 100644 --- a/src/kernel/lib/realv.hpp +++ b/src/kernel/lib/realv.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/settings.cpp b/src/kernel/lib/settings.cpp index 458bc4f2..9332c952 100644 --- a/src/kernel/lib/settings.cpp +++ b/src/kernel/lib/settings.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -435,11 +435,11 @@ namespace yask { "Particularly useful when using temporal block tiling.", _tune_mini_blks)); parser.add_option(new CommandLineParser::BoolOption - ("auto_tune_each_pass", - "Apply the auto-tuner separately to each stencil pack when " - "those packs are applied in separate passes across the entire var, " + ("auto_tune_each_stage", + "Apply the auto-tuner separately to each stage when " + "those stages are applied in separate passes across the entire var, " "i.e., when no temporal tiling is used.", - _allow_pack_tuners)); + _allow_stage_tuners)); } // Print usage message. @@ -516,7 +516,7 @@ namespace yask { " block size is set to region size in that dimension.\n" " A block size of 0 in the step dimension (e.g., '-bt') disables any temporal blocking.\n" " A block size of 1 in the step dimension enables temporal blocking, but only between\n" - " packs in the same step.\n" + " stages in the same step.\n" " A block size >1 in the step dimension enables temporal blocking across multiple steps.\n" " The temporal block size may be automatically reduced if needed based on the\n" " domain block sizes and the stencil halos.\n" @@ -527,7 +527,7 @@ namespace yask { " set to block size in the step dimension.\n" " A region size >1 in the step dimension enables wave-front rank tiling.\n" " The region size in the step dimension affects how often MPI halo-exchanges occur:\n" - " A region size of 0 in the step dimension => exchange after every pack.\n" + " A region size of 0 in the step dimension => exchange after every stage.\n" " A region size >0 in the step dimension => exchange after that many steps.\n" " Set local-domain sizes to specify the work done on this MPI rank.\n" " A local-domain size of 0 in a given domain dimension =>\n" @@ -922,7 +922,7 @@ namespace yask { yask_num_threads[0] = rt; if (bt > 1) { - omp_set_nested(1); // deprecated for OMP 5, but needed for Intel OMP. + omp_set_nested(1); omp_set_max_active_levels(2); int mal = omp_get_max_active_levels(); assert (mal == 2); diff --git a/src/kernel/lib/settings.hpp b/src/kernel/lib/settings.hpp index b77dce1e..0302eb11 100644 --- a/src/kernel/lib/settings.hpp +++ b/src/kernel/lib/settings.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -259,7 +259,7 @@ namespace yask { // Tuning. bool _do_auto_tune = false; // whether to do auto-tuning. bool _tune_mini_blks = false; // auto-tune mini-blks instead of blks. - bool _allow_pack_tuners = false; // allow per-pack tuners when possible. + bool _allow_stage_tuners = false; // allow per-stage tuners when possible. double _tuner_min_secs = 0.25; // min time to run tuner for new better setting. // Debug. @@ -585,7 +585,7 @@ namespace yask { // User settings. KernelSettingsPtr _opts; - bool _use_pack_tuners = false; + bool _use_stage_tuners = false; // Problem dims. DimsPtr _dims; @@ -677,7 +677,7 @@ namespace yask { const DimsPtr& get_dims() const { return _state->_dims; } MPIInfoPtr& get_mpi_info() { return _state->_mpiInfo; } const MPIInfoPtr& get_mpi_info() const { return _state->_mpiInfo; } - bool use_pack_tuners() const { return _state->_use_pack_tuners; } + bool use_stage_tuners() const { return _state->_use_stage_tuners; } yask_output_ptr get_debug_output() const { return _state->_env->get_debug_output(); } diff --git a/src/kernel/lib/setup.cpp b/src/kernel/lib/setup.cpp index 650c5c79..95cf68fb 100644 --- a/src/kernel/lib/setup.cpp +++ b/src/kernel/lib/setup.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -445,7 +445,7 @@ namespace yask { // If we haven't finished constructing the context, it's too early // to do this. - if (!stPacks.size()) + if (!stStages.size()) return; // Reset max halos to zero. @@ -500,9 +500,9 @@ namespace yask { num_wf_shifts = 0; if (wf_steps > 0) { - // Need to shift for each bundle pack. - assert(stPacks.size() > 0); - num_wf_shifts = idx_t(stPacks.size()) * wf_steps; + // Need to shift for each stage. + assert(stStages.size() > 0); + num_wf_shifts = idx_t(stStages.size()) * wf_steps; // Don't need to shift first one. if (num_wf_shifts > 0) @@ -511,7 +511,7 @@ namespace yask { assert(num_wf_shifts >= 0); // Determine whether separate tuners can be used. - state->_use_pack_tuners = opts->_allow_pack_tuners && (tb_steps == 0) && (stPacks.size() > 1); + state->_use_stage_tuners = opts->_allow_stage_tuners && (tb_steps == 0) && (stStages.size() > 1); // Calculate angles and related settings. for (auto& dim : domain_dims) { @@ -586,7 +586,7 @@ namespace yask { // size is changed. Must be called after update_var_info() to ensure // angles are properly set. TODO: calculate 'tb_steps' dynamically // considering temporal conditions; this assumes worst-case, which is - // all packs always done. + // all stages always done. void StencilContext::update_tb_info() { STATE_VARS(this); TRACE_MSG("update_tb_info()..."); @@ -605,7 +605,7 @@ namespace yask { // Determine max temporal depth based on block sizes // and requested temporal depth. // When using temporal blocking, all block sizes - // across all packs must be the same. + // across all stages must be the same. TRACE_MSG("update_tb_info: original TB steps = " << tb_steps); if (tb_steps > 0) { @@ -620,14 +620,14 @@ namespace yask { auto rnsize = opts->_region_sizes[i]; // There must be only one block size when using TB, so get - // sizes from context settings instead of packs. - assert(state->_use_pack_tuners == false); + // sizes from context settings instead of stages. + assert(state->_use_stage_tuners == false); auto blksize = opts->_block_sizes[i]; auto mblksize = opts->_mini_block_sizes[i]; // Req'd shift in this dim based on max halos. // Can't use separate L & R shift because of possible data reuse in vars. - // Can't use separate shifts for each pack for same reason. + // Can't use separate shifts for each stage for same reason. // TODO: make round-up optional. auto fpts = dims->_fold_pts[j]; idx_t angle = ROUND_UP(max_halos[j], fpts); @@ -650,18 +650,18 @@ namespace yask { // allowed this dim. if (tb_angle > 0) { - // min_blk_sz = min_top_sz + 2 * angle * (npacks * nsteps - 1). + // min_blk_sz = min_top_sz + 2 * angle * (nstages * nsteps - 1). // bs = ts + 2*a*np*ns - 2*a. // 2*a*np*ns = bs - ts + 2*a. // s = flr[ (bs - ts + 2*a) / 2*a*np ]. idx_t top_sz = fpts; // min pts on top row. TODO: is zero ok? - idx_t sh_pts = tb_angle * 2 * stPacks.size(); // pts shifted per step. + idx_t sh_pts = tb_angle * 2 * stStages.size(); // pts shifted per step. idx_t nsteps = (blksize - top_sz + tb_angle * 2) / sh_pts; // might be zero. TRACE_MSG("update_tb_info: max TB steps in dim '" << dname << "' = " << nsteps << " due to base block size of " << blksize << ", TB angle of " << tb_angle << - ", and " << stPacks.size() << " pack(s)"); + ", and " << stStages.size() << " stage(s)"); max_steps = min(max_steps, nsteps); } } @@ -673,9 +673,9 @@ namespace yask { // Calc number of shifts based on steps. if (tb_steps > 0) { - // Need to shift for each bundle pack. - assert(stPacks.size() > 0); - num_tb_shifts = idx_t(stPacks.size()) * tb_steps; + // Need to shift for each stage. + assert(stStages.size() > 0); + num_tb_shifts = idx_t(stStages.size()) * tb_steps; // Don't need to shift first one. if (num_tb_shifts > 0) @@ -786,13 +786,13 @@ namespace yask { // Remember sub-domain for each bundle. map bb_descrs; - // Find BB for each pack. - for (auto sp : stPacks) { + // Find BB for each stage. + for (auto sp : stStages) { auto& spbb = sp->getBB(); spbb.bb_begin = domain_dims; spbb.bb_end = domain_dims; - // Find BB for each bundle in this pack. + // Find BB for each bundle in this stage. for (auto sb : *sp) { // Already done? @@ -812,7 +812,7 @@ namespace yask { auto& sbbb = sb->getBB(); - // Expand pack BB to encompass bundle BB. + // Expand stage BB to encompass bundle BB. spbb.bb_begin = spbb.bb_begin.minElements(sbbb.bb_begin); spbb.bb_end = spbb.bb_end.maxElements(sbbb.bb_end); } diff --git a/src/kernel/lib/soln_apis.cpp b/src/kernel/lib/soln_apis.cpp index ff02e266..40fbecc8 100644 --- a/src/kernel/lib/soln_apis.cpp +++ b/src/kernel/lib/soln_apis.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -162,11 +162,11 @@ namespace yask { // This must be done after finding WF extensions. find_bounding_boxes(); - // Copy current settings to packs. Needed here because settings may + // Copy current settings to stages. Needed here because settings may // have been changed via APIs or from call to setupRank() since last // call to prepare_solution(). This will wipe out any previous // auto-tuning. - for (auto& sp : stPacks) + for (auto& sp : stStages) sp->getLocalSettings() = *opts; // Alloc vars, scratch vars, MPI bufs. @@ -285,15 +285,15 @@ namespace yask { " max-halos: " << max_halos.makeDimValStr()); print_temporal_tiling_info(); - // Info about eqs, packs and bundles. + // Info about eqs, stages and bundles. DEBUG_MSG("\n" - "Num stencil packs: " << stPacks.size() << endl << + "Num stages: " << stStages.size() << endl << "Num stencil bundles: " << stBundles.size() << endl << "Num stencil equations: " << NUM_STENCIL_EQS); - // Info on work in packs. + // Info on work in stages. DEBUG_MSG("\nBreakdown of work stats in this rank:"); - for (auto& sp : stPacks) + for (auto& sp : stStages) sp->init_work_stats(); } @@ -446,13 +446,13 @@ namespace yask { p->writes_ps = 0.; p->flops = 0.; - // Sum work done across packs using per-pack step counters. + // Sum work done across stages using per-stage step counters. double tptime = 0.; double optime = 0.; idx_t psteps = 0; - for (auto& sp : stPacks) { + for (auto& sp : stStages) { - // steps in this pack. + // steps in this stage. idx_t ns = sp->steps_done; auto& ps = sp->stats; @@ -468,14 +468,14 @@ namespace yask { p->nwrites += ps.nwrites; p->nfpops += ps.nfpops; - // Adjust pack time to make sure total time is <= compute time. + // Adjust stage time to make sure total time is <= compute time. double ptime = sp->timer.get_elapsed_secs(); ptime = min(ptime, ctime - tptime); tptime += ptime; ps.run_time = ptime; ps.halo_time = 0.; - // Pack rates. + // Stage rates. idx_t np = tot_domain_pts * ns; // Sum over steps. ps.reads_ps = 0.; ps.writes_ps = 0.; @@ -507,8 +507,8 @@ namespace yask { " num-est-FP-ops-per-step: " << makeNumStr(double(p->nfpops) / steps_done) << endl << " num-points-per-step: " << makeNumStr(tot_domain_pts)); if (psteps != steps_done) { - DEBUG_MSG(" Work breakdown by stencil pack(s):"); - for (auto& sp : stPacks) { + DEBUG_MSG(" Work breakdown by stage(s):"); + for (auto& sp : stStages) { idx_t ns = sp->steps_done; idx_t nreads = sp->tot_reads_per_step; idx_t nwrites = sp->tot_writes_per_step; @@ -530,8 +530,8 @@ namespace yask { " other time (sec): " << makeNumStr(otime) << print_pct(otime, rtime)); if (psteps != steps_done) { - DEBUG_MSG(" Compute-time breakdown by stencil pack(s):"); - for (auto& sp : stPacks) { + DEBUG_MSG(" Compute-time breakdown by stage(s):"); + for (auto& sp : stStages) { auto& ps = sp->stats; double ptime = ps.run_time; string pfx = " '" + sp->get_name() + "' "; @@ -565,8 +565,8 @@ namespace yask { " throughput (est-FLOPS): " << makeNumStr(p->flops) << endl << " throughput (num-points/sec): " << makeNumStr(p->pts_ps)); if (psteps != steps_done) { - DEBUG_MSG(" Rate breakdown by stencil pack(s):"); - for (auto& sp : stPacks) { + DEBUG_MSG(" Rate breakdown by stage(s):"); + for (auto& sp : stStages) { auto& ps = sp->stats; string pfx = " '" + sp->get_name() + "' "; DEBUG_MSG(pfx << "throughput (num-reads/sec): " << makeNumStr(ps.reads_ps) << endl << @@ -593,7 +593,7 @@ namespace yask { wait_time.clear(); test_time.clear(); steps_done = 0; - for (auto& sp : stPacks) { + for (auto& sp : stStages) { sp->timer.clear(); sp->steps_done = 0; } diff --git a/src/kernel/lib/stencil_calc.cpp b/src/kernel/lib/stencil_calc.cpp index ca311332..e6923d31 100644 --- a/src/kernel/lib/stencil_calc.cpp +++ b/src/kernel/lib/stencil_calc.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -23,7 +23,7 @@ IN THE SOFTWARE. *****************************************************************************/ -// This file contains implementations of bundle and pack methods. +// This file contains implementations of bundle and stage methods. // Also see context_setup.cpp. #include "yask_stencil.hpp" @@ -148,7 +148,7 @@ namespace yask { // If binding threads to sub-blocks and this is the // binding dim, set stride size and alignment // granularity to the slab width. Setting the - // alignment keeps slabs aligned between packs. + // alignment keeps slabs aligned between stages. if (bind_threads && i == bind_posn) { adj_mb_idxs.stride[i] = bind_slab_pts; adj_mb_idxs.align[i] = bind_slab_pts; @@ -757,18 +757,18 @@ namespace yask { } // adjust_span(). // Timer methods. - // Start and stop pack timers for final stats and auto-tuners. - void BundlePack::start_timers() { + // Start and stop stage timers for final stats and auto-tuners. + void Stage::start_timers() { auto ts = YaskTimer::get_timespec(); timer.start(&ts); getAT().timer.start(&ts); } - void BundlePack::stop_timers() { + void Stage::stop_timers() { auto ts = YaskTimer::get_timespec(); timer.stop(&ts); getAT().timer.stop(&ts); } - void BundlePack::add_steps(idx_t num_steps) { + void Stage::add_steps(idx_t num_steps) { steps_done += num_steps; getAT().steps_done += num_steps; } @@ -793,16 +793,16 @@ namespace yask { // Calc the work stats. // Contains MPI barriers! - void BundlePack::init_work_stats() { + void Stage::init_work_stats() { STATE_VARS(this); num_reads_per_step = 0; num_writes_per_step = 0; num_fpops_per_step = 0; - DEBUG_MSG("Pack '" << get_name() << "':\n" << + DEBUG_MSG("Stage '" << get_name() << "':\n" << " num bundles: " << size() << endl << - " pack scope: " << _pack_bb.make_range_string(domain_dims)); + " stage scope: " << _stage_bb.make_range_string(domain_dims)); // Bundles. for (auto* sg : *this) { @@ -859,10 +859,10 @@ namespace yask { } } } - DEBUG_MSG(" var-reads per point: " << reads1 << endl << - " var-reads in rank: " << makeNumStr(reads_bb) << endl << - " var-writes per point: " << writes1 << endl << - " var-writes in rank: " << makeNumStr(writes_bb) << endl << + DEBUG_MSG(" var-reads per point: " << reads1 << endl << + " var-reads in rank: " << makeNumStr(reads_bb) << endl << + " var-writes per point: " << writes1 << endl << + " var-writes in rank: " << makeNumStr(writes_bb) << endl << " est FP-ops per point: " << fpops1 << endl << " est FP-ops in rank: " << makeNumStr(fpops_bb)); diff --git a/src/kernel/lib/stencil_calc.hpp b/src/kernel/lib/stencil_calc.hpp index 07a026e1..e675dbe4 100644 --- a/src/kernel/lib/stencil_calc.hpp +++ b/src/kernel/lib/stencil_calc.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -28,8 +28,8 @@ IN THE SOFTWARE. namespace yask { // Classes that support evaluation of one stencil bundle - // and a 'pack' of bundles. - // A stencil context contains one or more packs. + // and a stage of bundles. + // A stencil context contains one or more stages. // A pure-virtual class base for a stencil bundle. class StencilBundleBase : @@ -272,26 +272,26 @@ namespace yask { // A collection of independent stencil bundles. // "Independent" implies that they may be evaluated // in any order. - class BundlePack : + class Stage : public ContextLinker, public std::vector { protected: std::string _name; - // Union of bounding boxes for all bundles in this pack. - BoundingBox _pack_bb; + // Union of bounding boxes for all bundles in this stage. + BoundingBox _stage_bb; - // Local pack settings. + // Local stage settings. // Only some of these will be used. - KernelSettings _pack_opts; + KernelSettings _stage_opts; - // Auto-tuner for pack settings. + // Auto-tuner for stage settings. AutoTuner _at; public: - // Perf stats for this pack. + // Perf stats for this stage. YaskTimer timer; idx_t steps_done = 0; Stats stats; @@ -306,13 +306,13 @@ namespace yask { idx_t tot_writes_per_step = 0; idx_t tot_fpops_per_step = 0; - BundlePack(StencilContext* context, + Stage(StencilContext* context, const std::string& name) : ContextLinker(context), _name(name), - _pack_opts(*context->get_state()->_opts), // init w/a copy of the base settings. - _at(context, &_pack_opts, name) { } - virtual ~BundlePack() { } + _stage_opts(*context->get_state()->_opts), // init w/a copy of the base settings. + _at(context, &_stage_opts, name) { } + virtual ~Stage() { } const std::string& get_name() { return _name; @@ -334,15 +334,15 @@ namespace yask { } // Accessors. - BoundingBox& getBB() { return _pack_bb; } + BoundingBox& getBB() { return _stage_bb; } AutoTuner& getAT() { return _at; } - KernelSettings& getLocalSettings() { return _pack_opts; } + KernelSettings& getLocalSettings() { return _stage_opts; } - // If using separate pack tuners, return local settings. + // If using separate stage tuners, return local settings. // Otherwise, return one in context. KernelSettings& getActiveSettings() { STATE_VARS(this); - return use_pack_tuners() ? _pack_opts : *opts; + return use_stage_tuners() ? _stage_opts : *opts; } // Perf-tracking methods. @@ -350,6 +350,6 @@ namespace yask { void stop_timers(); void add_steps(idx_t num_steps); - }; // BundlePack. + }; // Stage. } // yask namespace. diff --git a/src/kernel/lib/utils.cpp b/src/kernel/lib/utils.cpp index 716d6c94..c04b7c1a 100644 --- a/src/kernel/lib/utils.cpp +++ b/src/kernel/lib/utils.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/utils.hpp b/src/kernel/lib/utils.hpp index a2cc328a..e45d1fa1 100644 --- a/src/kernel/lib/utils.hpp +++ b/src/kernel/lib/utils.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/yask.hpp b/src/kernel/lib/yask.hpp index 0619fd9a..803b0161 100644 --- a/src/kernel/lib/yask.hpp +++ b/src/kernel/lib/yask.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/yask_stencil.hpp b/src/kernel/lib/yask_stencil.hpp index a345fe28..b2c6f7fa 100644 --- a/src/kernel/lib/yask_stencil.hpp +++ b/src/kernel/lib/yask_stencil.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/yk_var.cpp b/src/kernel/lib/yk_var.cpp index b3dbc947..57dee62d 100644 --- a/src/kernel/lib/yk_var.cpp +++ b/src/kernel/lib/yk_var.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/yk_var.hpp b/src/kernel/lib/yk_var.hpp index e37c4748..8806360f 100644 --- a/src/kernel/lib/yk_var.hpp +++ b/src/kernel/lib/yk_var.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/lib/yk_var_apis.cpp b/src/kernel/lib/yk_var_apis.cpp index 4c8590ba..14c47267 100644 --- a/src/kernel/lib/yk_var_apis.cpp +++ b/src/kernel/lib/yk_var_apis.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/swig/yask_kernel_api.i b/src/kernel/swig/yask_kernel_api.i index 7612c101..1031d6b4 100644 --- a/src/kernel/swig/yask_kernel_api.i +++ b/src/kernel/swig/yask_kernel_api.i @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/tests/var_test.cpp b/src/kernel/tests/var_test.cpp index 28d3cd0b..44a843bb 100644 --- a/src/kernel/tests/var_test.cpp +++ b/src/kernel/tests/var_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/tests/yask_kernel_api_exception_test.cpp b/src/kernel/tests/yask_kernel_api_exception_test.cpp index 60e310a2..a7e6cd7d 100644 --- a/src/kernel/tests/yask_kernel_api_exception_test.cpp +++ b/src/kernel/tests/yask_kernel_api_exception_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/tests/yask_kernel_api_exception_test.py b/src/kernel/tests/yask_kernel_api_exception_test.py index 520952a3..9339ade6 100755 --- a/src/kernel/tests/yask_kernel_api_exception_test.py +++ b/src/kernel/tests/yask_kernel_api_exception_test.py @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/tests/yask_kernel_api_test.cpp b/src/kernel/tests/yask_kernel_api_test.cpp index 238ec951..254c5723 100644 --- a/src/kernel/tests/yask_kernel_api_test.cpp +++ b/src/kernel/tests/yask_kernel_api_test.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/tests/yask_kernel_api_test.py b/src/kernel/tests/yask_kernel_api_test.py index 479275ea..11dd1897 100755 --- a/src/kernel/tests/yask_kernel_api_test.py +++ b/src/kernel/tests/yask_kernel_api_test.py @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/yask.sh b/src/kernel/yask.sh index 1043f9b0..5d450efe 100755 --- a/src/kernel/yask.sh +++ b/src/kernel/yask.sh @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/src/kernel/yask_main.cpp b/src/kernel/yask_main.cpp index fda56817..593410f8 100644 --- a/src/kernel/yask_main.cpp +++ b/src/kernel/yask_main.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -217,7 +217,7 @@ struct MySettings { " \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n" " \u2502 Y.A.S.K. \u2500\u2500 Yet Another Stencil Kit \u2502\n" " \u2502 https://github.com/intel/yask \u2502\n" - " \u2502 Copyright (c) 2014-2019, Intel Corporation \u2502\n" + " \u2502 Copyright (c) 2014-2020, Intel Corporation \u2502\n" " \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n" "\n" "Version: " << yask_get_version_string() << endl << diff --git a/src/stencils/AwpStencil.cpp b/src/stencils/AwpStencil.cpp index 8c0706ab..bd996651 100644 --- a/src/stencils/AwpStencil.cpp +++ b/src/stencils/AwpStencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/ElasticStencil/Elastic2Stencil.hpp b/src/stencils/ElasticStencil/Elastic2Stencil.hpp index e3004363..49dc23ef 100644 --- a/src/stencils/ElasticStencil/Elastic2Stencil.hpp +++ b/src/stencils/ElasticStencil/Elastic2Stencil.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/ElasticStencil/ElasticStencil.hpp b/src/stencils/ElasticStencil/ElasticStencil.hpp index eb58d204..8bee46ea 100644 --- a/src/stencils/ElasticStencil/ElasticStencil.hpp +++ b/src/stencils/ElasticStencil/ElasticStencil.hpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/FSGElastic2Stencil.cpp b/src/stencils/FSGElastic2Stencil.cpp index fbe2060d..d40e671e 100644 --- a/src/stencils/FSGElastic2Stencil.cpp +++ b/src/stencils/FSGElastic2Stencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/FSGElasticStencil.cpp b/src/stencils/FSGElasticStencil.cpp index 6a2caaeb..3db84db2 100644 --- a/src/stencils/FSGElasticStencil.cpp +++ b/src/stencils/FSGElasticStencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/Iso3dfdStencil.cpp b/src/stencils/Iso3dfdStencil.cpp index 6bfc1763..b50e6815 100644 --- a/src/stencils/Iso3dfdStencil.cpp +++ b/src/stencils/Iso3dfdStencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/SSGElastic2Stencil.cpp b/src/stencils/SSGElastic2Stencil.cpp index 9a7dd0a7..4b974547 100644 --- a/src/stencils/SSGElastic2Stencil.cpp +++ b/src/stencils/SSGElastic2Stencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/SSGElasticStencil.cpp b/src/stencils/SSGElasticStencil.cpp index 9f40b12b..e43b3102 100644 --- a/src/stencils/SSGElasticStencil.cpp +++ b/src/stencils/SSGElasticStencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/SimpleStencils.cpp b/src/stencils/SimpleStencils.cpp index b1b20edc..f67e1c50 100644 --- a/src/stencils/SimpleStencils.cpp +++ b/src/stencils/SimpleStencils.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/TTIStencil.cpp b/src/stencils/TTIStencil.cpp index 9fa11a84..736ce17f 100644 --- a/src/stencils/TTIStencil.cpp +++ b/src/stencils/TTIStencil.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff --git a/src/stencils/TestStencils.cpp b/src/stencils/TestStencils.cpp index 4d9f5aa1..9967c145 100644 --- a/src/stencils/TestStencils.cpp +++ b/src/stencils/TestStencils.cpp @@ -1,7 +1,7 @@ /***************************************************************************** YASK: Yet Another Stencil Kit -Copyright (c) 2014-2019, Intel Corporation +Copyright (c) 2014-2020, Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -444,7 +444,7 @@ namespace { static TestReverseStencil TestReverseStencil_instance; // Test dependent equations. - // These will create 2 stencil packs that will be applied in sequence + // These will create 2 stages that will be applied in sequence // for each time-step. class TestDepStencil1 : public TestBase { @@ -457,7 +457,7 @@ namespace { public: TestDepStencil1(int radius=2) : - TestBase("test_dep_1d", radius) { } + TestBase("test_stages_1d", radius) { } // Define equation to apply to all points in 'A' and 'B' vars. virtual void define() { @@ -486,7 +486,7 @@ namespace { public: TestDepStencil2(int radius=2) : - TestBase("test_dep_2d", radius) { } + TestBase("test_stages_2d", radius) { } // Define equation to apply to all points in 'A' and 'B' vars. virtual void define() { @@ -515,7 +515,7 @@ namespace { public: TestDepStencil3(int radius=2) : - TestBase("test_dep_3d", radius) { } + TestBase("test_stages_3d", radius) { } // Define equation to apply to all points in 'A' and 'B' vars. virtual void define() { diff --git a/utils/bin/analyze_trace.pl b/utils/bin/analyze_trace.pl index 6e5ce984..d6fbe051 100755 --- a/utils/bin/analyze_trace.pl +++ b/utils/bin/analyze_trace.pl @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/convert_v2_stencil.pl b/utils/bin/convert_v2_stencil.pl index 705ceb57..6548e4b4 100755 --- a/utils/bin/convert_v2_stencil.pl +++ b/utils/bin/convert_v2_stencil.pl @@ -3,7 +3,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/gen_layouts.pl b/utils/bin/gen_layouts.pl index 3be92cf0..d30bb9ea 100755 --- a/utils/bin/gen_layouts.pl +++ b/utils/bin/gen_layouts.pl @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/gen_loops.pl b/utils/bin/gen_loops.pl index fe10000f..c041a763 100755 --- a/utils/bin/gen_loops.pl +++ b/utils/bin/gen_loops.pl @@ -3,7 +3,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/view_asm.pl b/utils/bin/view_asm.pl index 98f7d5e5..881fea96 100755 --- a/utils/bin/view_asm.pl +++ b/utils/bin/view_asm.pl @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/yask_log_to_csv.pl b/utils/bin/yask_log_to_csv.pl index bd5922ba..e9766b89 100755 --- a/utils/bin/yask_log_to_csv.pl +++ b/utils/bin/yask_log_to_csv.pl @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/yask_tuner.pl b/utils/bin/yask_tuner.pl index 3b6bbc79..f9f26f73 100755 --- a/utils/bin/yask_tuner.pl +++ b/utils/bin/yask_tuner.pl @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/bin/yask_tuner_summary.csh b/utils/bin/yask_tuner_summary.csh index 86467dc7..54d9740c 100755 --- a/utils/bin/yask_tuner_summary.csh +++ b/utils/bin/yask_tuner_summary.csh @@ -2,7 +2,7 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/lib/CmdLine.pm b/utils/lib/CmdLine.pm index 2c739c10..d95f5da5 100644 --- a/utils/lib/CmdLine.pm +++ b/utils/lib/CmdLine.pm @@ -1,6 +1,6 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to diff --git a/utils/lib/YaskUtils.pm b/utils/lib/YaskUtils.pm index 7bbfb218..9d574c54 100644 --- a/utils/lib/YaskUtils.pm +++ b/utils/lib/YaskUtils.pm @@ -1,6 +1,6 @@ ############################################################################## ## YASK: Yet Another Stencil Kit -## Copyright (c) 2014-2019, Intel Corporation +## Copyright (c) 2014-2020, Intel Corporation ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to @@ -230,7 +230,7 @@ sub getResultsFromLine($$) { } # If auto-tuner is run globally, capture updated values. - # Invalidate settings overridden by auto-tuner on multiple packs. + # Invalidate settings overridden by auto-tuner on multiple stages. elsif ($line =~ /^auto-tuner(.).*size:/) { my $c = $1;