24#if __has_include(<nlohmann/json.hpp>)
25 #include <nlohmann/json.hpp>
36 template<
class T,
int n>
38 if constexpr (n == 1) {
40 }
else if constexpr (n == 2) {
42 }
else if constexpr (n == 3) {
43 return {v[0], v[1], v[2]};
44 }
else if constexpr (n == 4) {
45 return {v[0], v[1], v[2], v[3]};
46 }
else if constexpr (n == 8) {
47 return {v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]};
48 }
else if constexpr (n == 16) {
77 template<
class T,
size_t n>
79 if constexpr (n == 1) {
81 }
else if constexpr (n == 2) {
83 }
else if constexpr (n == 3) {
84 return {v[0], v[1], v[2]};
85 }
else if constexpr (n == 4) {
86 return {v[0], v[1], v[2], v[3]};
87 }
else if constexpr (n == 8) {
88 return {v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]};
89 }
else if constexpr (n == 16) {
114#if __has_include(<nlohmann/json.hpp>)
115NLOHMANN_JSON_NAMESPACE_BEGIN
116template<
typename T,
int n>
117struct adl_serializer<sycl::vec<T, n>> {
120 static void from_json(
const json &j, sycl::vec<T, n> &p) {
124NLOHMANN_JSON_NAMESPACE_END
void to_json(nlohmann::json &j, const PatchSchedulerConfig &p)
Converts a PatchSchedulerConfig object to a JSON object.
void from_json(const nlohmann::json &j, PatchSchedulerConfig &p)
Deserializes a PatchSchedulerConfig object from a JSON object.
namespace for backends this one is named only sham since shambackends is too long to write
std::array< T, n > sycl_vec_to_array(sycl::vec< T, n > v)
Converts a SYCL vector into a C++ standard library array.
sycl::vec< T, n > array_to_sycl_vec(std::array< T, n > v)
Converts a C++ standard library array into a SYCL vector.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.