Skip to content

Commit 5b133ec

Browse files
author
Yuuichi Asahi
committed
fix: format
1 parent d41163f commit 5b133ec

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

examples/advanced/01_NavierStokes/01_navier_stokes.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#include <vector>
1+
// SPDX-FileCopyrightText: (C) The Kokkos-FFT development team, see COPYRIGHT.md file
2+
//
3+
// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
4+
25
#include <iostream>
36
#include <memory>
47
#include <Kokkos_Core.hpp>

examples/advanced/01_NavierStokes/io_utils.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,21 @@ void mkdir(const std::string& path, std::filesystem::perms mode) {
5858
std::filesystem::permissions(dir, mode);
5959
}
6060

61-
template<typename T>
61+
template <typename T>
6262
T string_to_num(const std::string& input) {
63-
static_assert(std::is_arithmetic<T>::value, "Template argument must be an arithmetic type");
63+
static_assert(std::is_arithmetic<T>::value,
64+
"Template argument must be an arithmetic type");
6465

65-
std::istringstream iss(input);
66-
T result;
67-
iss >> result;
66+
std::istringstream iss(input);
67+
T result;
68+
iss >> result;
6869

69-
// Check for conversion failure or extra characters
70-
if (iss.fail() || !iss.eof()) {
71-
throw std::invalid_argument("Invalid input for conversion to numeric type");
72-
}
70+
// Check for conversion failure or extra characters
71+
if (iss.fail() || !iss.eof()) {
72+
throw std::invalid_argument("Invalid input for conversion to numeric type");
73+
}
7374

74-
return result;
75+
return result;
7576
}
7677

7778
using dict = std::map<std::string, std::string>;
@@ -89,9 +90,8 @@ dict parse_args(int argc, char* argv[]) {
8990
return kwargs;
9091
}
9192

92-
template<typename T>
93-
T get_arg(dict& kwargs, const std::string& key,
94-
const T& default_value) {
93+
template <typename T>
94+
T get_arg(dict& kwargs, const std::string& key, const T& default_value) {
9595
if (kwargs.find(key) != kwargs.end()) {
9696
return string_to_num<T>(kwargs[key]);
9797
} else {
@@ -101,7 +101,7 @@ T get_arg(dict& kwargs, const std::string& key,
101101

102102
template <>
103103
std::string get_arg<std::string>(dict& kwargs, const std::string& key,
104-
const std::string& default_value) {
104+
const std::string& default_value) {
105105
if (kwargs.find(key) != kwargs.end()) {
106106
return kwargs[key];
107107
} else {

0 commit comments

Comments
 (0)