30 inline htype get_h_max(
35 if (pdat.get_obj_cnt() == 0)
40 u32 nobj = pdat.get_obj_cnt();
42 if constexpr (std::is_same<htype, f32>::value) {
45 tmp = syclalg::get_max<f32>(pdat.get_field<
f32>(ihpart).get_buf(), nobj);
47 }
else if constexpr (std::is_same<htype, f64>::value) {
49 tmp = syclalg::get_max<f64>(pdat.get_field<
f64>(ihpart).get_buf(), nobj);
53 "get_h_max -> current htype not handled");
63 inline htype get_h_max(PatchDataLayerLayout & pdl,sycl::queue & queue, PatchDataBuffer & pdatbuf){
65 if(pdatbuf.element_count == 0)
return 0;
70 u32 & nobj = pdatbuf.element_count;
72 if constexpr (std::is_same<htype, f32>::value){
74 u32 ihpart = pdl.get_field_idx<
f32>(::sph::field_names::field_hpart);
75 tmp = syclalg::get_max<f32>(queue, pdatbuf.fields_f32[ihpart],nobj);
77 }
else if constexpr (std::is_same<htype, f64>::value){
78 u32 ihpart = pdl.get_field_idx<
f64>(::sph::field_names::field_hpart);
79 tmp = syclalg::get_max<f64>(queue, pdatbuf.fields_f64[ihpart],nobj);
82 throw shamrock_exc(
"get_h_max -> current htype not handled");
93 inline std::tuple<vec,vec> get_patchdata_BBAA(sycl::queue & queue,PatchDataBuffer & pdatbuf);
96 inline std::tuple<f32_3,f32_3> get_patchdata_BBAA(sycl::queue & queue,PatchDataBuffer & pdatbuf){
98 u32 ihpart = pdatbuf.pdl.get_field_idx<f32_3>(
"xyz");
99 return syclalg::get_min_max<f32_3>(queue, pdatbuf.fields_f32_3[ihpart],pdatbuf.element_count);
104 inline std::tuple<f64_3,f64_3> get_patchdata_BBAA(sycl::queue & queue,PatchDataBuffer & pdatbuf){
105 u32 ihpart = pdatbuf.pdl.get_field_idx<f64_3>(
"xyz");
106 return syclalg::get_min_max<f64_3>(queue, pdatbuf.fields_f64_3[ihpart],pdatbuf.element_count);
double f64
Alias for double.
float f32
Alias for float.
std::uint32_t u32
32 bit unsigned integer
u32 get_field_idx(const std::string &field_name) const
Get the field id if matching name & type.
PatchDataLayer container class, the layout is described in patchdata_layout.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
header for PatchData related function and declaration