Skip to content

Commit 40e24a2

Browse files
committed
missed clang-tidy formatting
1 parent 697bc8f commit 40e24a2

File tree

9 files changed

+29
-32
lines changed

9 files changed

+29
-32
lines changed

src/compiler/lowering/MarkCUDAOpsPass.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ struct MarkCUDAOpsPass : public PassWrapper<MarkCUDAOpsPass, OperationPass<func:
9797
cols = 1;
9898
}
9999
logger->warn("op: {}, opSize: {}, adding dims: {}x{}, bytes: {}\nsetting unknowns to 1 for this test",
100-
op->getName().getStringRef().str(), opSize, rows, cols, rows * cols * t.getElementType().getIntOrFloatBitWidth() / 8);
100+
op->getName().getStringRef().str(), opSize, rows, cols,
101+
rows * cols * t.getElementType().getIntOrFloatBitWidth() / 8);
101102
opSize += rows * cols * t.getElementType().getIntOrFloatBitWidth() / 8;
102103
}
103104
}
@@ -117,19 +118,15 @@ struct MarkCUDAOpsPass : public PassWrapper<MarkCUDAOpsPass, OperationPass<func:
117118
if (cols < 0)
118119
cols = 1;
119120
}
120-
logger->warn("op: {}, opSize: {}, adding dims: {}x{}, bytes: {}\n",
121-
op->getName().getStringRef().str(), opSize, rows, cols, rows * cols * t.getElementType().getIntOrFloatBitWidth() / 8);
121+
logger->warn("op: {}, opSize: {}, adding dims: {}x{}, bytes: {}\n", op->getName().getStringRef().str(),
122+
opSize, rows, cols, rows * cols * t.getElementType().getIntOrFloatBitWidth() / 8);
122123
opSize += rows * cols * t.getElementType().getIntOrFloatBitWidth() / 8;
123124
}
124125
}
125-
logger->debug("Input size: {} KB, Output size: {} KB, Total required: {} MB, Mem budget: {}, required bytes: {}, budget bytes: {}",
126-
inSize / 1024,
127-
(opSize - inSize) / 1024,
128-
opSize / 1048576,
129-
mem_budget / 1048576,
130-
opSize,
131-
mem_budget
132-
);
126+
logger->debug("Input size: {} KB, Output size: {} KB, Total required: {} MB, Mem budget: {}, required bytes: "
127+
"{}, budget bytes: {}",
128+
inSize / 1024, (opSize - inSize) / 1024, opSize / 1048576, mem_budget / 1048576, opSize,
129+
mem_budget);
133130

134131
return opSize < mem_budget;
135132
}

