X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update clang format version to 11 on github action
  • Loading branch information
pradeep committed Jan 21, 2021
commit 801f4c0d32728408409342e074fbe9409d49c9eb
12 changes: 6 additions & 6 deletions .github/workflows/clang-format-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ jobs:
uses: actions/checkout@master

- name: Check Sources
uses: DoozyX/clang-format-lint-action@v0.5
uses: DoozyX/clang-format-lint-action@v0.11
with:
source: './src'
extensions: 'h,cpp,hpp'
clangFormatVersion: 9
clangFormatVersion: 11

- name: Check Tests
uses: DoozyX/clang-format-lint-action@v0.5
uses: DoozyX/clang-format-lint-action@v0.11
with:
source: './test'
extensions: 'h,cpp,hpp'
clangFormatVersion: 9
clangFormatVersion: 11

- name: Check Examples
uses: DoozyX/clang-format-lint-action@v0.5
uses: DoozyX/clang-format-lint-action@v0.11
with:
source: './examples'
extensions: 'h,cpp,hpp'
clangFormatVersion: 9
clangFormatVersion: 11
12 changes: 6 additions & 6 deletions src/backend/common/host_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ size_t getHostMemorySize() {

#if defined(CTL_HW) && (defined(HW_MEMSIZE) || defined(HW_PHYSMEM64))
int mib[2];
mib[0] = CTL_HW;
mib[0] = CTL_HW;
#if defined(HW_MEMSIZE)
mib[1] = HW_MEMSIZE; /* OSX. --------------------- */
mib[1] = HW_MEMSIZE; /* OSX. --------------------- */
#elif defined(HW_PHYSMEM64)
mib[1] = HW_PHYSMEM64; /* NetBSD, OpenBSD. --------- */
#endif
int64_t size = 0; /* 64-bit */
int64_t size = 0; /* 64-bit */
size_t len = sizeof(size);
if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) return (size_t)size;
return 0L; /* Failed? */
Expand All @@ -90,13 +90,13 @@ size_t getHostMemorySize() {
#elif defined(CTL_HW) && (defined(HW_PHYSMEM) || defined(HW_REALMEM))
/* DragonFly BSD, FreeBSD, NetBSD, OpenBSD, and OSX. -------- */
int mib[2];
mib[0] = CTL_HW;
mib[0] = CTL_HW;
#if defined(HW_REALMEM)
mib[1] = HW_REALMEM; /* FreeBSD. ----------------- */
mib[1] = HW_REALMEM; /* FreeBSD. ----------------- */
#elif defined(HW_PYSMEM)
mib[1] = HW_PHYSMEM; /* Others. ------------------ */
#endif
unsigned int size = 0; /* 32-bit */
unsigned int size = 0; /* 32-bit */
size_t len = sizeof(size);
if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) return (size_t)size;
return 0L; /* Failed? */
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cpu/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class queue {
getEnvVar("AF_SYNCHRONOUS_CALLS") == "1") {}

