Mercurial > octave
comparison liboctave/system/lo-sysinfo.cc @ 31607:aac27ad79be6 stable
maint: Re-indent code after switch to using namespace macros.
* build-env.h, build-env.in.cc, Cell.h, __betainc__.cc, __eigs__.cc,
__ftp__.cc, __ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __magick_read__.cc,
__pchip_deriv__.cc, amd.cc, base-text-renderer.cc, base-text-renderer.h,
besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.h, call-stack.cc,
call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, dasrt.cc, data.cc,
debug.cc, defaults.cc, defaults.h, det.cc, display.cc, display.h, dlmread.cc,
dynamic-ld.cc, dynamic-ld.h, ellipj.cc, environment.cc, environment.h,
error.cc, error.h, errwarn.h, event-manager.cc, event-manager.h,
event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h, fft.cc, fft2.cc,
file-io.cc, filter.cc, find.cc, ft-text-renderer.cc, ft-text-renderer.h,
gcd.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h,
graphics-toolkit.cc, graphics-toolkit.h, graphics.cc, gsvd.cc, gtk-manager.cc,
gtk-manager.h, help.cc, help.h, hook-fcn.cc, hook-fcn.h, input.cc, input.h,
interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h,
inv.cc, jsondecode.cc, jsonencode.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
lookup.cc, ls-hdf5.cc, ls-mat4.cc, ls-mat5.cc, lsode.cc, lu.cc, mappers.cc,
matrix_type.cc, max.cc, mex.cc, mexproto.h, mxarray.h, mxtypes.in.h,
oct-errno.in.cc, oct-hdf5-types.cc, oct-hist.cc, oct-hist.h, oct-map.cc,
oct-map.h, oct-opengl.h, oct-prcstrm.h, oct-process.cc, oct-process.h,
oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h,
octave-default-image.h, ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc,
pow2.cc, pr-output.cc, psi.cc, qr.cc, quadcc.cc, rand.cc, regexp.cc,
settings.cc, settings.h, sighandlers.cc, sighandlers.h, sparse-xpow.cc,
sqrtm.cc, stack-frame.cc, stack-frame.h, stream-euler.cc, strfns.cc, svd.cc,
syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h, symscope.cc, symscope.h,
symtab.cc, symtab.h, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h,
text-renderer.cc, text-renderer.h, time.cc, toplev.cc, typecast.cc,
url-handle-manager.cc, url-handle-manager.h, urlwrite.cc, utils.cc, utils.h,
variables.cc, variables.h, xdiv.cc, __delaunayn__.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audioread.cc, convhulln.cc,
gzip.cc, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base-diag.cc, ov-base-int.cc, ov-base-mat.cc,
ov-base-mat.h, ov-base-scalar.cc, ov-base.cc, ov-base.h, ov-bool-mat.cc,
ov-bool-mat.h, ov-bool-sparse.cc, ov-bool.cc, ov-builtin.h, ov-cell.cc,
ov-ch-mat.cc, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h,
ov-complex.cc, ov-cx-diag.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-dld-fcn.cc,
ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h, ov-float.cc,
ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc, ov-flt-re-diag.cc,
ov-flt-re-mat.cc, ov-flt-re-mat.h, ov-intx.h, ov-java.cc, ov-lazy-idx.cc,
ov-legacy-range.cc, ov-magic-int.cc, ov-mex-fcn.cc, ov-mex-fcn.h,
ov-null-mat.cc, ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc,
ov-re-mat.h, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc, ov-struct.cc,
ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, ovl.h,
octave.cc, octave.h, op-b-sbm.cc, op-bm-sbm.cc, op-cs-scm.cc, op-fm-fcm.cc,
op-fs-fcm.cc, op-s-scm.cc, op-scm-cs.cc, op-scm-s.cc, op-sm-cs.cc, ops.h,
anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h,
comment-list.cc, comment-list.h, filepos.h, lex.h, oct-lvalue.cc, oct-lvalue.h,
parse.h, profiler.cc, profiler.h, pt-anon-scopes.cc, pt-anon-scopes.h,
pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc, pt-args-block.h,
pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc,
pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt-cell.cc,
pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, pt-cmd.h,
pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h, pt-decl.cc, pt-decl.h,
pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc, pt-exp.h,
pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h,
pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h,
pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h,
pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h,
pt-walk.cc, pt-walk.h, pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h,
idx-vector.cc, idx-vector.h, range-fwd.h, CollocWt.cc, CollocWt.h,
aepbalance.cc, aepbalance.h, chol.cc, chol.h, gepbalance.cc, gepbalance.h,
gsvd.cc, gsvd.h, hess.cc, hess.h, lo-mappers.cc, lo-mappers.h, lo-specfun.cc,
lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h,
oct-norm.cc, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc,
oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h,
randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h,
sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc,
sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h,
file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h,
lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h,
oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc,
oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h,
action-container.cc, action-container.h, base-list.h, cmd-edit.cc, cmd-edit.h,
cmd-hist.cc, cmd-hist.h, f77-fcn.h, file-info.cc, file-info.h,
lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc, lo-hash.h, lo-ieee.h,
lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h, oct-base64.cc,
oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h, oct-mutex.cc,
oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h, oct-sparse.cc,
oct-sparse.h, oct-string.h, octave-preserve-stream-state.h, pathsearch.cc,
pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc,
url-transfer.h:
Re-indent code after switch to using namespace macros.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Dec 2022 18:02:15 -0800 |
parents | e88a07dec498 |
children | 597f3ee61a48 |
comparison
equal
deleted
inserted
replaced
31605:e88a07dec498 | 31607:aac27ad79be6 |
---|---|
40 | 40 |
41 OCTAVE_BEGIN_NAMESPACE(octave) | 41 OCTAVE_BEGIN_NAMESPACE(octave) |
42 | 42 |
43 OCTAVE_BEGIN_NAMESPACE(sys) | 43 OCTAVE_BEGIN_NAMESPACE(sys) |
44 | 44 |
45 std::string blas_version (void) | 45 std::string blas_version (void) |
46 { | |
47 dynamic_library dyn_libs (""); | |
48 | |
49 if (! dyn_libs) | |
50 return "unknown BLAS"; | |
51 | |
52 std::string retval; | |
53 | |
54 // Check for functions that are specific to certain BLAS implementations. | |
55 | |
56 // FlexiBLAS | |
57 typedef void (*flexi_f_type) (int *, int *, int *); | |
58 flexi_f_type flexi_f_ptr = reinterpret_cast<flexi_f_type> | |
59 (dyn_libs.search ("flexiblas_get_version")); | |
60 | |
61 if (flexi_f_ptr) | |
46 { | 62 { |
47 dynamic_library dyn_libs (""); | 63 int v_major = 0; |
64 int v_minor = 0; | |
65 int v_patch = 0; | |
66 flexi_f_ptr (&v_major, &v_minor, &v_patch); | |
48 | 67 |
49 if (! dyn_libs) | 68 std::ostringstream s; |
50 return "unknown BLAS"; | 69 s << "FlexiBLAS Version " |
70 << v_major << "." << v_minor << "." << v_patch; | |
51 | 71 |
52 std::string retval; | 72 retval = s.str (); |
53 | |
54 // Check for functions that are specific to certain BLAS implementations. | |
55 | |
56 // FlexiBLAS | |
57 typedef void (*flexi_f_type) (int *, int *, int *); | |
58 flexi_f_type flexi_f_ptr = reinterpret_cast<flexi_f_type> | |
59 (dyn_libs.search ("flexiblas_get_version")); | |
60 | |
61 if (flexi_f_ptr) | |
62 { | |
63 int v_major = 0; | |
64 int v_minor = 0; | |
65 int v_patch = 0; | |
66 flexi_f_ptr (&v_major, &v_minor, &v_patch); | |
67 | |
68 std::ostringstream s; | |
69 s << "FlexiBLAS Version " | |
70 << v_major << "." << v_minor << "." << v_patch; | |
71 | |
72 retval = s.str (); | |
73 } | |
74 | |
75 // OpenBLAS | |
76 typedef char * (*open_fcn_type) (void); | |
77 open_fcn_type open_f_ptr = reinterpret_cast<open_fcn_type> | |
78 (dyn_libs.search ("openblas_get_config")); | |
79 | |
80 if (open_f_ptr) | |
81 { | |
82 if (! retval.empty ()) | |
83 retval += "\n"; | |
84 | |
85 retval += "OpenBLAS (config: " + std::string (open_f_ptr ()) + ")"; | |
86 } | |
87 | |
88 // OpenBLAS with minimal extension functions included in the library | |
89 else if (dyn_libs.search ("openblas_get_num_threads")) | |
90 { | |
91 if (! retval.empty ()) | |
92 retval += "\n"; | |
93 | |
94 retval += "OpenBLAS (config: unknown)"; | |
95 } | |
96 | |
97 // GotoBLAS(2) | |
98 if (dyn_libs.search ("gotoblas_profile_init")) | |
99 { | |
100 if (! retval.empty ()) | |
101 retval += "\n"; | |
102 | |
103 retval += "GotoBLAS(2)"; | |
104 } | |
105 | |
106 // ATLAS | |
107 // FIXME: If we are really interested, we could use a pipe to | |
108 // redirect the output of "ATL_buildinfo". | |
109 if (dyn_libs.search ("ATL_buildinfo")) | |
110 { | |
111 if (! retval.empty ()) | |
112 retval += "\n"; | |
113 | |
114 retval += "ATLAS"; | |
115 } | |
116 | |
117 // ACML | |
118 typedef void (*acml_f_type) (int *, int *, int *); | |
119 acml_f_type acml_f_ptr = reinterpret_cast<acml_f_type> | |
120 (dyn_libs.search ("acmlversion")); | |
121 | |
122 if (acml_f_ptr) | |
123 { | |
124 int v_major = 0; | |
125 int v_minor = 0; | |
126 int v_patch = 0; | |
127 acml_f_ptr (&v_major, &v_minor, &v_patch); | |
128 | |
129 std::ostringstream s; | |
130 s << "ACML BLAS Version " | |
131 << v_major << "." << v_minor << "." << v_patch; | |
132 | |
133 if (! retval.empty ()) | |
134 retval += "\n"; | |
135 | |
136 retval += s.str (); | |
137 } | |
138 | |
139 // Intel MKL | |
140 typedef void (*mkl_f_type) (char *, int); | |
141 mkl_f_type mkl_f_ptr = reinterpret_cast<mkl_f_type> | |
142 (dyn_libs.search ("mkl_get_version_string")); | |
143 | |
144 if (mkl_f_ptr) | |
145 { | |
146 char buf[198]; | |
147 int len = 198; | |
148 mkl_f_ptr (buf, len); | |
149 | |
150 if (! retval.empty ()) | |
151 retval += "\n"; | |
152 | |
153 retval += std::string (buf); | |
154 } | |
155 | |
156 // Otherwise | |
157 if (retval.empty ()) | |
158 retval = "unknown or reference BLAS"; | |
159 | |
160 return retval; | |
161 } | 73 } |
162 | 74 |
163 std::string lapack_version (void) | 75 // OpenBLAS |
76 typedef char *(*open_fcn_type) (void); | |
77 open_fcn_type open_f_ptr = reinterpret_cast<open_fcn_type> | |
78 (dyn_libs.search ("openblas_get_config")); | |
79 | |
80 if (open_f_ptr) | |
164 { | 81 { |
165 std::string retval = "unknown LAPACK"; | 82 if (! retval.empty ()) |
83 retval += "\n"; | |
166 | 84 |
167 dynamic_library dyn_libs (""); | 85 retval += "OpenBLAS (config: " + std::string (open_f_ptr ()) + ")"; |
86 } | |
168 | 87 |
169 if (! dyn_libs) | 88 // OpenBLAS with minimal extension functions included in the library |
170 return retval; | 89 else if (dyn_libs.search ("openblas_get_num_threads")) |
90 { | |
91 if (! retval.empty ()) | |
92 retval += "\n"; | |
171 | 93 |
172 // query LAPACK version | 94 retval += "OpenBLAS (config: unknown)"; |
173 typedef F77_RET_T | 95 } |
174 (*ilaver_fcn_type) (const F77_INT&, const F77_INT&, const F77_INT&); | |
175 ilaver_fcn_type f_ptr = reinterpret_cast<ilaver_fcn_type> | |
176 (dyn_libs.search (STRINGIZE (F77_FUNC (ilaver, ILAVER)))); | |
177 | 96 |
178 if (f_ptr) | 97 // GotoBLAS(2) |
179 { | 98 if (dyn_libs.search ("gotoblas_profile_init")) |
180 int v_major = 0; | 99 { |
181 int v_minor = 0; | 100 if (! retval.empty ()) |
182 int v_patch = 0; | 101 retval += "\n"; |
183 f_ptr (v_major, v_minor, v_patch); | |
184 | 102 |
185 std::ostringstream s; | 103 retval += "GotoBLAS(2)"; |
186 s << "Linear Algebra PACKage Version " | 104 } |
187 << v_major << "." << v_minor << "." << v_patch; | |
188 | 105 |
189 retval = s.str (); | 106 // ATLAS |
190 } | 107 // FIXME: If we are really interested, we could use a pipe to |
108 // redirect the output of "ATL_buildinfo". | |
109 if (dyn_libs.search ("ATL_buildinfo")) | |
110 { | |
111 if (! retval.empty ()) | |
112 retval += "\n"; | |
191 | 113 |
192 return retval; | 114 retval += "ATLAS"; |
193 } | 115 } |
116 | |
117 // ACML | |
118 typedef void (*acml_f_type) (int *, int *, int *); | |
119 acml_f_type acml_f_ptr = reinterpret_cast<acml_f_type> | |
120 (dyn_libs.search ("acmlversion")); | |
121 | |
122 if (acml_f_ptr) | |
123 { | |
124 int v_major = 0; | |
125 int v_minor = 0; | |
126 int v_patch = 0; | |
127 acml_f_ptr (&v_major, &v_minor, &v_patch); | |
128 | |
129 std::ostringstream s; | |
130 s << "ACML BLAS Version " | |
131 << v_major << "." << v_minor << "." << v_patch; | |
132 | |
133 if (! retval.empty ()) | |
134 retval += "\n"; | |
135 | |
136 retval += s.str (); | |
137 } | |
138 | |
139 // Intel MKL | |
140 typedef void (*mkl_f_type) (char *, int); | |
141 mkl_f_type mkl_f_ptr = reinterpret_cast<mkl_f_type> | |
142 (dyn_libs.search ("mkl_get_version_string")); | |
143 | |
144 if (mkl_f_ptr) | |
145 { | |
146 char buf[198]; | |
147 int len = 198; | |
148 mkl_f_ptr (buf, len); | |
149 | |
150 if (! retval.empty ()) | |
151 retval += "\n"; | |
152 | |
153 retval += std::string (buf); | |
154 } | |
155 | |
156 // Otherwise | |
157 if (retval.empty ()) | |
158 retval = "unknown or reference BLAS"; | |
159 | |
160 return retval; | |
161 } | |
162 | |
163 std::string lapack_version (void) | |
164 { | |
165 std::string retval = "unknown LAPACK"; | |
166 | |
167 dynamic_library dyn_libs (""); | |
168 | |
169 if (! dyn_libs) | |
170 return retval; | |
171 | |
172 // query LAPACK version | |
173 typedef F77_RET_T | |
174 (*ilaver_fcn_type) (const F77_INT&, const F77_INT&, const F77_INT&); | |
175 ilaver_fcn_type f_ptr = reinterpret_cast<ilaver_fcn_type> | |
176 (dyn_libs.search (STRINGIZE (F77_FUNC (ilaver, ILAVER)))); | |
177 | |
178 if (f_ptr) | |
179 { | |
180 int v_major = 0; | |
181 int v_minor = 0; | |
182 int v_patch = 0; | |
183 f_ptr (v_major, v_minor, v_patch); | |
184 | |
185 std::ostringstream s; | |
186 s << "Linear Algebra PACKage Version " | |
187 << v_major << "." << v_minor << "." << v_patch; | |
188 | |
189 retval = s.str (); | |
190 } | |
191 | |
192 return retval; | |
193 } | |
194 | 194 |
195 OCTAVE_END_NAMESPACE(sys) | 195 OCTAVE_END_NAMESPACE(sys) |
196 OCTAVE_END_NAMESPACE(octave) | 196 OCTAVE_END_NAMESPACE(octave) |