src/ir/daphneir/DaphneInferTypesOpInterface.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,14 @@ void daphne::setInferedTypes(Operation *op, bool partialInferenceAllowed) {
672672
try {
673673
types = daphne::tryInferType(op);
674674
} catch (std::runtime_error &re) {
675-
throw ErrorHandler::rethrowError("InferTypesOpInterface.cpp:" + std::to_string(__LINE__), opStr + " " + re.what());
675+
throw ErrorHandler::rethrowError("InferTypesOpInterface.cpp:" + std::to_string(__LINE__),
676+
opStr + " " + re.what());
676677
} catch (std::exception &e) {
677-
throw ErrorHandler::rethrowError("InferTypesOpInterface.cpp:" + std::to_string(__LINE__), opStr + " " + e.what());
678+
throw ErrorHandler::rethrowError("InferTypesOpInterface.cpp:" + std::to_string(__LINE__),
679+
opStr + " " + e.what());
678680
} catch (...) {
679-
throw ErrorHandler::rethrowError("InferTypesOpInterface.cpp:" + std::to_string(__LINE__), "Unknown exception in: " + opStr);
681+
throw ErrorHandler::rethrowError("InferTypesOpInterface.cpp:" + std::to_string(__LINE__),
682+
"Unknown exception in: " + opStr);
680683
}
681684
const size_t numRes = op->getNumResults();
682685
if (types.size() != numRes)

src/parser/daphnedsl/DaphneDSLBuiltins.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ mlir::Value DaphneDSLBuiltins::createAffineFwdOp(mlir::Location loc, const std::
223223
}
224224

225225
mlir::Value DaphneDSLBuiltins::createBatchNorm2dInferenceFwdOp(mlir::Location loc, const std::string &func,
226-
const std::vector<mlir::Value> &args) {
226+
const std::vector<mlir::Value> &args) {
227227
const size_t numArgs = args.size();
228228
checkNumArgsExact(loc, func, numArgs, 6);
229229

@@ -759,8 +759,7 @@ antlrcpp::Any DaphneDSLBuiltins::build(mlir::Location loc, const std::string &fu
759759
if (func == "softmax") {
760760
checkNumArgsExact(loc, func, numArgs, 1);
761761
mlir::Value input_data = args[0];
762-
return static_cast<mlir::Value>(
763-
builder.create<mlir::daphne::SoftmaxOp>(loc, input_data.getType(), input_data));
762+
return static_cast<mlir::Value>(builder.create<mlir::daphne::SoftmaxOp>(loc, input_data.getType(), input_data));
764763
}
765764

766765
if (func == "batch_norm2d_backward") {

src/parser/daphnedsl/DaphneDSLBuiltins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class DaphneDSLBuiltins {
109109
mlir::Value createAffineFwdOp(mlir::Location loc, const std::string &func, const std::vector<mlir::Value> &args);
110110

111111
mlir::Value createBatchNorm2dInferenceFwdOp(mlir::Location loc, const std::string &func,
112-
const std::vector<mlir::Value> &args);
112+
const std::vector<mlir::Value> &args);
113113

114114
mlir::ResultRange createConv2dFwdOp(mlir::Location loc, const std::string &func,
115115
const std::vector<mlir::Value> &args);

src/runtime/local/kernels/BatchNorm2DTestForward.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ template <class DTRes, class DTArg> struct BatchNorm2DInferenceForward {
4545
// ****************************************************************************
4646

4747
template <class DTRes, class DTArg>
48-
void batchNorm2DInferenceForward(DTRes *&res, const DTArg *in, const DTArg *gamma, const DTArg *beta, const DTArg *emaMean,
49-
const DTArg *emaVar, const typename DTArg::VT eps, DCTX(dctx)) {
48+
void batchNorm2DInferenceForward(DTRes *&res, const DTArg *in, const DTArg *gamma, const DTArg *beta,
49+
const DTArg *emaMean, const DTArg *emaVar, const typename DTArg::VT eps, DCTX(dctx)) {
5050
BatchNorm2DInferenceForward<DTRes, DTArg>::apply(res, in, gamma, beta, emaMean, emaVar, eps, dctx);
5151
}
5252

src/runtime/local/kernels/CUDA/BatchNorm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
namespace CUDA {
2121
template <typename DTRes, typename DTArg>
22-
void BatchNormInferenceForward<DTRes, DTArg>::apply(DTRes *&res, const DTArg *data, const DTArg *gamma, const DTArg *beta,
23-
const DTArg *ema_mean, const DTArg *ema_var, const typename DTArg::VT eps,
24-
DCTX(dctx)) {
22+
void BatchNormInferenceForward<DTRes, DTArg>::apply(DTRes *&res, const DTArg *data, const DTArg *gamma,
23+
const DTArg *beta, const DTArg *ema_mean, const DTArg *ema_var,
24+
const typename DTArg::VT eps, DCTX(dctx)) {
2525
const size_t deviceID = 0; // ToDo: multi device support
2626
auto ctx = CUDAContext::get(dctx, deviceID);
2727
AllocationDescriptorCUDA alloc_desc(dctx, deviceID);

src/runtime/local/kernels/CUDA/Softmax.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ void Softmax<DTRes, DTArg>::apply(DTRes *&res, const DTArg *data, DCTX(dctx)) {
4949

5050
template struct Softmax<DenseMatrix<float>, DenseMatrix<float>>;
5151
template struct Softmax<DenseMatrix<double>, DenseMatrix<double>>;
52-
} // namespace CUDA::Softmax
52+
} // namespace CUDA

test/runtime/local/kernels/CUDA/BiasAddTest.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
#include "runtime/local/datagen/GenGivenVals.h"
2020
#include "runtime/local/kernels/CUDA/BiasAdd.h"
2121

22-
template <class DT>
23-
void checkBiasAdd(const DT* data, const DT* bias, const DT* expected, DaphneContext* dctx)
24-
{
25-
DT* res = nullptr;
22+
template <class DT> void checkBiasAdd(const DT *data, const DT *bias, const DT *expected, DaphneContext *dctx) {
23+
DT *res = nullptr;
2624
CUDA::BiasAdd<DT, DT>::apply(res, data, bias, dctx);
2725

2826
CHECK(Approx(*(res->getValues())).epsilon(1e-6) == *(expected->getValues()));
@@ -45,4 +43,3 @@ TEMPLATE_PRODUCT_TEST_CASE("CUDA::BiasAdd", TAG_KERNELS, (DenseMatrix), (float,
4543
DataObjectFactory::destroy(bias);
4644
DataObjectFactory::destroy(expected);
4745
}
48-

test/runtime/local/kernels/DNNBatchNorm2DForwardTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
#include <runtime/local/datagen/GenGivenVals.h>
2222

2323
template <class DT>
24-
void checkBatchNorm2DInferenceForward(const DT *in, const DT *gamma, const DT *beta, const DT *ema_mean, const DT *ema_var,
25-
const DT *exp, DaphneContext *dctx) {
24+
void checkBatchNorm2DInferenceForward(const DT *in, const DT *gamma, const DT *beta, const DT *ema_mean,
25+
const DT *ema_var, const DT *exp, DaphneContext *dctx) {
2626
DT *res = nullptr;
2727
typename DT::VT epsilon = 1e-5;
2828
BatchNorm2DInferenceForward<DT, DT>::apply(res, in, gamma, beta, ema_mean, ema_var, epsilon, dctx);
2929
CHECK(Approx(*(res->getValues())).epsilon(epsilon) == *(exp->getValues()));
3030
}
3131

32-
TEMPLATE_PRODUCT_TEST_CASE("batch_norm_inference_fwd", TAG_DNN, (DenseMatrix), (float, double)) { // NOLINT(cert-err58-cpp)
32+
TEMPLATE_PRODUCT_TEST_CASE("batch_norm_inference_fwd", TAG_DNN, (DenseMatrix),
33+
(float, double)) { // NOLINT(cert-err58-cpp)
3334
auto dctx = setupContextAndLogger();
3435
using DT = TestType;
3536

0 commit comments

Comments
 (0)