template<typename F, typename... Args>
void enqueue(const F func, Args &&... args) {
void enqueue(const F func, Args &&...args) {
count++;
if (sync_calls) {
func(toParam(std::forward<Args>(args))...);
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cuda/kernel/fftconvolve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void complexMultiplyHelper(Param<convT> sig_packed, Param<convT> filter_packed,

int mul_elem = (sig_packed_elem < filter_packed_elem) ? filter_packed_elem
: sig_packed_elem;
blocks = dim3(divup(mul_elem, threads.x));
blocks = dim3(divup(mul_elem, threads.x));

EnqueueArgs qArgs(blocks, threads, getActiveStream());
if (kind == AF_BATCH_RHS) {
Expand Down
6 changes: 3 additions & 3 deletions src/backend/cuda/kernel/interp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ struct Interp1<Ty, Tp, xdim, 1> {
const int idx = ioff + xid * x_stride;

for (int n = 0; n < batch; n++) {
Ty outval = (cond || clamp)
? in.ptr[idx + n * in.strides[batch_dim]]
: zero;
Ty outval = (cond || clamp)
? in.ptr[idx + n * in.strides[batch_dim]]
: zero;
out.ptr[ooff + n * out.strides[batch_dim]] = outval;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend/cuda/kernel/random_engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ __device__ void sincos(__half val, __half *sptr, __half *cptr) {
float s, c;
float fval = __half2float(val);
sincos(fval, &s, &c);
*sptr = __float2half(s);
*cptr = __float2half(c);
*sptr = __float2half(s);
*cptr = __float2half(c);
#endif
}

Expand Down
8 changes: 4 additions & 4 deletions src/backend/cuda/kernel/reduce_by_key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ __global__ void compact(int *reduced_block_sizes, Param<Tk> keys_out,
const int bidw = blockIdx.z / nBlocksZ;

// reduced_block_sizes should have inclusive sum of block sizes
int nwrite = (blockIdx.x == 0) ? reduced_block_sizes[0]
: reduced_block_sizes[blockIdx.x] -
int nwrite = (blockIdx.x == 0) ? reduced_block_sizes[0]
: reduced_block_sizes[blockIdx.x] -
reduced_block_sizes[blockIdx.x - 1];
int writeloc = (blockIdx.x == 0) ? 0 : reduced_block_sizes[blockIdx.x - 1];

Expand Down Expand Up @@ -146,8 +146,8 @@ __global__ void compact_dim(int *reduced_block_sizes, Param<Tk> keys_out,
const int bidw = blockIdx.z / nBlocksZ;

// reduced_block_sizes should have inclusive sum of block sizes
int nwrite = (blockIdx.x == 0) ? reduced_block_sizes[0]
: reduced_block_sizes[blockIdx.x] -
int nwrite = (blockIdx.x == 0) ? reduced_block_sizes[0]
: reduced_block_sizes[blockIdx.x] -
reduced_block_sizes[blockIdx.x - 1];
int writeloc = (blockIdx.x == 0) ? 0 : reduced_block_sizes[blockIdx.x - 1];

Expand Down
4 changes: 2 additions & 2 deletions src/backend/cuda/kernel/shfl_intrinsics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ inline __device__ cuda::cfloat shfl_down_sync(unsigned mask, cuda::cfloat var,
cuda::cfloat res = {__shfl_down_sync(mask, var.x, delta),
__shfl_down_sync(mask, var.y, delta)};
#else
cuda::cfloat res = {__shfl_down(var.x, delta), __shfl_down(var.y, delta)};
cuda::cfloat res = {__shfl_down(var.x, delta), __shfl_down(var.y, delta)};
#endif
return res;
}
Expand Down Expand Up @@ -91,7 +91,7 @@ inline __device__ cuda::cfloat shfl_up_sync(unsigned mask, cuda::cfloat var,
cuda::cfloat res = {__shfl_up_sync(mask, var.x, delta),
__shfl_up_sync(mask, var.y, delta)};
#else
cuda::cfloat res = {__shfl_up(var.x, delta), __shfl_up(var.y, delta)};
cuda::cfloat res = {__shfl_up(var.x, delta), __shfl_up(var.y, delta)};
#endif
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cuda/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct kernel_type<common::half> {
using compute = float;

#if defined(NVCC) || defined(__CUDACC_RTC__)
using native = __half;
using native = __half;
#else
using native = common::half;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/backend/opencl/kernel/fftconvolve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void complexMultiplyHelper(Param packed, Param sig, Param filter,
filter_tmp.info.strides[3] * filter_tmp.info.dims[3];
int mul_elem = (sig_packed_elem < filter_packed_elem) ? filter_packed_elem
: sig_packed_elem;
int blocks = divup(mul_elem, THREADS);
int blocks = divup(mul_elem, THREADS);

cl::NDRange local(THREADS);
cl::NDRange global(blocks * THREADS);
Expand Down
6 changes: 3 additions & 3 deletions src/backend/opencl/kernel/homography.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ int computeH(Param bestH, Param H, Param err, Param x_src, Param y_src,
// Allocate some temporary buffers
Param inliers, idx, median;
inliers.info.offset = idx.info.offset = median.info.offset = 0;
inliers.info.dims[0] = (htype == AF_HOMOGRAPHY_RANSAC)
? blk_x_eh
: divup(nsamples, HG_THREADS);
inliers.info.dims[0] = (htype == AF_HOMOGRAPHY_RANSAC)
? blk_x_eh
: divup(nsamples, HG_THREADS);
inliers.info.strides[0] = 1;
idx.info.dims[0] = median.info.dims[0] = blk_x_eh;
idx.info.strides[0] = median.info.strides[0] = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/opencl/magma/magma_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ typedef enum {
// 2b) update min & max here, which are used to check bounds for
// magma2lapack_constants[] 2c) add lapack_xxxx_const() converter below and in
// control/constants.cpp
#define Magma2lapack_Min MagmaFalse // 0
#define Magma2lapack_Min MagmaFalse // 0
#define Magma2lapack_Max MagmaRowwise // 402

// ----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion test/var.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void dimCppSmallTest(const string pFileName,
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
array bout = (useDeprecatedAPI ? var(input, true)
: var(input, AF_VARIANCE_SAMPLE));
: var(input, AF_VARIANCE_SAMPLE));
array nbout = (useDeprecatedAPI ? var(input, false)
: var(input, AF_VARIANCE_POPULATION));

Expand Down
X Tutup