aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compute/hs
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-07-11 16:10:14 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-16 13:59:36 +0000
commit1419534a0079618b9c12edd74fd756e36b0523bf (patch)
tree46e83a5a3c46cdf5aa70f48c2ed73b81874f481a /src/compute/hs
parent7e83f89dd67e7c66d853e78b4630450bfb406de0 (diff)
Whitespace cleanup again
Change-Id: I38ab9ff141eb088084a4c0e664f327ceb89fcf70 Reviewed-on: https://skia-review.googlesource.com/140784 Commit-Queue: Hal Canary <halcanary@google.com> Auto-Submit: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/compute/hs')
-rw-r--r--src/compute/hs/cl/bench/sort.cpp4
-rw-r--r--src/compute/hs/cl/gen9/hs_cl.h118
-rw-r--r--src/compute/hs/cl/hs_cl_launcher.c12
-rw-r--r--src/compute/hs/gen/main.c8
-rw-r--r--src/compute/hs/gen/target_cuda_sm3x.c8
-rw-r--r--src/compute/hs/gen/target_igp_genx.c38
-rw-r--r--src/compute/hs/gen/transpose.c10
7 files changed, 99 insertions, 99 deletions
diff --git a/src/compute/hs/cl/bench/sort.cpp b/src/compute/hs/cl/bench/sort.cpp
index 861c498ae4..13e0af556e 100644
--- a/src/compute/hs/cl/bench/sort.cpp
+++ b/src/compute/hs/cl/bench/sort.cpp
@@ -84,11 +84,11 @@ hs_cpu_sort_u32(uint32_t * a, uint32_t const count)
}
extern "C"
-char const *
+char const *
hs_cpu_sort_u64(uint64_t * a, uint32_t const count)
{
#if defined ( HS_USE_PARALLEL_SORT )
- std::sort(std::execution::par_unseq,a,a+count);
+ std::sort(std::execution::par_unseq,a,a+count);
return "std::sort(std::execution::par_unseq)()";
#elif defined ( HS_USE_STD_SORT )
std::sort(a,a+count);
diff --git a/src/compute/hs/cl/gen9/hs_cl.h b/src/compute/hs/cl/gen9/hs_cl.h
index a33b2b7b93..4926a14fb3 100644
--- a/src/compute/hs/cl/gen9/hs_cl.h
+++ b/src/compute/hs/cl/gen9/hs_cl.h
@@ -1,26 +1,26 @@
-//
-// Copyright 2016 Google Inc.
-//
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-//
-
-#ifndef HS_CL_ONCE
-#define HS_CL_ONCE
-
-#define HS_LANES_PER_WARP_LOG2 3
-#define HS_LANES_PER_WARP (1 << HS_LANES_PER_WARP_LOG2)
-#define HS_BS_WARPS 16
-#define HS_BS_WARPS_LOG2_RU 4
-#define HS_BC_WARPS_LOG2_MAX 4
-#define HS_FM_BLOCKS_LOG2_MIN 1
-#define HS_HM_BLOCKS_LOG2_MIN 1
-#define HS_KEYS_PER_LANE 16
-#define HS_REG_LAST(c) c##16
-#define HS_KEY_WORDS 2
-#define HS_KEY_TYPE ulong
-#define HS_EMPTY
-
+//
+// Copyright 2016 Google Inc.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+//
+
+#ifndef HS_CL_ONCE
+#define HS_CL_ONCE
+
+#define HS_LANES_PER_WARP_LOG2 3
+#define HS_LANES_PER_WARP (1 << HS_LANES_PER_WARP_LOG2)
+#define HS_BS_WARPS 16
+#define HS_BS_WARPS_LOG2_RU 4
+#define HS_BC_WARPS_LOG2_MAX 4
+#define HS_FM_BLOCKS_LOG2_MIN 1
+#define HS_HM_BLOCKS_LOG2_MIN 1
+#define HS_KEYS_PER_LANE 16
+#define HS_REG_LAST(c) c##16
+#define HS_KEY_WORDS 2
+#define HS_KEY_TYPE ulong
+#define HS_EMPTY
+
#define HS_SLAB_ROWS() \
HS_SLAB_ROW( 1, 0 ) \
HS_SLAB_ROW( 2, 1 ) \
@@ -39,7 +39,7 @@
HS_SLAB_ROW( 15, 14 ) \
HS_SLAB_ROW( 16, 15 ) \
HS_EMPTY
-
+
#define HS_TRANSPOSE_SLAB() \
HS_TRANSPOSE_STAGE( 1 ) \
HS_TRANSPOSE_STAGE( 2 ) \
@@ -85,38 +85,38 @@
HS_TRANSPOSE_REMAP( u, 15, 14 ) \
HS_TRANSPOSE_REMAP( u, 16, 16 ) \
HS_EMPTY
-
-#define HS_FM_BLOCKS_LOG2_1 0
-#define HS_FM_BLOCKS_LOG2_2 1
-#define HS_FM_BLOCKS_LOG2_3 2
-#define HS_FM_BLOCKS_LOG2_4 3
-#define HS_FM_BLOCKS_LOG2_5 4
-#define HS_FM_BLOCKS_LOG2_6 5
-#define HS_HM_BLOCKS_LOG2_5 0
-#define HS_FM_BLOCKS_LOG2_7 6
-#define HS_HM_BLOCKS_LOG2_6 1
-#define HS_FM_BLOCKS_LOG2_8 7
-#define HS_HM_BLOCKS_LOG2_7 2
-#define HS_FM_BLOCKS_LOG2_9 8
-#define HS_HM_BLOCKS_LOG2_8 3
-#define HS_FM_BLOCKS_LOG2_10 9
-#define HS_HM_BLOCKS_LOG2_9 4
-#define HS_FM_BLOCKS_LOG2_11 10
-#define HS_HM_BLOCKS_LOG2_10 5
-#define HS_FM_BLOCKS_LOG2_12 11
-#define HS_HM_BLOCKS_LOG2_11 6
-#define HS_FM_BLOCKS_LOG2_13 12
-#define HS_HM_BLOCKS_LOG2_12 7
-#define HS_FM_BLOCKS_LOG2_14 13
-#define HS_HM_BLOCKS_LOG2_13 8
-#define HS_FM_BLOCKS_LOG2_15 14
-#define HS_HM_BLOCKS_LOG2_14 9
-#define HS_FM_BLOCKS_LOG2_16 15
-#define HS_HM_BLOCKS_LOG2_15 10
-
-#endif
-
-//
-//
-//
-
+
+#define HS_FM_BLOCKS_LOG2_1 0
+#define HS_FM_BLOCKS_LOG2_2 1
+#define HS_FM_BLOCKS_LOG2_3 2
+#define HS_FM_BLOCKS_LOG2_4 3
+#define HS_FM_BLOCKS_LOG2_5 4
+#define HS_FM_BLOCKS_LOG2_6 5
+#define HS_HM_BLOCKS_LOG2_5 0
+#define HS_FM_BLOCKS_LOG2_7 6
+#define HS_HM_BLOCKS_LOG2_6 1
+#define HS_FM_BLOCKS_LOG2_8 7
+#define HS_HM_BLOCKS_LOG2_7 2
+#define HS_FM_BLOCKS_LOG2_9 8
+#define HS_HM_BLOCKS_LOG2_8 3
+#define HS_FM_BLOCKS_LOG2_10 9
+#define HS_HM_BLOCKS_LOG2_9 4
+#define HS_FM_BLOCKS_LOG2_11 10
+#define HS_HM_BLOCKS_LOG2_10 5
+#define HS_FM_BLOCKS_LOG2_12 11
+#define HS_HM_BLOCKS_LOG2_11 6
+#define HS_FM_BLOCKS_LOG2_13 12
+#define HS_HM_BLOCKS_LOG2_12 7
+#define HS_FM_BLOCKS_LOG2_14 13
+#define HS_HM_BLOCKS_LOG2_13 8
+#define HS_FM_BLOCKS_LOG2_15 14
+#define HS_HM_BLOCKS_LOG2_14 9
+#define HS_FM_BLOCKS_LOG2_16 15
+#define HS_HM_BLOCKS_LOG2_15 10
+
+#endif
+
+//
+//
+//
+
diff --git a/src/compute/hs/cl/hs_cl_launcher.c b/src/compute/hs/cl/hs_cl_launcher.c
index b0b9e4091b..f8a87f1dde 100644
--- a/src/compute/hs/cl/hs_cl_launcher.c
+++ b/src/compute/hs/cl/hs_cl_launcher.c
@@ -774,7 +774,7 @@ hs_fm_launcher(struct hs_state * const state,
// how many full-sized scaled flip-merge spans are there?
state->fm.full = state->bx.ru / full_span_warps;
state->fm.frac = 0;
-
+
// initialize down_warps
*down_warps = state->fm.full * full_span_warps;
@@ -787,10 +787,10 @@ hs_fm_launcher(struct hs_state * const state,
uint32_t const frac_rem = span_rem - half_span_warps;
uint32_t const frac_rem_pow2 = pow2_ru_u32(frac_rem);
- if (frac_rem_pow2 >= half_span_warps)
+ if (frac_rem_pow2 >= half_span_warps)
{
*down_warps += full_span_warps;
- state->fm.full += 1;
+ state->fm.full += 1;
}
else
{
@@ -895,7 +895,7 @@ hs_pad(uint32_t const count,
void
hs_sort(cl_command_queue cq, // out-of-order cq
- cl_mem vin,
+ cl_mem vin,
cl_mem vout,
uint32_t const count,
uint32_t const count_padded_in,
@@ -1019,7 +1019,7 @@ hs_sort(cl_command_queue cq, // out-of-order cq
}
}
- if (linearize)
+ if (linearize)
{
// launch linearize;
hs_transpose_launcher(&state,cq);
@@ -1113,7 +1113,7 @@ hs_create(cl_context context,
HS_CREATE_KERNELS(bc_kernels);
HS_CREATE_KERNELS(fm_kernels);
HS_CREATE_KERNELS(hm_kernels);
- HS_CREATE_KERNELS(transpose_kernels);
+ HS_CREATE_KERNELS(transpose_kernels);
cl(ReleaseProgram(program));
}
diff --git a/src/compute/hs/gen/main.c b/src/compute/hs/gen/main.c
index a79c34c08e..42f4518bfd 100644
--- a/src/compute/hs/gen/main.c
+++ b/src/compute/hs/gen/main.c
@@ -882,7 +882,7 @@ hsg_bs_flip_merge_level(struct hsg_op * ops,
uint32_t const level,
uint32_t const s_pairs)
{
- //
+ //
// Note there are a number of ways to flip merge these warps. There
// is a magic number in the merge structure that indicates which
// warp to activate as well as what network size to invoke.
@@ -917,7 +917,7 @@ hsg_bs_flip_merge_level(struct hsg_op * ops,
uint32_t s_rows = s_pairs * 2;
uint32_t base = 0;
-
+
while (s_rows > 0)
{
uint32_t active = merge->warps;
@@ -934,7 +934,7 @@ hsg_bs_flip_merge_level(struct hsg_op * ops,
// how many equal number of rows to merge?
uint32_t loops = s_rows / active;
- // decrement
+ // decrement
s_rows -= loops * active;
for (uint32_t ss=0; ss<loops; ss++)
@@ -998,7 +998,7 @@ hsg_bs_flip_merge(struct hsg_op * ops, struct hsg_merge const * const merge)
{
uint32_t const count = merge->levels[level].count;
- if (count == 0)
+ if (count == 0)
continue;
uint32_t const r_mid = hsg_config.thread.regs/2 + 1;
diff --git a/src/compute/hs/gen/target_cuda_sm3x.c b/src/compute/hs/gen/target_cuda_sm3x.c
index 436fc5f50d..6369aa33b0 100644
--- a/src/compute/hs/gen/target_cuda_sm3x.c
+++ b/src/compute/hs/gen/target_cuda_sm3x.c
@@ -51,7 +51,7 @@ hsg_target_cuda_sm3x(struct hsg_file * const files,
uint32_t const bc_max = msb_idx_u32(pow2_rd_u32(merge[0].warps));
fprintf(files[HSG_FILE_TYPE_HEADER].file,
- "// \n"
+ "// \n"
"// Copyright 2016 Google Inc. \n"
"// \n"
"// Use of this source code is governed by a BSD-style \n"
@@ -86,7 +86,7 @@ hsg_target_cuda_sm3x(struct hsg_file * const files,
files[HSG_FILE_TYPE_SOURCE].name);
fprintf(files[HSG_FILE_TYPE_SOURCE].file,
- "// \n"
+ "// \n"
"// Copyright 2016 Google Inc. \n"
"// \n"
"// Use of this source code is governed by a BSD-style \n"
@@ -461,12 +461,12 @@ hsg_target_cuda_sm3x(struct hsg_file * const files,
break;
case HSG_OP_TYPE_CMP_FLIP:
- fprintf(files[HSG_FILE_TYPE_SOURCE].file,
+ fprintf(files[HSG_FILE_TYPE_SOURCE].file,
"HS_CMP_FLIP(r%-3u,r%-3u,r%-3u)\n",ops->a,ops->b,ops->c);
break;
case HSG_OP_TYPE_CMP_HALF:
- fprintf(files[HSG_FILE_TYPE_SOURCE].file,
+ fprintf(files[HSG_FILE_TYPE_SOURCE].file,
"HS_CMP_HALF(r%-3u,r%-3u)\n",ops->a,ops->b);
break;
diff --git a/src/compute/hs/gen/target_igp_genx.c b/src/compute/hs/gen/target_igp_genx.c
index f321975ba0..3d0f2bc1b8 100644
--- a/src/compute/hs/gen/target_igp_genx.c
+++ b/src/compute/hs/gen/target_igp_genx.c
@@ -21,15 +21,15 @@
//
//
-static
+static
char
hsg_transpose_reg_prefix(uint32_t const cols_log2)
{
return 'a' + (('r' + cols_log2 - 'a') % 26);
}
-static
-void
+static
+void
hsg_transpose_blend(uint32_t const cols_log2,
uint32_t const row_ll, // lower-left
uint32_t const row_ur, // upper-right
@@ -41,10 +41,10 @@ hsg_transpose_blend(uint32_t const cols_log2,
hsg_transpose_reg_prefix(cols_log2-1),
hsg_transpose_reg_prefix(cols_log2),
cols_log2,row_ll+1,row_ur+1);
-}
+}
-static
-void
+static
+void
hsg_transpose_remap(uint32_t const row_from,
uint32_t const row_to,
FILE * file)
@@ -54,7 +54,7 @@ hsg_transpose_remap(uint32_t const row_from,
" HS_TRANSPOSE_REMAP( %c, %3u, %3u ) \\\n",
hsg_transpose_reg_prefix(msb_idx_u32(hsg_config.warp.lanes)),
row_from+1,row_to+1);
-}
+}
//
//
@@ -89,7 +89,7 @@ hsg_target_igp_genx(struct hsg_file * const files,
uint32_t const warp_lanes_log2 = msb_idx_u32(hsg_config.warp.lanes);
fprintf(files[HSG_FILE_TYPE_HEADER].file,
- "// \n"
+ "// \n"
"// Copyright 2016 Google Inc. \n"
"// \n"
"// Use of this source code is governed by a BSD-style \n"
@@ -125,7 +125,7 @@ hsg_target_igp_genx(struct hsg_file * const files,
fprintf(files[HSG_FILE_TYPE_HEADER].file,
"#define HS_SLAB_ROWS() \\\n");
-
+
for (uint32_t ii=1; ii<=hsg_config.thread.regs; ii++)
fprintf(files[HSG_FILE_TYPE_HEADER].file,
" HS_SLAB_ROW( %3u, %3u ) \\\n",ii,ii-1);
@@ -147,13 +147,13 @@ hsg_target_igp_genx(struct hsg_file * const files,
files[HSG_FILE_TYPE_HEADER].file,
hsg_transpose_blend,
hsg_transpose_remap);
-
+
fprintf(files[HSG_FILE_TYPE_HEADER].file,
" HS_EMPTY\n"
" \n");
fprintf(files[HSG_FILE_TYPE_SOURCE].file,
- "// \n"
+ "// \n"
"// Copyright 2016 Google Inc. \n"
"// \n"
"// Use of this source code is governed by a BSD-style \n"
@@ -215,11 +215,11 @@ hsg_target_igp_genx(struct hsg_file * const files,
"HS_TRANSPOSE_SLAB()\n");
}
break;
-
+
case HSG_OP_TYPE_BS_KERNEL_PROTO:
{
struct hsg_merge const * const m = merge + ops->a;
-
+
uint32_t const tpb = m->warps * hsg_config.warp.lanes;
uint32_t const bs = pow2_ru_u32(m->warps);
uint32_t const msb = msb_idx_u32(bs);
@@ -236,7 +236,7 @@ hsg_target_igp_genx(struct hsg_file * const files,
msb);
}
break;
-
+
case HSG_OP_TYPE_BS_KERNEL_PREAMBLE:
{
fprintf(files[HSG_FILE_TYPE_SOURCE].file,
@@ -466,12 +466,12 @@ hsg_target_igp_genx(struct hsg_file * const files,
break;
case HSG_OP_TYPE_CMP_FLIP:
- fprintf(files[HSG_FILE_TYPE_SOURCE].file,
+ fprintf(files[HSG_FILE_TYPE_SOURCE].file,
"HS_CMP_FLIP(%-3u,r%-3u,r%-3u)\n",ops->a,ops->b,ops->c);
break;
case HSG_OP_TYPE_CMP_HALF:
- fprintf(files[HSG_FILE_TYPE_SOURCE].file,
+ fprintf(files[HSG_FILE_TYPE_SOURCE].file,
"HS_CMP_HALF(%-3u,r%-3u)\n",ops->a,ops->b);
break;
@@ -523,7 +523,7 @@ hsg_target_igp_genx(struct hsg_file * const files,
ops->c,
ops->a);
break;
-
+
case HSG_OP_TYPE_BS_REG_SHARED_LOAD_LEFT:
fprintf(files[HSG_FILE_TYPE_SOURCE].file,
"HS_KEY_TYPE r%u_%-3u = (shared.m + smem_l_idx)[%u];\n",
@@ -598,7 +598,7 @@ hsg_target_igp_genx(struct hsg_file * const files,
#endif
}
break;
-
+
case HSG_OP_TYPE_BC_MERGE_H_PREAMBLE:
{
struct hsg_merge const * const m = merge + ops->a;
@@ -613,7 +613,7 @@ hsg_target_igp_genx(struct hsg_file * const files,
}
break;
-
+
case HSG_OP_TYPE_BX_MERGE_H_PRED:
fprintf(files[HSG_FILE_TYPE_SOURCE].file,
"if (get_sub_group_id() < %u)\n",
diff --git a/src/compute/hs/gen/transpose.c b/src/compute/hs/gen/transpose.c
index f99e966ff7..de15c62631 100644
--- a/src/compute/hs/gen/transpose.c
+++ b/src/compute/hs/gen/transpose.c
@@ -33,7 +33,7 @@ hsg_transpose(uint32_t const cols_log2,
{
// get mapping array
uint32_t * map_curr = ALLOCA(rows * sizeof(*map_curr));
- uint32_t * map_next = ALLOCA(rows * sizeof(*map_next));
+ uint32_t * map_next = ALLOCA(rows * sizeof(*map_next));
// init the mapping array
for (uint32_t ii=0; ii<rows; ii++)
@@ -53,7 +53,7 @@ hsg_transpose(uint32_t const cols_log2,
{
for (uint32_t jj=0; jj<rows; jj++)
{
- if (map_curr[jj] == stay)
+ if (map_curr[jj] == stay)
{
map_next[jj] = stay;
map_next[ii] = stay + (rows << (cc-1));
@@ -88,7 +88,7 @@ hsg_transpose(uint32_t const cols_log2,
static uint32_t cols; // implicit on SIMD/GPU
static
-void
+void
hsg_debug_remap(uint32_t const row_from,
uint32_t const row_to,
uint32_t * const r)
@@ -99,9 +99,9 @@ hsg_debug_remap(uint32_t const row_from,
}
static
-void
+void
hsg_debug_blend(uint32_t const cols_log2,
- uint32_t const row_ll, // lower-left
+ uint32_t const row_ll, // lower-left
uint32_t const row_ur, // upper-right
uint32_t * m)
{