Skip to content

Commit 0398c55

Browse files
committed
Update clang-format version to 15 in GitHub actions
1 parent 488f4e5 commit 0398c55

File tree

13 files changed

+40
-41
lines changed

13 files changed

+40
-41
lines changed

.github/workflows/unix_cpu_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
uses: actions/checkout@master
1818

1919
- name: Check Sources
20-
uses: DoozyX/clang-format-lint-action@v0.14
20+
uses: DoozyX/clang-format-lint-action@v0.15
2121
with:
2222
source: './src ./test ./examples'
2323
extensions: 'h,cpp,hpp'
24-
clangFormatVersion: 14
24+
clangFormatVersion: 15
2525

2626
documentation:
2727
name: Documentation

src/api/unified/symbol_manager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool checkArrays(af_backend activeBackend, T a, Args... arg) {
156156
if (index_ != arrayfire::unified::getActiveBackend()) { \
157157
index_ = arrayfire::unified::getActiveBackend(); \
158158
func = (af_func)arrayfire::common::getFunctionPointer( \
159-
arrayfire::unified::getActiveHandle(), __func__); \
159+
arrayfire::unified::getActiveHandle(), __func__); \
160160
} \
161161
return func(__VA_ARGS__); \
162162
} else { \

src/backend/common/graphics_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ fg_window ForgeManager::getMainWindow() {
260260
}
261261
fg_window w = nullptr;
262262
forgeError = this->mPlugin->fg_create_window(
263-
&w, WIDTH, HEIGHT, "ArrayFire", NULL, true);
263+
&w, WIDTH, HEIGHT, "ArrayFire", NULL, true);
264264
if (forgeError != FG_ERR_NONE) { return; }
265265
this->setWindowChartGrid(w, 1, 1);
266266
this->mPlugin->fg_make_window_current(w);

src/backend/cpu/convolve.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Array<T> conv2DataGradient(const Array<T> &incoming_gradient,
193193
Array<T> collapsed_gradient = incoming_gradient;
194194
collapsed_gradient = reorder(collapsed_gradient, dim4(0, 1, 3, 2));
195195
collapsed_gradient = modDims(
196-
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
196+
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
197197

198198
Array<T> res =
199199
matmul(collapsed_gradient, collapsed_filter, AF_MAT_NONE, AF_MAT_TRANS);
@@ -232,7 +232,7 @@ Array<T> conv2FilterGradient(const Array<T> &incoming_gradient,
232232
Array<T> collapsed_gradient = incoming_gradient;
233233
collapsed_gradient = reorder(collapsed_gradient, dim4(0, 1, 3, 2));
234234
collapsed_gradient = modDims(
235-
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
235+
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
236236

237237
Array<T> res =
238238
matmul(unwrapped, collapsed_gradient, AF_MAT_NONE, AF_MAT_NONE);

src/backend/cuda/convolveNN.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Array<T> data_gradient_base(const Array<T> &incoming_gradient,
260260
Array<T> collapsed_gradient = incoming_gradient;
261261
collapsed_gradient = reorder(collapsed_gradient, dim4(0, 1, 3, 2));
262262
collapsed_gradient = modDims(
263-
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
263+
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
264264

265265
T alpha = scalar<T>(1.0);
266266
T beta = scalar<T>(0.0);
@@ -390,7 +390,7 @@ Array<T> filter_gradient_base(const Array<T> &incoming_gradient,
390390
Array<T> collapsed_gradient = incoming_gradient;
391391
collapsed_gradient = reorder(collapsed_gradient, dim4(0, 1, 3, 2));
392392
collapsed_gradient = modDims(
393-
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
393+
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
394394

395395
T alpha = scalar<T>(1.0);
396396
T beta = scalar<T>(0.0);

src/backend/cuda/kernel/random_engine.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ static const int THREADS = 256;
6060
#define HALF_HALF_FACTOR __ushort_as_half(0x80)
6161

6262
// Conversion to half adapted from Random123
63-
//#define SIGNED_HALF_FACTOR \
63+
// #define SIGNED_HALF_FACTOR \
6464
//((1.0f) / (std::numeric_limits<short>::max() + (1.0f)))
65-
//#define SIGNED_HALF_HALF_FACTOR ((0.5f) * SIGNED_HALF_FACTOR)
65+
// #define SIGNED_HALF_HALF_FACTOR ((0.5f) * SIGNED_HALF_FACTOR)
6666
//
6767
// NOTE: The following constants for half were calculated using the formulas
6868
// above. This is done so that we can avoid unnecessary computations because the

src/backend/oneapi/compile_module.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,6 @@ string getProgramBuildLog(const kernel_bundle<bundle_state::executable> &prog) {
7171
namespace arrayfire {
7272
namespace oneapi {
7373

74-
// const static string DEFAULT_MACROS_STR(
75-
// "\n\
76-
//#ifdef USE_DOUBLE\n\
77-
//#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n\
78-
//#endif\n \
79-
//#ifdef USE_HALF\n\
80-
//#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n\
81-
//#else\n \
82-
//#define half short\n \
83-
//#endif\n \
84-
//#ifndef M_PI\n \
85-
//#define
86-
// M_PI 3.1415926535897932384626433832795028841971693993751058209749445923078164\n
87-
// \
88-
//#endif\n \
89-
//");
90-
9174
/*
9275
get_kernel_bundle<>() needs sycl::context
9376
kernel_bundle<bundle_state::executable> buildProgram(const vector<string>

src/backend/oneapi/exampleFunction.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
#include <err_oneapi.hpp> // error check functions and Macros
1717
// specific to oneapi backend
1818

19-
//#include <kernel/exampleFunction.hpp> // this header under the folder
20-
// src/oneapi/kernel
21-
// defines the OneAPI kernel wrapper
22-
// function to which the main computation of your
23-
// algorithm should be relayed to
19+
// #include <kernel/exampleFunction.hpp> // this header under the folder
20+
// src/oneapi/kernel
21+
// defines the OneAPI kernel wrapper
22+
// function to which the main computation of your
23+
// algorithm should be relayed to
2424

2525
using af::dim4;
2626

src/backend/oneapi/jit.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ using sycl::backend;
6262
namespace arrayfire {
6363

6464
namespace opencl {
65+
66+
const static string DEFAULT_MACROS_STR(R"JIT(
67+
#ifdef USE_DOUBLE
68+
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
69+
#endif
70+
#ifdef USE_HALF
71+
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
72+
#else
73+
#define half short
74+
#endif
75+
#ifndef M_PI
76+
#define
77+
M_PI 3.1415926535897932384626433832795028841971693993751058209749445923078164
78+
#endif
79+
)JIT");
80+
6581
string getKernelString(const string& funcName, const vector<Node*>& full_nodes,
6682
const vector<Node_ids>& full_ids,
6783
const vector<int>& output_ids, const bool is_linear,

src/backend/opencl/convolve.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Array<T> conv2DataGradient(const Array<T> &incoming_gradient,
185185
Array<T> collapsed_gradient = incoming_gradient;
186186
collapsed_gradient = reorder(collapsed_gradient, dim4(0, 1, 3, 2));
187187
collapsed_gradient = modDims(
188-
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
188+
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
189189

190190
Array<T> res =
191191
matmul(collapsed_gradient, collapsed_filter, AF_MAT_NONE, AF_MAT_TRANS);
@@ -224,7 +224,7 @@ Array<T> conv2FilterGradient(const Array<T> &incoming_gradient,
224224
Array<T> collapsed_gradient = incoming_gradient;
225225
collapsed_gradient = reorder(collapsed_gradient, dim4(0, 1, 3, 2));
226226
collapsed_gradient = modDims(
227-
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
227+
collapsed_gradient, dim4(cDims[0] * cDims[1] * cDims[3], cDims[2]));
228228

229229
Array<T> res =
230230
matmul(unwrapped, collapsed_gradient, AF_MAT_NONE, AF_MAT_NONE);

0 commit comments

Comments
 (0)