Skip to content

Commit 8f0a012

Browse files
committed
Config: SIMD Details
Add details on SIMD status and size (lanes/registers) in ```py import amrex.space3d as amr amr.Config ``` So one can check their values at runtime.
1 parent 5f92201 commit 8f0a012

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/Base/AMReX.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <AMReX.H>
44
#include <AMReX_Vector.H>
55
#include <AMReX_ParmParse.H>
6+
#include <AMReX_SIMD.H>
67

78
#include <string>
89

@@ -61,7 +62,7 @@ void init_AMReX(py::module& m)
6162
#else
6263
return false;
6364
#endif
64-
})
65+
})
6566
.def_property_readonly_static(
6667
"have_omp",
6768
[](py::object){
@@ -70,7 +71,21 @@ void init_AMReX(py::module& m)
7071
#else
7172
return false;
7273
#endif
73-
})
74+
})
75+
.def_property_readonly_static(
76+
"have_simd",
77+
[](py::object const &){
78+
#ifdef AMREX_USE_SIMD
79+
return true;
80+
#else
81+
return false;
82+
#endif
83+
})
84+
.def_property_readonly_static(
85+
"simd_size",
86+
[](py::object const &){
87+
return amrex::simd::native_simd_size_real;
88+
})
7489
.def_property_readonly_static(
7590
"gpu_backend",
7691
[](py::object){

0 commit comments

Comments
 (0)