Skip to content

Commit

Permalink
Apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyscientist committed Jul 9, 2024
1 parent c52fac3 commit 50db5c1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/spin_taste.cu
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace quda

void applySpinTaste(ColorSpinorField &out, const ColorSpinorField &in, QudaSpinTasteGamma gamma)
{
if constexpr(is_enabled<QUDA_STAGGERED_DSLASH>()) {
if constexpr (is_enabled<QUDA_STAGGERED_DSLASH>()) {
instantiate<SpinTastePhase_>(out, in, gamma);
} else {
errorQuda("Staggered operator has not been built");
Expand Down
25 changes: 14 additions & 11 deletions lib/targets/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ static const int Nstream = 9;
#define CHECK_CUDA_ERROR(func) \
target::cuda::set_runtime_error(func, #func, __func__, __FILE__, __STRINGIFY__(__LINE__));

#define NVML_CHECK(func) \
{ \
nvmlReturn_t ret = func; \
if (ret == NVML_ERROR_NOT_SUPPORTED) { \
warningQuda("%s not supported on this GPU\n", nvmlErrorString(ret)); \
} else if (ret != NVML_SUCCESS) { \
errorQuda(" NVML returns %s", nvmlErrorString(ret)); \
} \
#define NVML_CHECK(func) \
{ \
nvmlReturn_t ret = func; \
if (ret == NVML_ERROR_NOT_SUPPORTED) { \
warningQuda("%s not supported on this GPU\n", nvmlErrorString(ret)); \
} else if (ret != NVML_SUCCESS) { \
errorQuda(" NVML returns %s", nvmlErrorString(ret)); \
} \
}

namespace quda
Expand Down Expand Up @@ -131,20 +131,23 @@ namespace quda
CHECK_CUDA_ERROR(cudaSetDevice(device_id));
}

auto get_power() {
auto get_power()
{
unsigned int power = 0;
NVML_CHECK(nvmlDeviceGetPowerUsage(monitor_device_id, &power));
return 1e-3 * power;
}

auto get_clock() {
auto get_clock()
{
// other clocks available NVML_CLOCK_MEM and NVML_CLOCK_GRAPHICS
unsigned int clock = 0;
NVML_CHECK(nvmlDeviceGetClockInfo(monitor_device_id, NVML_CLOCK_SM, &clock));
return clock;
}

auto get_temperature() {
auto get_temperature()
{
unsigned int temp = 0;
NVML_CHECK(nvmlDeviceGetTemperature(monitor_device_id, NVML_TEMPERATURE_GPU, &temp));
return temp;
Expand Down
2 changes: 1 addition & 1 deletion lib/targets/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace quda
CHECK_HIP_ERROR(hipSetDevice(device_id));
}

void init_monitor() {}
void init_monitor() { }

// not implemented on HIP at present
state_t get_state() { return {}; }
Expand Down
9 changes: 5 additions & 4 deletions lib/tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ namespace quda

#define STR_(x) #x
#define STR(x) STR_(x)
static const std::string quda_version = STR(QUDA_VERSION_MAJOR) "." STR(QUDA_VERSION_MINOR) "." STR(QUDA_VERSION_SUBMINOR);
static const std::string quda_version
= STR(QUDA_VERSION_MAJOR) "." STR(QUDA_VERSION_MINOR) "." STR(QUDA_VERSION_SUBMINOR);
#undef STR
#undef STR_

Expand Down Expand Up @@ -395,9 +396,9 @@ namespace quda
cache_path.c_str());
#else
if (version_check && token.compare(quda_version))
errorQuda("Cache file %s does not match current QUDA version. \nPlease delete this file or set the "
"QUDA_RESOURCE_PATH environment variable to point to a new path.",
cache_path.c_str());
errorQuda("Cache file %s does not match current QUDA version. \nPlease delete this file or set the "
"QUDA_RESOURCE_PATH environment variable to point to a new path.",
cache_path.c_str());
#endif
ls >> token;
if (version_check && token.compare(quda_hash))
Expand Down

0 comments on commit 50db5c1

Please sign in to comment.