Module: BOAST
- Extended by:
- Functors, OpenCLHelper, TopLevelExpressions, TypeTransition, VarFunctors
- Defined in:
- lib/BOAST/Language/If.rb,
lib/BOAST/Language/For.rb,
lib/BOAST/Language/Case.rb,
lib/BOAST/Runtime/MAQAO.rb,
lib/BOAST/Runtime/Probe.rb,
lib/BOAST/Language/Error.rb,
lib/BOAST/Language/Index.rb,
lib/BOAST/Language/Print.rb,
lib/BOAST/Language/Slice.rb,
lib/BOAST/Language/State.rb,
lib/BOAST/Language/While.rb,
lib/BOAST/Runtime/Config.rb,
lib/BOAST/Language/Config.rb,
lib/BOAST/Language/OpenMP.rb,
lib/BOAST/Language/Parens.rb,
lib/BOAST/Language/Pragma.rb,
lib/BOAST/Runtime/CKernel.rb,
lib/BOAST/Language/Comment.rb,
lib/BOAST/Runtime/CRuntime.rb,
lib/BOAST/Language/FuncCall.rb,
lib/BOAST/Language/Functors.rb,
lib/BOAST/Language/Variable.rb,
lib/BOAST/Runtime/Compilers.rb,
lib/BOAST/Language/Algorithm.rb,
lib/BOAST/Language/CodeBlock.rb,
lib/BOAST/Language/DataTypes.rb,
lib/BOAST/Language/Operators.rb,
lib/BOAST/Language/Procedure.rb,
lib/BOAST/Runtime/FFIRuntime.rb,
lib/BOAST/Language/Annotation.rb,
lib/BOAST/Language/Arithmetic.rb,
lib/BOAST/Language/Expression.rb,
lib/BOAST/Language/Intrinsics.rb,
lib/BOAST/Runtime/CUDARuntime.rb,
lib/BOAST/Runtime/EnergyProbe.rb,
lib/BOAST/Runtime/MPPARuntime.rb,
lib/BOAST/Runtime/OpenCLTypes.rb,
lib/BOAST/Runtime/Temperature.rb,
lib/BOAST/Language/Inspectable.rb,
lib/BOAST/Language/Transitions.rb,
lib/BOAST/Language/BOAST_OpenCL.rb,
lib/BOAST/Runtime/AffinityProbe.rb,
lib/BOAST/Runtime/NonRegression.rb,
lib/BOAST/Runtime/OpenCLRuntime.rb,
lib/BOAST/Language/Architectures.rb,
lib/BOAST/Runtime/FORTRANRuntime.rb,
lib/BOAST/Runtime/CompiledRuntime.rb,
lib/BOAST/Language/ARMCPUID_by_name.rb,
lib/BOAST/Language/ControlStructure.rb,
lib/BOAST/Language/X86CPUID_by_name.rb,
lib/BOAST/Optimization/Optimization.rb,
lib/BOAST/Runtime/RubyEnergyMonitor.rb,
lib/BOAST/Language/HighLevelOperators.rb
Defined Under Namespace
Modules: AffinityProbe, Annotation, Arithmetic, CRuntime, CUDARuntime, CompiledRuntime, Compilers, EmlProbe, FFIRuntime, FORTRANRuntime, Functor, Functors, Inspectable, Intrinsics, MAQAO, MPPAProbe, MPPARuntime, OpenCLHelper, OpenCLRuntime, OpenMP, PAPIProbe, PowercapProbe, PrivateStateAccessor, RedfstProbe, Temperature, TimerProbe, TopLevelExpressions, TypeTransition, VarFunctor, VarFunctors Classes: Addition, Affectation, And, BasicBinaryOperator, BooleanParameter, BruteForceOptimizer, CKernel, CStruct, Case, CaseCondition, CodeBlock, Comment, ConstArray, ControlStructure, CustomType, DataType, Dereference, Different, Dimension, Division, Equal, Error, Exponentiation, Expression, FMA, FMS, For, FuncCall, GenericOptimization, GeneticOptimizer, Greater, GreaterOrEqual, HighLevelOperator, If, Index, Int, InternalIntrinsicsError, IntrinsicsError, LanguageError, Less, LessOrEqual, Load, Mask, MaskLoad, MaskStore, Max, Min, Minus, Modulo, Multiplication, Not, Operator, OperatorError, OptimizationParameter, OptimizationSpace, Optimizer, Or, Plus, Pragma, Procedure, Real, Reference, Set, Sizet, Slice, Sqrt, Store, Subtraction, Ternary, TrigonometricOperator, Variable, While
Constant Summary collapse
- LANGUAGES =
['FORTRAN', 'C', 'CL', 'CUDA']
- ARCHITECTURES =
['X86', 'ARM', 'MPPA']
- FUNCCALLS =
{}
- Var =
Variable
- Dim =
Dimension
- Call =
FuncCall
- MODELS =
{ "native" => native_flags }
- INSTRUCTIONS =
{}
- EnergyProbe =
nil
- OP =
OptimizationParameter
- BP =
BooleanParameter
- @@compiler_default_options =
{ :FC => 'gfortran', :FCFLAGS => '-O2 -Wall', :CC => 'gcc', :CFLAGS => '-O2 -Wall', :CXX => 'g++', :CXXFLAGS => '-O2 -Wall', :NVCC => 'nvcc', :NVCCFLAGS => '-O2', :LDFLAGS => '', :CLFLAGS => '', :CLVENDOR => nil, :CLPLATFORM => nil, :CLDEVICE => nil, :CLDEVICETYPE => nil, :MAQAO => 'maqao', :MAQAO_FLAGS => '', :MAQAO_PATH => '', :MAQAO_PASS => false, :MAQAO_SCRIPT => '', :OPENMP => false, :probes => nil }
- @@openmp_default_flags =
{ "gcc" => "-fopenmp", "icc" => "-openmp", "gfortran" => "-fopenmp", "ifort" => "-openmp", "g++" => "-fopenmp", "icpc" => "-openmp" }
- @@run_options =
[ :PAPI ]
- @@run_config =
{ }
- @@boast_config =
{ :fortran_line_length => 72 }
- @@architecture =
get_default_architecture
- @@output =
STDOUT
- @@chain_code =
false
- @@decl_module =
false
- @@annotate_numbers =
Hash::new { |h,k| h[k] = 0 }
- @@env =
Hash::new{|h, k| h[k] = []}
Class Method Summary collapse
-
.address_size ⇒ Object
The BOAST address_size state.
-
.address_size=(val) ⇒ Object
Sets address_size state to a new value.
-
.annotate ⇒ Object
The BOAST annotate state.
-
.annotate=(val) ⇒ Object
Sets annotate state to a new value.
-
.annotate? ⇒ Object
The boolean evaluation of the annotate state.
-
.annotate_indepth_list ⇒ Object
The BOAST annotate_indepth_list state.
-
.annotate_indepth_list=(val) ⇒ Object
Sets annotate_indepth_list state to a new value.
-
.annotate_level ⇒ Object
The BOAST annotate_level state.
-
.annotate_level=(val) ⇒ Object
Sets annotate_level state to a new value.
-
.annotate_list ⇒ Object
The BOAST annotate_list state.
-
.annotate_list=(val) ⇒ Object
Sets annotate_list state to a new value.
-
.annotate_number(name) ⇒ Object
Returns an annotation number for the given name.
-
.architecture ⇒ Object
The BOAST architecture state.
-
.architecture=(val) ⇒ Object
Sets architecture state to a new value.
-
.array_start ⇒ Object
The BOAST array_start state.
-
.array_start=(val) ⇒ Object
Sets array_start state to a new value.
- .assert_boast_config_dir ⇒ Object
-
.boast_inspect ⇒ Object
The BOAST boast_inspect state.
-
.boast_inspect=(val) ⇒ Object
Sets boast_inspect state to a new value.
-
.boast_inspect? ⇒ Object
The boolean evaluation of the boast_inspect state.
-
.boolean_state_accessor(state) ⇒ Object
Generates setters and getters for the specified boolean state.
-
.chain_code ⇒ Object
The BOAST chain_code state.
-
.chain_code=(val) ⇒ Object
Sets chain_code state to a new value.
-
.chain_code? ⇒ Object
The boolean evaluation of the chain_code state.
-
.close(a) ⇒ Object
One of BOAST keywords: closes a BOAST ControlStructure or Procedure.
-
.debug ⇒ Object
The BOAST debug state.
-
.debug=(val) ⇒ Object
Sets debug state to a new value.
-
.debug? ⇒ Object
The boolean evaluation of the debug state.
-
.debug_kernel_source ⇒ Object
The BOAST debug_kernel_source state.
-
.debug_kernel_source=(val) ⇒ Object
Sets debug_kernel_source state to a new value.
-
.debug_kernel_source? ⇒ Object
The boolean evaluation of the debug_kernel_source state.
-
.debug_source ⇒ Object
The BOAST debug_source state.
-
.debug_source=(val) ⇒ Object
Sets debug_source state to a new value.
-
.debug_source? ⇒ Object
The boolean evaluation of the debug_source state.
-
.decl(*list) ⇒ Object
One of BOAST keywords: declares BOAST Variables and Procedures.
-
.decl_module ⇒ Object
The BOAST decl_module state.
-
.decl_module=(val) ⇒ Object
Sets decl_module state to a new value.
-
.decl_module? ⇒ Object
The boolean evaluation of the decl_module state.
-
.decrement_indent_level(increment = get_indent_increment) ⇒ Object
Decrements the indent level.
-
.default_align ⇒ Object
The BOAST default_align state.
-
.default_align=(val) ⇒ Object
Sets default_align state to a new value.
-
.default_int_signed ⇒ Object
The BOAST default_int_signed state.
-
.default_int_signed=(val) ⇒ Object
Sets default_int_signed state to a new value.
-
.default_int_signed? ⇒ Object
The boolean evaluation of the default_int_signed state.
-
.default_int_size ⇒ Object
The BOAST default_int_size state.
-
.default_int_size=(val) ⇒ Object
Sets default_int_size state to a new value.
-
.default_real_size ⇒ Object
The BOAST default_real_size state.
-
.default_real_size=(val) ⇒ Object
Sets default_real_size state to a new value.
-
.default_state_getter(state, default, get_env_string = nil, env = state.upcase) ⇒ Object
Generates an initializer for the specified state using default value or environment variable.
-
.default_type ⇒ Object
The BOAST default_type state.
-
.default_type=(val) ⇒ Object
Sets default_type state to a new value.
-
.disable_openmp ⇒ Object
The BOAST disable_openmp state.
-
.disable_openmp=(val) ⇒ Object
Sets disable_openmp state to a new value.
-
.disable_openmp? ⇒ Object
The boolean evaluation of the disable_openmp state.
-
.executable ⇒ Object
The BOAST executable state.
-
.executable=(val) ⇒ Object
Sets executable state to a new value.
-
.executable? ⇒ Object
The boolean evaluation of the executable state.
-
.ffi ⇒ Object
The BOAST ffi state.
-
.ffi=(val) ⇒ Object
Sets ffi state to a new value.
-
.ffi? ⇒ Object
The boolean evaluation of the ffi state.
-
.fortran_line_length ⇒ Object
The BOAST fortran_line_length state.
-
.fortran_line_length=(val) ⇒ Object
Sets fortran_line_length state to a new value.
- .generic_trigonometric_operator_generator(name) ⇒ Object
-
.get_address_size ⇒ Object
The address_size state.
-
.get_annotate ⇒ Object
The annotate state.
-
.get_annotate_indepth_list ⇒ Object
The annotate_indepth_list state.
-
.get_annotate_level ⇒ Object
The annotate_level state.
-
.get_annotate_list ⇒ Object
The annotate_list state.
-
.get_architecture ⇒ Object
The architecture state.
-
.get_architecture_name ⇒ Object
Returns the symbol corresponding to the active architecture.
-
.get_array_start ⇒ Object
The array_start state.
-
.get_boast_inspect ⇒ Object
The boast_inspect state.
-
.get_chain_code ⇒ Object
The chain_code state.
- .get_compiler_options ⇒ Object
-
.get_debug ⇒ Object
The debug state.
-
.get_debug_kernel_source ⇒ Object
The debug_kernel_source state.
-
.get_debug_source ⇒ Object
The debug_source state.
-
.get_decl_module ⇒ Object
The decl_module state.
- .get_default_address_size ⇒ Object
-
.get_default_align ⇒ Object
The default_align state.
- .get_default_annotate ⇒ Object
- .get_default_annotate_indepth_list ⇒ Object
- .get_default_annotate_level ⇒ Object
- .get_default_annotate_list ⇒ Object
- .get_default_architecture ⇒ Object
- .get_default_array_start ⇒ Object
- .get_default_boast_inspect ⇒ Object
- .get_default_debug ⇒ Object
- .get_default_debug_kernel_source ⇒ Object
- .get_default_debug_source ⇒ Object
- .get_default_default_align ⇒ Object
- .get_default_default_int_signed ⇒ Object
- .get_default_default_int_size ⇒ Object
- .get_default_default_real_size ⇒ Object
- .get_default_default_type ⇒ Object
- .get_default_disable_openmp ⇒ Object
- .get_default_executable ⇒ Object
- .get_default_ffi ⇒ Object
- .get_default_fortran_line_length ⇒ Object
- .get_default_indent_increment ⇒ Object
- .get_default_indent_level ⇒ Object
-
.get_default_int_signed ⇒ Object
The default_int_signed state.
-
.get_default_int_size ⇒ Object
The default_int_size state.
- .get_default_keep_temp ⇒ Object
- .get_default_lang ⇒ Object
- .get_default_model ⇒ Object
- .get_default_optimizer_log ⇒ Object
- .get_default_optimizer_log_file ⇒ Object
-
.get_default_real_size ⇒ Object
The default_real_size state.
- .get_default_replace_constants ⇒ Object
-
.get_default_type ⇒ Object
The default_type state.
- .get_default_use_vla ⇒ Object
- .get_default_verbose ⇒ Object
-
.get_disable_openmp ⇒ Object
The disable_openmp state.
-
.get_executable ⇒ Object
The executable state.
-
.get_ffi ⇒ Object
The ffi state.
-
.get_fortran_line_length ⇒ Object
The fortran_line_length state.
-
.get_indent_increment ⇒ Object
The indent_increment state.
-
.get_indent_level ⇒ Object
The indent_level state.
-
.get_keep_temp ⇒ Object
The keep_temp state.
-
.get_lang ⇒ Object
The lang state.
-
.get_lang_name ⇒ Object
Returns the symbol corresponding to the active language.
-
.get_model ⇒ Object
The model state.
- .get_openmp_flags ⇒ Object
-
.get_optimizer_log ⇒ Object
The optimizer_log state.
-
.get_optimizer_log_file ⇒ Object
The optimizer_log_file state.
-
.get_output ⇒ Object
The output state.
-
.get_replace_constants ⇒ Object
The replace_constants state.
- .get_run_config ⇒ Object
-
.get_use_vla ⇒ Object
The use_vla state.
-
.get_verbose ⇒ Object
The verbose state.
- .included(base) ⇒ Object
-
.increment_indent_level(increment = get_indent_increment) ⇒ Object
Increments the indent level.
-
.indent ⇒ Object
Returns a string with as many space as the indent level.
-
.indent_increment ⇒ Object
The BOAST indent_increment state.
-
.indent_increment=(val) ⇒ Object
Sets indent_increment state to a new value.
-
.indent_level ⇒ Object
The BOAST indent_level state.
-
.indent_level=(val) ⇒ Object
Sets indent_level state to a new value.
-
.keep_temp ⇒ Object
The BOAST keep_temp state.
-
.keep_temp=(val) ⇒ Object
Sets keep_temp state to a new value.
-
.keep_temp? ⇒ Object
The boolean evaluation of the keep_temp state.
-
.lang ⇒ Object
The BOAST lang state.
-
.lang=(val) ⇒ Object
Sets lang state to a new value.
-
.model ⇒ Object
The BOAST model state.
-
.model=(val) ⇒ Object
Sets model state to a new value.
-
.model_old= ⇒ Object
Sets model state to a new value.
- .open(a) ⇒ Object deprecated Deprecated.
-
.opn(a) ⇒ Object
One of BOAST keywords: opens a BOAST ControlStructure or Procedure.
-
.optimizer_log ⇒ Object
The BOAST optimizer_log state.
-
.optimizer_log=(val) ⇒ Object
Sets optimizer_log state to a new value.
-
.optimizer_log? ⇒ Object
The boolean evaluation of the optimizer_log state.
-
.optimizer_log_file ⇒ Object
The BOAST optimizer_log_file state.
-
.optimizer_log_file=(val) ⇒ Object
Sets optimizer_log_file state to a new value.
-
.output ⇒ Object
The BOAST output state.
-
.output=(val) ⇒ Object
Sets output state to a new value.
-
.pop_env(*vars) ⇒ Object
Pops the specified states values.
-
.pr(a, *args, &block) ⇒ Object
One of BOAST keywords: prints BOAST objects.
-
.pr_annotate(a) ⇒ Object
Annotates an Object by inlining a YAML structure in a comment.
- .print(a, *args) ⇒ Object deprecated Deprecated.
-
.push_env(vars) { ... } ⇒ Object
Updates states and stores their value in a stack for later retrieval.
- .read_boast_compiler_config ⇒ Object
- .read_boast_config ⇒ Object
- .read_boast_run_config ⇒ Object
- .register_funccall(name, options = {}) ⇒ Object
-
.replace_constants ⇒ Object
The BOAST replace_constants state.
-
.replace_constants=(val) ⇒ Object
Sets replace_constants state to a new value.
-
.replace_constants? ⇒ Object
The boolean evaluation of the replace_constants state.
-
.reset_annotate_numbers ⇒ Object
Resets the annotate_numbers to an empty Hash.
-
.set_address_size(val) ⇒ Object
Sets address_size state to a new value.
-
.set_annotate(val) ⇒ Object
Sets annotate state to a new value.
-
.set_annotate_indepth_list(val) ⇒ Object
Sets annotate_indepth_list state to a new value.
-
.set_annotate_level(val) ⇒ Object
Sets annotate_level state to a new value.
-
.set_annotate_list(val) ⇒ Object
Sets annotate_list state to a new value.
-
.set_architecture(val) ⇒ Object
Sets architecture state to a new value.
-
.set_array_start(val) ⇒ Object
Sets array_start state to a new value.
-
.set_boast_inspect(val) ⇒ Object
Sets boast_inspect state to a new value.
-
.set_chain_code(val) ⇒ Object
Sets chain_code state to a new value.
-
.set_debug(val) ⇒ Object
Sets debug state to a new value.
-
.set_debug_kernel_source(val) ⇒ Object
Sets debug_kernel_source state to a new value.
-
.set_debug_source(val) ⇒ Object
Sets debug_source state to a new value.
-
.set_decl_module(val) ⇒ Object
Sets decl_module state to a new value.
-
.set_default_align(val) ⇒ Object
Sets default_align state to a new value.
-
.set_default_int_signed(val) ⇒ Object
Sets default_int_signed state to a new value.
-
.set_default_int_size(val) ⇒ Object
Sets default_int_size state to a new value.
-
.set_default_real_size(val) ⇒ Object
Sets default_real_size state to a new value.
-
.set_default_type(val) ⇒ Object
Sets default_type state to a new value.
-
.set_disable_openmp(val) ⇒ Object
Sets disable_openmp state to a new value.
-
.set_executable(val) ⇒ Object
Sets executable state to a new value.
-
.set_ffi(val) ⇒ Object
Sets ffi state to a new value.
-
.set_fortran_line_length(val) ⇒ Object
Sets fortran_line_length state to a new value.
-
.set_indent_increment(val) ⇒ Object
Sets indent_increment state to a new value.
-
.set_indent_level(val) ⇒ Object
Sets indent_level state to a new value.
-
.set_keep_temp(val) ⇒ Object
Sets keep_temp state to a new value.
-
.set_lang(val) ⇒ Object
Sets lang state to a new value.
-
.set_model(val) ⇒ Object
Sets model state to a new value.
-
.set_model_old ⇒ Object
Sets model state to a new value.
-
.set_optimizer_log(val) ⇒ Object
Sets optimizer_log state to a new value.
-
.set_optimizer_log_file(val) ⇒ Object
Sets optimizer_log_file state to a new value.
-
.set_output(val) ⇒ Object
Sets output state to a new value.
-
.set_replace_constants(val) ⇒ Object
Sets replace_constants state to a new value.
-
.set_use_vla(val) ⇒ Object
Sets use_vla state to a new value.
-
.set_verbose(val) ⇒ Object
Sets verbose state to a new value.
-
.state_accessor(state) ⇒ Object
Generates setters and getters for the specified state.
-
.use_vla ⇒ Object
The BOAST use_vla state.
-
.use_vla=(val) ⇒ Object
Sets use_vla state to a new value.
-
.use_vla? ⇒ Boolean
The boolean evaluation of the use_vla state.
-
.use_vla_old? ⇒ Object
The boolean evaluation of the use_vla state.
-
.verbose ⇒ Object
The BOAST verbose state.
-
.verbose=(val) ⇒ Object
Sets verbose state to a new value.
-
.verbose? ⇒ Object
The boolean evaluation of the verbose state.
Methods included from Functors
Affectation, CodeBlock, Dimension, Expression, FMA, FMS, Load, MaskLoad, MaskStore, Procedure, Set, Store, Ternary, Variable, functorize
Methods included from VarFunctors
CStruct, CustomType, Int, Real, Sizet, var_functorize
Methods included from TypeTransition
get_transition, set_transition, transition
Methods included from TopLevelExpressions
Methods included from OpenCLHelper
barrier, get_global_id, get_global_size, get_group_id, get_local_id, get_local_size, get_num_groups, get_work_dim
Class Method Details
.address_size ⇒ Object
Returns the BOAST address_size state.
86 |
# File 'lib/BOAST/Language/Config.rb', line 86 state_accessor :address_size |
.address_size=(val) ⇒ Object
Sets address_size state to a new value
86 |
# File 'lib/BOAST/Language/Config.rb', line 86 state_accessor :address_size |
.annotate ⇒ Object
Returns the BOAST annotate state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor annotate |
.annotate=(val) ⇒ Object
Sets annotate state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor annotate |
.annotate? ⇒ Object
Returns the boolean evaluation of the annotate state.
105 |
# File 'lib/BOAST/Language/Config.rb', line 105 boolean_state_accessor :annotate |
.annotate_indepth_list ⇒ Object
Returns the BOAST annotate_indepth_list state.
95 |
# File 'lib/BOAST/Language/Config.rb', line 95 state_accessor :annotate_indepth_list |
.annotate_indepth_list=(val) ⇒ Object
Sets annotate_indepth_list state to a new value
95 |
# File 'lib/BOAST/Language/Config.rb', line 95 state_accessor :annotate_indepth_list |
.annotate_level ⇒ Object
Returns the BOAST annotate_level state.
96 |
# File 'lib/BOAST/Language/Config.rb', line 96 state_accessor :annotate_level |
.annotate_level=(val) ⇒ Object
Sets annotate_level state to a new value
96 |
# File 'lib/BOAST/Language/Config.rb', line 96 state_accessor :annotate_level |
.annotate_list ⇒ Object
Returns the BOAST annotate_list state.
94 |
# File 'lib/BOAST/Language/Config.rb', line 94 state_accessor :annotate_list |
.annotate_list=(val) ⇒ Object
Sets annotate_list state to a new value
94 |
# File 'lib/BOAST/Language/Config.rb', line 94 state_accessor :annotate_list |
.annotate_number(name) ⇒ Object
Returns an annotation number for the given name. The number is incremented for a given name is incremented each time this name is called
134 135 136 137 138 |
# File 'lib/BOAST/Language/Algorithm.rb', line 134 def annotate_number(name) num = @@annotate_numbers[name] @@annotate_numbers[name] = num + 1 return num end |
.architecture ⇒ Object
Returns the BOAST architecture state.
84 |
# File 'lib/BOAST/Language/Config.rb', line 84 state_accessor :architecture |
.architecture=(val) ⇒ Object
Sets architecture state to a new value
84 |
# File 'lib/BOAST/Language/Config.rb', line 84 state_accessor :architecture |
.array_start ⇒ Object
Returns the BOAST array_start state.
91 |
# File 'lib/BOAST/Language/Config.rb', line 91 state_accessor :array_start |
.array_start=(val) ⇒ Object
Sets array_start state to a new value
91 |
# File 'lib/BOAST/Language/Config.rb', line 91 state_accessor :array_start |
.assert_boast_config_dir ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/BOAST/Language/Config.rb', line 23 def assert_boast_config_dir home_config_dir = ENV["XDG_CONFIG_HOME"] home_config_dir = "#{Dir.home}/.config" if not home_config_dir Dir.mkdir( home_config_dir ) if not File::exist?( home_config_dir ) return nil if not File::directory?(home_config_dir) boast_config_dir = "#{home_config_dir}/BOAST" Dir.mkdir( boast_config_dir ) if not File::exist?( boast_config_dir ) return nil if not File::directory?(boast_config_dir) return boast_config_dir end |
.boast_inspect ⇒ Object
Returns the BOAST boast_inspect state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor boast_inspect |
.boast_inspect=(val) ⇒ Object
Sets boast_inspect state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor boast_inspect |
.boast_inspect? ⇒ Object
Returns the boolean evaluation of the boast_inspect state.
108 |
# File 'lib/BOAST/Language/Config.rb', line 108 boolean_state_accessor :boast_inspect |
.boolean_state_accessor(state) ⇒ Object
Generates setters and getters for the specified boolean state
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/BOAST/Language/State.rb', line 61 def self.boolean_state_accessor(state) state_accessor(state) s = <<EOF module_function def #{state}? !!@@#{state} end EOF eval s end |
.chain_code ⇒ Object
Returns the BOAST chain_code state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor chain_code |
.chain_code=(val) ⇒ Object
Sets chain_code state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor chain_code |
.chain_code? ⇒ Object
Returns the boolean evaluation of the chain_code state.
101 |
# File 'lib/BOAST/Language/Config.rb', line 101 boolean_state_accessor :chain_code |
.close(a) ⇒ Object
One of BOAST keywords: closes a BOAST ControlStructure or Procedure. Calls the close method of the given object.
191 192 193 |
# File 'lib/BOAST/Language/Algorithm.rb', line 191 def close(a) a.close end |
.debug ⇒ Object
Returns the BOAST debug state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor debug |
.debug=(val) ⇒ Object
Sets debug state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor debug |
.debug? ⇒ Object
Returns the boolean evaluation of the debug state.
102 |
# File 'lib/BOAST/Language/Config.rb', line 102 boolean_state_accessor :debug |
.debug_kernel_source ⇒ Object
Returns the BOAST debug_kernel_source state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_kernel_source |
.debug_kernel_source=(val) ⇒ Object
Sets debug_kernel_source state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_kernel_source |
.debug_kernel_source? ⇒ Object
Returns the boolean evaluation of the debug_kernel_source state.
57 |
# File 'lib/BOAST/Runtime/Config.rb', line 57 boolean_state_accessor :debug_kernel_source |
.debug_source ⇒ Object
Returns the BOAST debug_source state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_source |
.debug_source=(val) ⇒ Object
Sets debug_source state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_source |
.debug_source? ⇒ Object
Returns the boolean evaluation of the debug_source state.
56 |
# File 'lib/BOAST/Runtime/Config.rb', line 56 boolean_state_accessor :debug_source |
.decl(*list) ⇒ Object
One of BOAST keywords: declares BOAST Variables and Procedures. Calls the decl method of each given objects.
175 176 177 178 179 |
# File 'lib/BOAST/Language/Algorithm.rb', line 175 def decl(*list) list.each { |d| d.decl } end |
.decl_module ⇒ Object
Returns the BOAST decl_module state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor decl_module |
.decl_module=(val) ⇒ Object
Sets decl_module state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor decl_module |
.decl_module? ⇒ Object
Returns the boolean evaluation of the decl_module state.
104 |
# File 'lib/BOAST/Language/Config.rb', line 104 boolean_state_accessor :decl_module |
.decrement_indent_level(increment = get_indent_increment) ⇒ Object
Decrements the indent level
123 124 125 |
# File 'lib/BOAST/Language/Algorithm.rb', line 123 def decrement_indent_level(increment = get_indent_increment) set_indent_level( get_indent_level - increment ) end |
.default_align ⇒ Object
Returns the BOAST default_align state.
90 |
# File 'lib/BOAST/Language/Config.rb', line 90 state_accessor :default_align |
.default_align=(val) ⇒ Object
Sets default_align state to a new value
90 |
# File 'lib/BOAST/Language/Config.rb', line 90 state_accessor :default_align |
.default_int_signed ⇒ Object
Returns the BOAST default_int_signed state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor default_int_signed |
.default_int_signed=(val) ⇒ Object
Sets default_int_signed state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor default_int_signed |
.default_int_signed? ⇒ Object
Returns the boolean evaluation of the default_int_signed state.
100 |
# File 'lib/BOAST/Language/Config.rb', line 100 boolean_state_accessor :default_int_signed |
.default_int_size ⇒ Object
Returns the BOAST default_int_size state.
88 |
# File 'lib/BOAST/Language/Config.rb', line 88 state_accessor :default_int_size |
.default_int_size=(val) ⇒ Object
Sets default_int_size state to a new value
88 |
# File 'lib/BOAST/Language/Config.rb', line 88 state_accessor :default_int_size |
.default_real_size ⇒ Object
Returns the BOAST default_real_size state.
89 |
# File 'lib/BOAST/Language/Config.rb', line 89 state_accessor :default_real_size |
.default_real_size=(val) ⇒ Object
Sets default_real_size state to a new value
89 |
# File 'lib/BOAST/Language/Config.rb', line 89 state_accessor :default_real_size |
.default_state_getter(state, default, get_env_string = nil, env = state.upcase) ⇒ Object
Generates an initializer for the specified state using default value or environment variable. Calls this initializer.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/BOAST/Language/State.rb', line 83 def self.default_state_getter(state, default, get_env_string=nil, env = state.upcase) envs = "ENV['#{env}']" s = <<EOF module_function def get_default_#{state} #{state} = @@boast_config[#{state.inspect}] #{state} = #{default.inspect} unless #{state} #{state} = #{get_env_string ? eval( "#{get_env_string}" ) : "YAML::load(#{envs})" } if #{envs} return #{state} end @@#{state} = get_default_#{state} EOF eval s end |
.default_type ⇒ Object
Returns the BOAST default_type state.
87 |
# File 'lib/BOAST/Language/Config.rb', line 87 state_accessor :default_type |
.default_type=(val) ⇒ Object
Sets default_type state to a new value
87 |
# File 'lib/BOAST/Language/Config.rb', line 87 state_accessor :default_type |
.disable_openmp ⇒ Object
Returns the BOAST disable_openmp state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor disable_openmp |
.disable_openmp=(val) ⇒ Object
Sets disable_openmp state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor disable_openmp |
.disable_openmp? ⇒ Object
Returns the boolean evaluation of the disable_openmp state.
107 |
# File 'lib/BOAST/Language/Config.rb', line 107 boolean_state_accessor :disable_openmp |
.executable ⇒ Object
Returns the BOAST executable state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor executable |
.executable=(val) ⇒ Object
Sets executable state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor executable |
.executable? ⇒ Object
Returns the boolean evaluation of the executable state.
59 |
# File 'lib/BOAST/Runtime/Config.rb', line 59 boolean_state_accessor :executable |
.ffi ⇒ Object
Returns the BOAST ffi state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor ffi |
.ffi=(val) ⇒ Object
Sets ffi state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor ffi |
.ffi? ⇒ Object
Returns the boolean evaluation of the ffi state.
58 |
# File 'lib/BOAST/Runtime/Config.rb', line 58 boolean_state_accessor :ffi |
.fortran_line_length ⇒ Object
Returns the BOAST fortran_line_length state.
61 |
# File 'lib/BOAST/Runtime/Config.rb', line 61 state_accessor :fortran_line_length |
.fortran_line_length=(val) ⇒ Object
Sets fortran_line_length state to a new value
61 |
# File 'lib/BOAST/Runtime/Config.rb', line 61 state_accessor :fortran_line_length |
.generic_trigonometric_operator_generator(name) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/BOAST/Language/HighLevelOperators.rb', line 138 def self.generic_trigonometric_operator_generator( name ) eval <<EOF class #{name.capitalize} < TrigonometricOperator extend Functor def get_intrinsic_symbol return :#{name.upcase} end def get_name return { C => "#{name}", CUDA => "#{name}", CL => "#{name}", FORTRAN => "#{name}" } end end EOF end |
.get_address_size ⇒ Object
Returns the address_size state.
86 |
# File 'lib/BOAST/Language/Config.rb', line 86 state_accessor :address_size |
.get_annotate ⇒ Object
Returns the annotate state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor annotate |
.get_annotate_indepth_list ⇒ Object
Returns the annotate_indepth_list state.
95 |
# File 'lib/BOAST/Language/Config.rb', line 95 state_accessor :annotate_indepth_list |
.get_annotate_level ⇒ Object
Returns the annotate_level state.
96 |
# File 'lib/BOAST/Language/Config.rb', line 96 state_accessor :annotate_level |
.get_annotate_list ⇒ Object
Returns the annotate_list state.
94 |
# File 'lib/BOAST/Language/Config.rb', line 94 state_accessor :annotate_list |
.get_architecture ⇒ Object
Returns the architecture state.
84 |
# File 'lib/BOAST/Language/Config.rb', line 84 state_accessor :architecture |
.get_architecture_name ⇒ Object
Returns the symbol corresponding to the active architecture
60 61 62 |
# File 'lib/BOAST/Language/Algorithm.rb', line 60 def get_architecture_name return ARCHITECTURES[architecture] end |
.get_array_start ⇒ Object
Returns the array_start state.
91 |
# File 'lib/BOAST/Language/Config.rb', line 91 state_accessor :array_start |
.get_boast_inspect ⇒ Object
Returns the boast_inspect state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor boast_inspect |
.get_chain_code ⇒ Object
Returns the chain_code state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor chain_code |
.get_compiler_options ⇒ Object
107 108 109 |
# File 'lib/BOAST/Runtime/Config.rb', line 107 def return @@compiler_default_options.clone end |
.get_debug ⇒ Object
Returns the debug state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor debug |
.get_debug_kernel_source ⇒ Object
Returns the debug_kernel_source state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_kernel_source |
.get_debug_source ⇒ Object
Returns the debug_source state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_source |
.get_decl_module ⇒ Object
Returns the decl_module state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor decl_module |
.get_default_address_size ⇒ Object
111 |
# File 'lib/BOAST/Language/Config.rb', line 111 default_state_getter :address_size, OS.bits/8 |
.get_default_align ⇒ Object
Returns the default_align state.
90 |
# File 'lib/BOAST/Language/Config.rb', line 90 state_accessor :default_align |
.get_default_annotate ⇒ Object
124 |
# File 'lib/BOAST/Language/Config.rb', line 124 default_state_getter :annotate, false |
.get_default_annotate_indepth_list ⇒ Object
126 |
# File 'lib/BOAST/Language/Config.rb', line 126 default_state_getter :annotate_indepth_list, ["For"], '"#{envs}.split(\",\").collect { |arg| YAML::load(arg) }"' |
.get_default_annotate_level ⇒ Object
127 |
# File 'lib/BOAST/Language/Config.rb', line 127 default_state_getter :annotate_level, 0 |
.get_default_annotate_list ⇒ Object
125 |
# File 'lib/BOAST/Language/Config.rb', line 125 default_state_getter :annotate_list, ["For"], '"#{envs}.split(\",\").collect { |arg| YAML::load(arg) }"' |
.get_default_architecture ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/BOAST/Language/Config.rb', line 162 def get_default_architecture architecture = nil begin env = nil if ENV["ARCHITECTURE"] then env = ENV["ARCHITECTURE"] elsif ENV["ARCH"] then env = ENV["ARCH"] end raise "Error" if env and not ARCHITECTURES.include?(env) architecture = const_get(env) if env rescue raise "'#{env}' is not a valid value for ARCH or ARCHITECTURE!" end return architecture if architecture return ARM if YAML::load( OS.report )["host_cpu"].match(/arm|aarch64/) return X86 end |
.get_default_array_start ⇒ Object
123 |
# File 'lib/BOAST/Language/Config.rb', line 123 default_state_getter :array_start, 1 |
.get_default_boast_inspect ⇒ Object
131 |
# File 'lib/BOAST/Language/Config.rb', line 131 default_state_getter :boast_inspect, false, nil, :INSPECT |
.get_default_debug ⇒ Object
114 |
# File 'lib/BOAST/Language/Config.rb', line 114 default_state_getter :debug, false |
.get_default_debug_kernel_source ⇒ Object
64 |
# File 'lib/BOAST/Runtime/Config.rb', line 64 default_state_getter :debug_kernel_source, false |
.get_default_debug_source ⇒ Object
63 |
# File 'lib/BOAST/Runtime/Config.rb', line 63 default_state_getter :debug_source, false |
.get_default_default_align ⇒ Object
120 |
# File 'lib/BOAST/Language/Config.rb', line 120 default_state_getter :default_align, 1 |
.get_default_default_int_signed ⇒ Object
117 |
# File 'lib/BOAST/Language/Config.rb', line 117 default_state_getter :default_int_signed, true |
.get_default_default_int_size ⇒ Object
118 |
# File 'lib/BOAST/Language/Config.rb', line 118 default_state_getter :default_int_size, 4 |
.get_default_default_real_size ⇒ Object
119 |
# File 'lib/BOAST/Language/Config.rb', line 119 default_state_getter :default_real_size, 8 |
.get_default_default_type ⇒ Object
266 |
# File 'lib/BOAST/Language/DataTypes.rb', line 266 default_state_getter :default_type, Int, '"const_get(#{envs})"' |
.get_default_disable_openmp ⇒ Object
130 |
# File 'lib/BOAST/Language/Config.rb', line 130 default_state_getter :disable_openmp, false |
.get_default_executable ⇒ Object
66 |
# File 'lib/BOAST/Runtime/Config.rb', line 66 default_state_getter :executable, false |
.get_default_ffi ⇒ Object
65 |
# File 'lib/BOAST/Runtime/Config.rb', line 65 default_state_getter :ffi, false |
.get_default_fortran_line_length ⇒ Object
68 |
# File 'lib/BOAST/Runtime/Config.rb', line 68 default_state_getter :fortran_line_length, 72 |
.get_default_indent_increment ⇒ Object
122 |
# File 'lib/BOAST/Language/Config.rb', line 122 default_state_getter :indent_increment, 2 |
.get_default_indent_level ⇒ Object
121 |
# File 'lib/BOAST/Language/Config.rb', line 121 default_state_getter :indent_level, 0 |
.get_default_int_signed ⇒ Object
Returns the default_int_signed state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor default_int_signed |
.get_default_int_size ⇒ Object
Returns the default_int_size state.
88 |
# File 'lib/BOAST/Language/Config.rb', line 88 state_accessor :default_int_size |
.get_default_keep_temp ⇒ Object
67 |
# File 'lib/BOAST/Runtime/Config.rb', line 67 default_state_getter :keep_temp, false |
.get_default_lang ⇒ Object
112 |
# File 'lib/BOAST/Language/Config.rb', line 112 default_state_getter :lang, FORTRAN, '"const_get(#{envs})"', :BOAST_LANG |
.get_default_model ⇒ Object
113 |
# File 'lib/BOAST/Language/Config.rb', line 113 default_state_getter :model, "native" |
.get_default_optimizer_log ⇒ Object
128 |
# File 'lib/BOAST/Language/Config.rb', line 128 default_state_getter :optimizer_log, false |
.get_default_optimizer_log_file ⇒ Object
129 |
# File 'lib/BOAST/Language/Config.rb', line 129 default_state_getter :optimizer_log_file, nil |
.get_default_real_size ⇒ Object
Returns the default_real_size state.
89 |
# File 'lib/BOAST/Language/Config.rb', line 89 state_accessor :default_real_size |
.get_default_replace_constants ⇒ Object
116 |
# File 'lib/BOAST/Language/Config.rb', line 116 default_state_getter :replace_constants, true |
.get_default_type ⇒ Object
Returns the default_type state.
87 |
# File 'lib/BOAST/Language/Config.rb', line 87 state_accessor :default_type |
.get_default_use_vla ⇒ Object
115 |
# File 'lib/BOAST/Language/Config.rb', line 115 default_state_getter :use_vla, false |
.get_default_verbose ⇒ Object
62 |
# File 'lib/BOAST/Runtime/Config.rb', line 62 default_state_getter :verbose, false |
.get_disable_openmp ⇒ Object
Returns the disable_openmp state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor disable_openmp |
.get_executable ⇒ Object
Returns the executable state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor executable |
.get_ffi ⇒ Object
Returns the ffi state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor ffi |
.get_fortran_line_length ⇒ Object
Returns the fortran_line_length state.
61 |
# File 'lib/BOAST/Runtime/Config.rb', line 61 state_accessor :fortran_line_length |
.get_indent_increment ⇒ Object
Returns the indent_increment state.
93 |
# File 'lib/BOAST/Language/Config.rb', line 93 state_accessor :indent_increment |
.get_indent_level ⇒ Object
Returns the indent_level state.
92 |
# File 'lib/BOAST/Language/Config.rb', line 92 state_accessor :indent_level |
.get_keep_temp ⇒ Object
Returns the keep_temp state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor keep_temp |
.get_lang ⇒ Object
Returns the lang state.
83 |
# File 'lib/BOAST/Language/Config.rb', line 83 state_accessor :lang |
.get_lang_name ⇒ Object
Returns the symbol corresponding to the active language
65 66 67 |
# File 'lib/BOAST/Language/Algorithm.rb', line 65 def get_lang_name return LANGUAGES[lang] end |
.get_model ⇒ Object
Returns the model state.
85 |
# File 'lib/BOAST/Language/Config.rb', line 85 state_accessor :model |
.get_openmp_flags ⇒ Object
103 104 105 |
# File 'lib/BOAST/Runtime/Config.rb', line 103 def get_openmp_flags return @@openmp_default_flags.clone end |
.get_optimizer_log ⇒ Object
Returns the optimizer_log state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor optimizer_log |
.get_optimizer_log_file ⇒ Object
Returns the optimizer_log_file state.
97 |
# File 'lib/BOAST/Language/Config.rb', line 97 state_accessor :optimizer_log_file |
.get_output ⇒ Object
Returns the output state.
82 |
# File 'lib/BOAST/Language/Config.rb', line 82 state_accessor :output |
.get_replace_constants ⇒ Object
Returns the replace_constants state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor replace_constants |
.get_run_config ⇒ Object
130 131 132 |
# File 'lib/BOAST/Runtime/Config.rb', line 130 def get_run_config return @@run_config.clone end |
.get_use_vla ⇒ Object
Returns the use_vla state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor use_vla |
.get_verbose ⇒ Object
Returns the verbose state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor verbose |
.included(base) ⇒ Object
6 7 8 9 10 |
# File 'lib/BOAST/Language/State.rb', line 6 def self.included(base) EXTENDED.each { |m| base.send(:include, m) } end |
.increment_indent_level(increment = get_indent_increment) ⇒ Object
Increments the indent level
117 118 119 |
# File 'lib/BOAST/Language/Algorithm.rb', line 117 def increment_indent_level(increment = get_indent_increment) set_indent_level( get_indent_level + increment ) end |
.indent ⇒ Object
Returns a string with as many space as the indent level.
128 129 130 |
# File 'lib/BOAST/Language/Algorithm.rb', line 128 def indent return " "*get_indent_level end |
.indent_increment ⇒ Object
Returns the BOAST indent_increment state.
93 |
# File 'lib/BOAST/Language/Config.rb', line 93 state_accessor :indent_increment |
.indent_increment=(val) ⇒ Object
Sets indent_increment state to a new value
93 |
# File 'lib/BOAST/Language/Config.rb', line 93 state_accessor :indent_increment |
.indent_level ⇒ Object
Returns the BOAST indent_level state.
92 |
# File 'lib/BOAST/Language/Config.rb', line 92 state_accessor :indent_level |
.indent_level=(val) ⇒ Object
Sets indent_level state to a new value
92 |
# File 'lib/BOAST/Language/Config.rb', line 92 state_accessor :indent_level |
.keep_temp ⇒ Object
Returns the BOAST keep_temp state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor keep_temp |
.keep_temp=(val) ⇒ Object
Sets keep_temp state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor keep_temp |
.keep_temp? ⇒ Object
Returns the boolean evaluation of the keep_temp state.
60 |
# File 'lib/BOAST/Runtime/Config.rb', line 60 boolean_state_accessor :keep_temp |
.lang ⇒ Object
Returns the BOAST lang state.
83 |
# File 'lib/BOAST/Language/Config.rb', line 83 state_accessor :lang |
.lang=(val) ⇒ Object
Sets lang state to a new value
83 |
# File 'lib/BOAST/Language/Config.rb', line 83 state_accessor :lang |
.model ⇒ Object
Returns the BOAST model state.
85 |
# File 'lib/BOAST/Language/Config.rb', line 85 state_accessor :model |
.model=(val) ⇒ Object
Sets model state to a new value
85 |
# File 'lib/BOAST/Language/Config.rb', line 85 state_accessor :model |
.model_old= ⇒ Object
Sets model state to a new value
138 |
# File 'lib/BOAST/Language/Config.rb', line 138 state_accessor :model |
.open(a) ⇒ Object
10 11 12 |
# File 'lib/BOAST/Language/Print.rb', line 10 def self.open(a) opn(a) end |
.opn(a) ⇒ Object
One of BOAST keywords: opens a BOAST ControlStructure or Procedure. Calls the open method of the given object.
184 185 186 |
# File 'lib/BOAST/Language/Algorithm.rb', line 184 def opn(a) a.open end |
.optimizer_log ⇒ Object
Returns the BOAST optimizer_log state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor optimizer_log |
.optimizer_log=(val) ⇒ Object
Sets optimizer_log state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor optimizer_log |
.optimizer_log? ⇒ Object
Returns the boolean evaluation of the optimizer_log state.
106 |
# File 'lib/BOAST/Language/Config.rb', line 106 boolean_state_accessor :optimizer_log |
.optimizer_log_file ⇒ Object
Returns the BOAST optimizer_log_file state.
97 |
# File 'lib/BOAST/Language/Config.rb', line 97 state_accessor :optimizer_log_file |
.optimizer_log_file=(val) ⇒ Object
Sets optimizer_log_file state to a new value
97 |
# File 'lib/BOAST/Language/Config.rb', line 97 state_accessor :optimizer_log_file |
.output ⇒ Object
Returns the BOAST output state.
82 |
# File 'lib/BOAST/Language/Config.rb', line 82 state_accessor :output |
.output=(val) ⇒ Object
Sets output state to a new value
82 |
# File 'lib/BOAST/Language/Config.rb', line 82 state_accessor :output |
.pop_env(*vars) ⇒ Object
Pops the specified states values
106 107 108 109 110 111 112 113 |
# File 'lib/BOAST/Language/Algorithm.rb', line 106 def pop_env(*vars) vars.each { |key| raise "Unknown module variable #{key}!" unless @@env.has_key?(key) ret = @@env[key].pop raise "No stored value for #{key}!" if ret.nil? BOAST::send("set_#{key}", ret) } end |
.pr(a, *args, &block) ⇒ Object
One of BOAST keywords: prints BOAST objects. Annotates the given object. Calls the given object pr method with the optional arguments.
167 168 169 170 |
# File 'lib/BOAST/Language/Algorithm.rb', line 167 def pr(a, *args, &block) pr_annotate(a) if annotate? a.pr(*args, &block) end |
.pr_annotate(a) ⇒ Object
Annotates an Object by inlining a YAML structure in a comment. If object’s class is part of the annotate list an indepth version of the annotation will be generated.
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/BOAST/Language/Algorithm.rb', line 149 def pr_annotate(a) name = a.class.name.gsub("BOAST::","") if annotate_list.include?(name) then description = nil if a.is_a?(Annotation) and a.annotate_indepth?(0) then description = a.annotation(0) end annotation = { "#{name}#{annotate_number(name)}" => description } Comment(YAML::dump(annotation)).pr end end |
.print(a, *args) ⇒ Object
5 6 7 |
# File 'lib/BOAST/Language/Print.rb', line 5 def self.print(a, *args) pr(a, *args) end |
.push_env(vars) ⇒ Object .push_env(vars, &block) ⇒ Object
Updates states and stores their value in a stack for later retrieval
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/BOAST/Language/Algorithm.rb', line 81 def push_env(vars, &block) keys = [] vars.each { |key, value| var = nil begin var = BOAST::send("get_#{key}") rescue BOAST::pop_env(*keys) raise "Unknown module variable #{key}!" end @@env[key].push(var) BOAST::send("set_#{key}", value) keys.push(key) } if block then begin block.call ensure BOAST::pop_env(*vars.keys) end end end |
.read_boast_compiler_config ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/BOAST/Runtime/Config.rb', line 72 def read_boast_compiler_config boast_config_dir = assert_boast_config_dir return unless boast_config_dir = "#{boast_config_dir}/compiler_options" if File::exist?( ) then File::open( , "r" ) { |f| @@compiler_default_options.update( YAML::load( f.read ) ) } else File::open( , "w" ) { |f| f.write YAML::dump( @@compiler_default_options ) } end openmp_flags_file = "#{boast_config_dir}/openmp_flags" if File::exist?( openmp_flags_file ) then File::open( openmp_flags_file, "r" ) { |f| @@openmp_default_flags.update( YAML::load( f.read ) ) } else File::open( openmp_flags_file, "w" ) { |f| f.write YAML::dump( @@openmp_default_flags ) } end @@compiler_default_options.each_key { |k| @@compiler_default_options[k] = ENV[k.to_s] if ENV[k.to_s] } @@compiler_default_options[:LD] = ENV["LD"] if ENV["LD"] end |
.read_boast_config ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/BOAST/Language/Config.rb', line 34 def read_boast_config boast_config_dir = assert_boast_config_dir return unless boast_config_dir boast_config_file = "#{boast_config_dir}/config" if File::exist?( boast_config_file ) then File::open( boast_config_file, "r" ) { |f| @@boast_config.update( YAML::load( f.read ) ) } else File::open( boast_config_file, "w" ) { |f| f.write YAML::dump( @@boast_config ) } end end |
.read_boast_run_config ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/BOAST/Runtime/Config.rb', line 111 def read_boast_run_config boast_config_dir = assert_boast_config_dir run_config_file = "#{boast_config_dir}/run_config" if File::exist?( run_config_file ) then File::open( run_config_file, "r" ) { |f| @@run_config.update( YAML::load( f.read ) ) } else File::open( run_config_file, "w" ) { |f| f.write YAML::dump( @@run_config ) } end @@run_options.each { |o| @@run_config[o] = YAML::load(ENV[o.to_s]) if ENV[o.to_s] } end |
.register_funccall(name, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/BOAST/Language/Parens.rb', line 7 def register_funccall(name, = {}) sym = name.to_sym ret = [:return] ? [:return] : [:returns] FUNCCALLS[sym] = {} FUNCCALLS[sym][:parameters] = [:parameters] FUNCCALLS[sym][:return] = ret s =<<EOF def self.#{name}(*args) return FuncCall(#{sym.inspect}, *args#{ ret ? ", return: FUNCCALLS[#{sym.inspect}][:return]" : ""}) end EOF eval s end |
.replace_constants ⇒ Object
Returns the BOAST replace_constants state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor replace_constants |
.replace_constants=(val) ⇒ Object
Sets replace_constants state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor replace_constants |
.replace_constants? ⇒ Object
Returns the boolean evaluation of the replace_constants state.
99 |
# File 'lib/BOAST/Language/Config.rb', line 99 boolean_state_accessor :replace_constants |
.reset_annotate_numbers ⇒ Object
Resets the annotate_numbers to an empty Hash
141 142 143 |
# File 'lib/BOAST/Language/Algorithm.rb', line 141 def reset_annotate_numbers @@annotate_numbers = Hash::new { |h,k| h[k] = 0 } end |
.set_address_size(val) ⇒ Object
Sets address_size state to a new value
86 |
# File 'lib/BOAST/Language/Config.rb', line 86 state_accessor :address_size |
.set_annotate(val) ⇒ Object
Sets annotate state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor annotate |
.set_annotate_indepth_list(val) ⇒ Object
Sets annotate_indepth_list state to a new value
95 |
# File 'lib/BOAST/Language/Config.rb', line 95 state_accessor :annotate_indepth_list |
.set_annotate_level(val) ⇒ Object
Sets annotate_level state to a new value
96 |
# File 'lib/BOAST/Language/Config.rb', line 96 state_accessor :annotate_level |
.set_annotate_list(val) ⇒ Object
Sets annotate_list state to a new value
94 |
# File 'lib/BOAST/Language/Config.rb', line 94 state_accessor :annotate_list |
.set_architecture(val) ⇒ Object
Sets architecture state to a new value
84 |
# File 'lib/BOAST/Language/Config.rb', line 84 state_accessor :architecture |
.set_array_start(val) ⇒ Object
Sets array_start state to a new value
91 |
# File 'lib/BOAST/Language/Config.rb', line 91 state_accessor :array_start |
.set_boast_inspect(val) ⇒ Object
Sets boast_inspect state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor boast_inspect |
.set_chain_code(val) ⇒ Object
Sets chain_code state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor chain_code |
.set_debug(val) ⇒ Object
Sets debug state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor debug |
.set_debug_kernel_source(val) ⇒ Object
Sets debug_kernel_source state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_kernel_source |
.set_debug_source(val) ⇒ Object
Sets debug_source state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor debug_source |
.set_decl_module(val) ⇒ Object
Sets decl_module state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor decl_module |
.set_default_align(val) ⇒ Object
Sets default_align state to a new value
90 |
# File 'lib/BOAST/Language/Config.rb', line 90 state_accessor :default_align |
.set_default_int_signed(val) ⇒ Object
Sets default_int_signed state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor default_int_signed |
.set_default_int_size(val) ⇒ Object
Sets default_int_size state to a new value
88 |
# File 'lib/BOAST/Language/Config.rb', line 88 state_accessor :default_int_size |
.set_default_real_size(val) ⇒ Object
Sets default_real_size state to a new value
89 |
# File 'lib/BOAST/Language/Config.rb', line 89 state_accessor :default_real_size |
.set_default_type(val) ⇒ Object
Sets default_type state to a new value
87 |
# File 'lib/BOAST/Language/Config.rb', line 87 state_accessor :default_type |
.set_disable_openmp(val) ⇒ Object
Sets disable_openmp state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor disable_openmp |
.set_executable(val) ⇒ Object
Sets executable state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor executable |
.set_ffi(val) ⇒ Object
Sets ffi state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor ffi |
.set_fortran_line_length(val) ⇒ Object
Sets fortran_line_length state to a new value
61 |
# File 'lib/BOAST/Runtime/Config.rb', line 61 state_accessor :fortran_line_length |
.set_indent_increment(val) ⇒ Object
Sets indent_increment state to a new value
93 |
# File 'lib/BOAST/Language/Config.rb', line 93 state_accessor :indent_increment |
.set_indent_level(val) ⇒ Object
Sets indent_level state to a new value
92 |
# File 'lib/BOAST/Language/Config.rb', line 92 state_accessor :indent_level |
.set_keep_temp(val) ⇒ Object
Sets keep_temp state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor keep_temp |
.set_lang(val) ⇒ Object
Sets lang state to a new value
83 |
# File 'lib/BOAST/Language/Config.rb', line 83 state_accessor :lang |
.set_model(val) ⇒ Object
Sets model state to a new value
85 |
# File 'lib/BOAST/Language/Config.rb', line 85 state_accessor :model |
.set_model_old ⇒ Object
Sets model state to a new value
136 |
# File 'lib/BOAST/Language/Config.rb', line 136 state_accessor :model |
.set_optimizer_log(val) ⇒ Object
Sets optimizer_log state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor optimizer_log |
.set_optimizer_log_file(val) ⇒ Object
Sets optimizer_log_file state to a new value
97 |
# File 'lib/BOAST/Language/Config.rb', line 97 state_accessor :optimizer_log_file |
.set_output(val) ⇒ Object
Sets output state to a new value
82 |
# File 'lib/BOAST/Language/Config.rb', line 82 state_accessor :output |
.set_replace_constants(val) ⇒ Object
Sets replace_constants state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor replace_constants |
.set_use_vla(val) ⇒ Object
Sets use_vla state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor use_vla |
.set_verbose(val) ⇒ Object
Sets verbose state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor verbose |
.state_accessor(state) ⇒ Object
Generates setters and getters for the specified state
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/BOAST/Language/State.rb', line 31 def self.state_accessor(state) s = <<EOF module_function def #{state}=(val) @@#{state} = val end def #{state} @@#{state} end def set_#{state}(val) @@#{state} = val end def get_#{state} @@#{state} end EOF eval s end |
.use_vla ⇒ Object
Returns the BOAST use_vla state.
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor use_vla |
.use_vla=(val) ⇒ Object
Sets use_vla state to a new value
1 |
# File 'lib/BOAST/Language/Config.rb', line 1 state_accessor use_vla |
.use_vla? ⇒ Boolean
Returns the boolean evaluation of the use_vla state. false if lang is CL or CUDA.
144 |
# File 'lib/BOAST/Language/Config.rb', line 144 boolean_state_accessor :use_vla |
.use_vla_old? ⇒ Object
Returns the boolean evaluation of the use_vla state.
134 |
# File 'lib/BOAST/Language/Config.rb', line 134 boolean_state_accessor :use_vla |
.verbose ⇒ Object
Returns the BOAST verbose state.
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor verbose |
.verbose=(val) ⇒ Object
Sets verbose state to a new value
1 |
# File 'lib/BOAST/Runtime/Config.rb', line 1 state_accessor verbose |
.verbose? ⇒ Object
Returns the boolean evaluation of the verbose state.
55 |
# File 'lib/BOAST/Runtime/Config.rb', line 55 boolean_state_accessor :verbose |