Skip to content

Commit

Permalink
Fix formatting based on clang-format style
Browse files Browse the repository at this point in the history
  • Loading branch information
9prady9 committed Nov 25, 2020
1 parent cdd6134 commit 5b2a686
Show file tree
Hide file tree
Showing 15 changed files with 353 additions and 359 deletions.
10 changes: 5 additions & 5 deletions examples/cuda/bubblechart.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ __global__ void setupRandomKernel(curandState* states,
int main(void) {
FORGE_CUDA_CHECK(
cudaMalloc((void**)&state, DATA_SIZE * sizeof(curandState_t)));
setupRandomKernel<<<divup(DATA_SIZE, 32), 32>>>(state, 314567);
setupRandomKernel<<<divup(DATA_SIZE, 32), 32> > >(state, 314567);
float* cos_out;
float* tan_out;
Expand Down Expand Up @@ -173,11 +173,11 @@ void kernel(float* dev_out, int functionCode, float* colors, float* alphas,
static const dim3 threads(32);
dim3 blocks(divup(DATA_SIZE, 32));
mapKernel<<<blocks, threads>>>(dev_out, functionCode, FRANGE_START, DX);
mapKernel<<<blocks, threads> > >(dev_out, functionCode, FRANGE_START, DX);
if (colors) colorsKernel<<<blocks, threads>>>(colors, state);
if (colors) colorsKernel<<<blocks, threads> > >(colors, state);
if (alphas) randKernel<<<blocks, threads>>>(alphas, state, 0, 1);
if (alphas) randKernel<<<blocks, threads> > >(alphas, state, 0, 1);
if (radii) randKernel<<<blocks, threads>>>(radii, state, 20, 60);
if (radii) randKernel<<<blocks, threads> > >(radii, state, 20, 60);
}
4 changes: 2 additions & 2 deletions examples/cuda/field.cu
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ void generatePoints(float* points, float* dirs) {
dim3 blocks(divup((int)(NELEMS), threads.x),
divup((int)(NELEMS), threads.y));

pointGenKernel<<<blocks, threads>>>(points, dirs, (int)(NELEMS), MINIMUM,
STEP);
pointGenKernel<<<blocks, threads> > >(points, dirs, (int)(NELEMS), MINIMUM,
STEP);
}
2 changes: 1 addition & 1 deletion examples/cuda/fractal.cu
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ void kernel(unsigned char* dev_out) {
static const dim3 threads(8, 8);
dim3 blocks(divup(DIMX, threads.x), divup(DIMY, threads.y));

julia<<<blocks, threads>>>(dev_out);
julia<<<blocks, threads> > >(dev_out);
}
14 changes: 7 additions & 7 deletions examples/cuda/histogram.cu
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main(void) {
Bitmap bmp = createBitmap(IMGW, IMGH);

FORGE_CUDA_CHECK(cudaMalloc((void**)&state, NBINS * sizeof(curandState_t)));
setupRandomKernel<<<1, NBINS>>>(state, 314567);
setupRandomKernel<<<1, NBINS> > >(state, 314567);
/*
* First Forge call should be a window creation call
Expand Down Expand Up @@ -227,18 +227,18 @@ void PerlinNoise::generateNoise() {
float amp = 1.0f;
float tamp = 0.0f;
perlinInitKernel<<<blocks, threads>>>(base, perlin, state);
perlinInitKernel<<<blocks, threads> > >(base, perlin, state);
for (int octave = 6; octave >= 0; --octave) {
int period = 1 << octave;
perlinComputeKernel<<<blocks, threads>>>(perlin, base, amp, period);
perlinComputeKernel<<<blocks, threads> > >(perlin, base, amp, period);
tamp += amp;
amp *= persistence;
}
perlinNormalize<<<blocks, threads>>>(perlin, tamp);
perlinNormalize<<<blocks, threads> > >(perlin, tamp);
}
__global__ void fillImageKernel(unsigned char* ptr, unsigned width,
Expand Down Expand Up @@ -268,7 +268,7 @@ void kernel(Bitmap& bmp, PerlinNoise& pn) {
dim3 blocks(divup(bmp.width, threads.x), divup(bmp.height, threads.y));
fillImageKernel<<<blocks, threads>>>(bmp.ptr, bmp.width, bmp.height,
fillImageKernel<<<blocks, threads> > >(bmp.ptr, bmp.width, bmp.height,
pn.perlin);
}
Expand Down Expand Up @@ -300,7 +300,7 @@ void populateBins(Bitmap& bmp, int* histOut, const unsigned nbins,
cudaMemset(histOut, 0, nbins * sizeof(int));
histogramKernel<<<blocks, threads>>>(bmp.ptr, histOut, nbins);
histogramKernel<<<blocks, threads> > >(bmp.ptr, histOut, nbins);
histColorsKernel<<<1, nbins>>>(histColors, state);
histColorsKernel<<<1, nbins> > >(histColors, state);
}
2 changes: 1 addition & 1 deletion examples/cuda/plot3.cu
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ void kernel(float t, float dx, float* dev_out) {
static const dim3 threads(1024);
dim3 blocks(divup(ZSIZE, 1024));

generateCurve<<<blocks, threads>>>(t, dx, dev_out, ZMIN, ZSIZE);
generateCurve<<<blocks, threads> > >(t, dx, dev_out, ZMIN, ZSIZE);
}
4 changes: 2 additions & 2 deletions examples/cuda/plotting.cu
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ void kernel(float* dev_out, int functionCode) {
static const dim3 threads(1024);
dim3 blocks(divup(DATA_SIZE, 1024));

simple_sinf<<<blocks, threads>>>(dev_out, DATA_SIZE, functionCode, dx,
FRANGE_START);
simple_sinf<<<blocks, threads> > >(dev_out, DATA_SIZE, functionCode, dx,
FRANGE_START);
}
6 changes: 3 additions & 3 deletions examples/cuda/stream.cu
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void generateColors(float* colors) {
static const dim3 threads(512);
dim3 blocks(divup(numElems, threads.x));

genColorsKernel<<<blocks, threads>>>(colors, numElems);
genColorsKernel<<<blocks, threads> > >(colors, numElems);
}
__global__ void pointGenKernel(float* points, float* dirs, int nBBS0,
Expand Down Expand Up @@ -137,6 +137,6 @@ void generatePoints(float* points, float* dirs) {
dim3 blocks(blk_x * NELEMS, blk_y);
pointGenKernel<<<blocks, threads>>>(points, dirs, blk_x, NELEMS, MINIMUM,
STEP);
pointGenKernel<<<blocks, threads> > >(points, dirs, blk_x, NELEMS, MINIMUM,
STEP);
}
2 changes: 1 addition & 1 deletion examples/cuda/surface.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ void kernel(float dx, float* dev_out) {
static const dim3 threads(8, 8);
dim3 blocks(divup(XSIZE, threads.x), divup(YSIZE, threads.y));

sincos_surf<<<blocks, threads>>>(dx, dev_out, XMIN, YMIN, XSIZE, YSIZE);
sincos_surf<<<blocks, threads> > >(dx, dev_out, XMIN, YMIN, XSIZE, YSIZE);
}
4 changes: 3 additions & 1 deletion examples/opencl/fractal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ void julia(global unsigned char* out, const unsigned w, const unsigned h) {
)EOK";
// clang-format on

inline int divup(int a, int b) { return (a + b - 1) / b; }
inline int divup(int a, int b) {
return (a + b - 1) / b;
}

void kernel(cl::Buffer& devOut, cl::CommandQueue& queue) {
static std::once_flag compileFlag;
Expand Down
4 changes: 3 additions & 1 deletion examples/opencl/plot3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ void generateCurve(global float* out, const float t,
)EOK";
// clang-format on

inline int divup(int a, int b) { return (a + b - 1) / b; }
inline int divup(int a, int b) {
return (a + b - 1) / b;
}

void kernel(cl::Buffer& devOut, cl::CommandQueue& queue, float t) {
static std::once_flag compileFlag;
Expand Down
14 changes: 7 additions & 7 deletions src/api/c/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/

#include <common/chart.hpp>
#include <common/chart_renderables.hpp>
#include <common/err_handling.hpp>
#include <common/font.hpp>
#include <common/handle.hpp>
#include <common/image.hpp>
#include <common/window.hpp>
#include <fg/chart.h>
#include <fg/exception.h>
#include <fg/font.h>
Expand All @@ -15,13 +22,6 @@
#include <fg/plot.h>
#include <fg/surface.h>
#include <fg/window.h>
#include <common/chart.hpp>
#include <common/chart_renderables.hpp>
#include <common/err_handling.hpp>
#include <common/font.hpp>
#include <common/handle.hpp>
#include <common/image.hpp>
#include <common/window.hpp>

using namespace forge;
using namespace forge::common;
Expand Down
2 changes: 1 addition & 1 deletion src/api/cpp/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/

#include <error.hpp>
#include <fg/chart.h>
#include <fg/font.h>
#include <fg/histogram.h>
#include <fg/image.h>
#include <fg/plot.h>
#include <fg/surface.h>
#include <fg/window.h>
#include <error.hpp>

#include <utility>

Expand Down
Loading

0 comments on commit 5b2a686

Please sign in to comment.