Commit 28649b6a authored by Paul's avatar Paul
Browse files

Format

parent 351fde4d
...@@ -58,8 +58,8 @@ inline __device__ __attribute__((const)) index_int compute_local_size() ...@@ -58,8 +58,8 @@ inline __device__ __attribute__((const)) index_int compute_local_size()
const auto ngroup = gridDim.x; const auto ngroup = gridDim.x;
#endif #endif
const auto group_id = blockIdx.x; const auto group_id = blockIdx.x;
const auto nglobal = compute_global_size(); const auto nglobal = compute_global_size();
if (group_id == ngroup - 1) if(group_id == ngroup - 1)
{ {
return nglobal % nlocal; return nglobal % nlocal;
} }
...@@ -71,7 +71,7 @@ inline __device__ __attribute__((const)) index_int compute_local_size() ...@@ -71,7 +71,7 @@ inline __device__ __attribute__((const)) index_int compute_local_size()
#ifdef MIGRAPHX_NGROUP #ifdef MIGRAPHX_NGROUP
// If global is divisible by local then local can be a const // If global is divisible by local then local can be a const
#if (MIGRAPHX_NGLOBAL % MIGRAPHX_NLOCAL == 0) || (MIGRAPHX_NGROUP == 1) #if(MIGRAPHX_NGLOBAL % MIGRAPHX_NLOCAL == 0) || (MIGRAPHX_NGROUP == 1)
#define MIGRAPHX_CONST_LOCAL 1 #define MIGRAPHX_CONST_LOCAL 1
#endif #endif
#endif #endif
......
...@@ -34,11 +34,12 @@ struct test_conv_group_add : verify_program<test_conv_group_add> ...@@ -34,11 +34,12 @@ struct test_conv_group_add : verify_program<test_conv_group_add>
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
migraphx::shape s{migraphx::shape::float_type, {1, 68, 28, 28}}; migraphx::shape s{migraphx::shape::float_type, {1, 68, 28, 28}};
auto x = mm->add_parameter("x", s); auto x = mm->add_parameter("x", s);
auto w = mm->add_parameter("w", {migraphx::shape::float_type, {68, 17, 1, 1}}); auto w = mm->add_parameter("w", {migraphx::shape::float_type, {68, 17, 1, 1}});
auto b = mm->add_parameter("b", {migraphx::shape::float_type, {68}}); auto b = mm->add_parameter("b", {migraphx::shape::float_type, {68}});
auto conv = mm->add_instruction(migraphx::make_op("convolution", {{"group", 4}}), x, w); auto conv = mm->add_instruction(migraphx::make_op("convolution", {{"group", 4}}), x, w);
auto bb = mm->add_instruction(migraphx::make_op("broadcast", {{"axis", 1}, {"out_lens", {1, 68, 28, 28}}}), b); auto bb = mm->add_instruction(
migraphx::make_op("broadcast", {{"axis", 1}, {"out_lens", {1, 68, 28, 28}}}), b);
mm->add_instruction(migraphx::make_op("add"), conv, bb); mm->add_instruction(migraphx::make_op("add"), conv, bb);
return p; return p;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment