Class: BOAST::Sizet
- Defined in:
- lib/BOAST/Language/DataTypes.rb
Constant Summary
Constants included from Intrinsics
Intrinsics::CONVERSIONS, Intrinsics::INTRINSICS
Instance Attribute Summary collapse
-
#signed ⇒ Object
readonly
Returns the value of attribute signed.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#vector_length ⇒ Object
readonly
Returns the value of attribute vector_length.
Instance Method Summary collapse
- #copy(options = {}) ⇒ Object
- #decl ⇒ Object
- #decl_ffi ⇒ Object
-
#initialize(hash = {}) ⇒ Sizet
constructor
A new instance of Sizet.
- #signed? ⇒ Boolean
- #suffix ⇒ Object
- #to_hash ⇒ Object
Methods inherited from DataType
Methods included from PrivateStateAccessor
#address_size, #address_size=, #annotate, #annotate=, #annotate?, #annotate_indepth_list, #annotate_indepth_list=, #annotate_level, #annotate_level=, #annotate_list, #annotate_list=, #architecture, #architecture=, #array_start, #array_start=, #chain_code, #chain_code=, #chain_code?, #debug, #debug=, #debug?, #debug_kernel_source, #debug_kernel_source=, #debug_kernel_source?, #debug_source, #debug_source=, #debug_source?, #decl_module, #decl_module=, #decl_module?, #default_align, #default_align=, #default_int_signed, #default_int_signed=, #default_int_signed?, #default_int_size, #default_int_size=, #default_real_size, #default_real_size=, #default_type, #default_type=, #disable_openmp, #disable_openmp=, #disable_openmp?, #executable, #executable=, #executable?, #ffi, #ffi=, #ffi?, #fortran_line_length, #fortran_line_length=, #get_address_size, #get_annotate, #get_annotate_indepth_list, #get_annotate_level, #get_annotate_list, #get_architecture, #get_array_start, #get_chain_code, #get_debug, #get_debug_kernel_source, #get_debug_source, #get_decl_module, #get_default_align, #get_default_int_signed, #get_default_int_size, #get_default_real_size, #get_default_type, #get_disable_openmp, #get_executable, #get_ffi, #get_fortran_line_length, #get_indent_increment, #get_indent_level, #get_keep_temp, #get_lang, #get_model, #get_optimizer_log, #get_optimizer_log_file, #get_output, #get_replace_constants, #get_synchro, #get_use_vla, #get_verbose, #indent_increment, #indent_increment=, #indent_level, #indent_level=, #keep_temp, #keep_temp=, #keep_temp?, #lang, #lang=, #model, #model=, #optimizer_log, #optimizer_log=, #optimizer_log?, #optimizer_log_file, #optimizer_log_file=, #output, #output=, #replace_constants, #replace_constants=, #replace_constants?, #set_address_size, #set_annotate, #set_annotate_indepth_list, #set_annotate_level, #set_annotate_list, #set_architecture, #set_array_start, #set_chain_code, #set_debug, #set_debug_kernel_source, #set_debug_source, #set_decl_module, #set_default_align, #set_default_int_signed, #set_default_int_size, #set_default_real_size, #set_default_type, #set_disable_openmp, #set_executable, #set_ffi, #set_fortran_line_length, #set_indent_increment, #set_indent_level, #set_keep_temp, #set_lang, #set_model, #set_optimizer_log, #set_optimizer_log_file, #set_output, #set_replace_constants, #set_synchro, #set_use_vla, #set_verbose, #synchro, #synchro=, #use_vla, #use_vla=, #use_vla?, #verbose, #verbose=, #verbose?
Methods included from Intrinsics
check_coverage, generate_conversions, get_conversion_path, get_vector_decl, get_vector_decl_ARM, get_vector_decl_X86, get_vector_name, intrinsics, intrinsics_by_vector_name, type_name_ARM, type_name_X86, vector_type_name
Constructor Details
#initialize(hash = {}) ⇒ Sizet
Returns a new instance of Sizet.
25 26 27 28 29 30 31 |
# File 'lib/BOAST/Language/DataTypes.rb', line 25 def initialize(hash={}) if hash[:signed] != nil then @signed = hash[:signed] end @size = nil @vector_length = 1 end |
Instance Attribute Details
#signed ⇒ Object (readonly)
Returns the value of attribute signed.
21 22 23 |
# File 'lib/BOAST/Language/DataTypes.rb', line 21 def signed @signed end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
22 23 24 |
# File 'lib/BOAST/Language/DataTypes.rb', line 22 def size @size end |
#vector_length ⇒ Object (readonly)
Returns the value of attribute vector_length.
23 24 25 |
# File 'lib/BOAST/Language/DataTypes.rb', line 23 def vector_length @vector_length end |
Instance Method Details
#copy(options = {}) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/BOAST/Language/DataTypes.rb', line 37 def copy(={}) hash = to_hash .each { |k,v| hash[k] = v } return Sizet::new(hash) end |
#decl ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/BOAST/Language/DataTypes.rb', line 45 def decl return "integer(kind=#{get_default_int_size})" if lang == FORTRAN unless @signed then return "size_t" if [C, CL, CUDA].include?( lang ) else return "ptrdiff_t" if [C, CL, CUDA].include?( lang ) end end |
#decl_ffi ⇒ Object
54 55 56 |
# File 'lib/BOAST/Language/DataTypes.rb', line 54 def decl_ffi return :size_t end |
#signed? ⇒ Boolean
58 59 60 |
# File 'lib/BOAST/Language/DataTypes.rb', line 58 def signed? return signed end |
#suffix ⇒ Object
62 63 64 65 |
# File 'lib/BOAST/Language/DataTypes.rb', line 62 def suffix s = "" return s end |
#to_hash ⇒ Object
33 34 35 |
# File 'lib/BOAST/Language/DataTypes.rb', line 33 def to_hash return { :signed => @signed } end |